It isn't possible to provide rhs + coordinate_derivatives to ode_function_generator
It seems that using the coordinate_derivatives kwarg forces you to use both the rhs and mass_matrix, i.e. you can't solve the dynamic differential equations and kinematical differential equations and pass them in separately. If you could, this would reduce the number of rows in the linear solve. Edit: striked, this doesn't apply to a symbolically solved rhs!
Although it is simple to do:
eom = kane.rhs()
Which assembles the full right hand side but only "inverts" the dynamical mass matrix. So this isn't really needed, other than maybe showing an example in the documentation.
It seems that using the
coordinate_derivativeskwarg forces you to use both therhsandmass_matrix, i.e. you can't solve the dynamic differential equations and kinematical differential equations and pass them in separately. If you could, this would reduce the number of rows in the linear solve.
I use it like you showed me:
rhs_gen_ode = generate_ode_function(
forcing_vector,
KM.q,
KM.u,
constants=constants,
mass_matrix=mass_matrix,
specifieds=specified,
coordinate_derivatives=kin_eqs_solved, # rhs of kinematical diff. equations
generator='cython',
linear_sys_solver='sympy',
constants_arg_type='array',
specifieds_arg_type='array',
)
where mass_matrix = kanes.mass_matrix amd forcing_vector = kanes.forcing, kin_eqs_solved hold the kinematical differential equations solved for q_i.diff(t)
Where would the rhs be?
NB: I must still be doing something wrong: where lambdify or symjit take 2 - 3 sec to do the compilation of the simple simulation I am on right now, generate_ode_function takes almost 180 min.
Please open new issues/discussions about new topics. I don't see how what you've written is related to this issue.
Please open new issues/discussions about new topics. I don't see how what you've written is related to this issue.
Reason was that you stated rhs has to be used in generate_ode_function, and I did not know where in the signature it should be.