Skip to content

Commit

Permalink
add fast solvers for gust problems
Browse files Browse the repository at this point in the history
  • Loading branch information
ACea15 committed Jan 17, 2025
1 parent 32292df commit 76a3175
Show file tree
Hide file tree
Showing 8 changed files with 770 additions and 360 deletions.
21 changes: 21 additions & 0 deletions docs/play_examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -694,3 +694,24 @@ def fshard(x):
jax.debug.visualize_array_sharding(y[:,0])

#print(y)

#################################

import jax
from jax import jit
from functools import partial


def inner_function(x, static_val):
# The behavior of `static_val` in JIT context depends on how it was passed
return x + static_val

def outer_function(x, static_val):
return inner_function(x, static_val)

# JIT-compile the outer function where the second argument is treated as static
compiled_function = jit(outer_function, static_argnums=(1,))

# Call the compiled function with a static argument
result = compiled_function(3, 10)
print(result) # Expected to print 13
2 changes: 1 addition & 1 deletion feniax/intrinsic/dq_dynamic.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ def dq_20g242(t, q, *args):
# @jax.jit
# @partial(jax.jit, static_argnames=['q'])
def dq_20g21(t, q, *args):
"""Gust response."""
"""Gust response, clamped model"""

(
eta_0,
Expand Down
Loading

0 comments on commit 76a3175

Please sign in to comment.