Skip to content

Commit

Permalink
add comments to example
Browse files Browse the repository at this point in the history
  • Loading branch information
ACea15 committed Dec 12, 2024
1 parent 14bf97c commit 80c1a11
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 3 deletions.
10 changes: 7 additions & 3 deletions examples/RafaFlyingBeam/P3_simulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# FENIAX:1 ends here

# [[file:modelgen.org::*FENIAX][FENIAX:2]]
v_x = 0.
v_x = 1.
v_y = 0.
v_z = 0.
omega_x = 0.
Expand Down Expand Up @@ -36,8 +36,8 @@
inp.system.solution = "dynamic"
inp.system.bc1 = 'free'
inp.system.xloads.gravity_forces = gravity_forces
inp.system.t1 = 2.
inp.system.tn = 2001
inp.system.t1 = 1.
inp.system.tn = 5001
inp.system.solver_library = "runge_kutta" #"diffrax" #
inp.system.solver_function = "ode"
inp.system.solver_settings = dict(solver_name="rk4")
Expand All @@ -50,4 +50,8 @@
)
config = configuration.Config(inp)
sol = feniax.feniax_main.main(input_obj=config)

# all solution data in the sol object (everything are tensors)
# for instance: sol.dynamicsystem_sys1.ra position of node [time_step, component, node_id]
# sol.dynamicsystem_sys1.X1 for velocities and so on
# FENIAX:3 ends here
22 changes: 22 additions & 0 deletions examples/RafaFlyingBeam/modelgen.org
Original file line number Diff line number Diff line change
Expand Up @@ -374,4 +374,26 @@ Set model to be run (mi), initial conditions and whether to include gravity forc
config = configuration.Config(inp)
sol = feniax.feniax_main.main(input_obj=config)

# all solution data in the sol object (everything are tensors)
# for instance: sol.dynamicsystem_sys1.ra position of node [time_step, component, node_id]
# sol.dynamicsystem_sys1.X1 for velocities and so on
#+end_src

Navigate to streamlit folder and run from terminal as:
streamlit run Home.py

Geometry, modes, solutions, all plots are produce there automatically.

For MATLAB postprocessing one can save any of the tensors as:

#+begin_src python :tangle no
import numpy as np
from scipy.io import savemat

# Create a NumPy array
array = np.array([[1, 2, 3], [4, 5, 6]])

# Save the array to a MAT-file
savemat('my_array.mat', {'array': array})

#+end_src

0 comments on commit 80c1a11

Please sign in to comment.