|
6 | 6 | that the model falls down on the treadmill. It also compares the evaluation |
7 | 7 | speed of PyDy's and Autolev's models. |
8 | 8 | """ |
9 | | -print("loading modules...") |
10 | 9 | import timeit |
11 | 10 |
|
12 | 11 | from algait2de.gait2de import evaluate_autolev_rhs |
|
20 | 19 | import yaml |
21 | 20 |
|
22 | 21 | # %% |
23 | | -# Derive the equations of motion, including a constant treadmill motion. |
24 | | -print("deriving equations of motion...") |
25 | | -# symbolics = derive.derive_equations_of_motion(treadmill=True) |
26 | | -symbolics = derive.derive_equations_of_motion(treadmill=True, passive_torques=True) |
| 22 | +# Derive the equations of motion, including a constant treadmill motion and |
| 23 | +# passive joint torques. |
| 24 | +symbolics = derive.derive_equations_of_motion(treadmill=True, |
| 25 | + passive_torques=True) |
27 | 26 |
|
28 | 27 | # %% |
29 | 28 | # Load a parameter mapping from pygait2d symbol to numerical value, as well as |
|
42 | 41 | # %% |
43 | 42 | # Use PyDy to generate a function that can evaluate the right hand side of the |
44 | 43 | # ordinary differential equations of the multibody system. This uses PyDy's |
45 | | -# code geenration settings that result in the fastest numerical evaluation |
| 44 | +# code generation settings that result in the fastest numerical evaluation |
46 | 45 | # times at the cost of a slower code generation and compilation time. |
47 | 46 | rhs = generate_ode_function( |
48 | 47 | symbolics.kanes_method.forcing, |
|
89 | 88 | # Simulate the model for two seconds using the LSODA integrator (switches |
90 | 89 | # between stiff and non-stiff modes). |
91 | 90 | time_vector = np.linspace(0.0, 2.0, num=61) |
92 | | -print("simulating...") |
93 | 91 | trajectories = odeint(rhs, initial_conditions, time_vector, args=args) |
94 | 92 |
|
95 | 93 | # %% |
|
0 commit comments