Hello
I am trying to develop equations of motion using sympy of a complex system. 
It takes 4-5 minutes to get the mass matrix (M) and coriolis vector (C). 
Hence I decided to use sympy's codegen and try to make it fast. 
I can write my equations as 

d^2 *q*/ dt^2 = M_inverse (Tau - C - G) 
but M, C, Tau (torque) and G(gravity) are defined with respect to state 
variables and its derivatives. And I cant figure out how to do it.

 I am attaching a simple two degree of freedom planar robot's code for easy 
understanding of my problem. My state variables are the angles q1(t) and 
q2(t) (dynamic symbols). There are other variables like lengths, mass, 
inertia of the links which are defined as symbols. M(q(t)), C(q(t), dq(t)), 
G(q(t)) matrices are derived symbolically (line 14). My doubt is if I want 
to play around with the numerical values of the variables in M, C, and G, 
how can I efficiently generate code and cythonize and build wrapper?

Any help would be really appreciated

Thanks

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/eb589af0-2dca-4b8d-bfff-290a4767e20a%40googlegroups.com.

Attachment: 2R_manipulator_dynamics.ipynb
Description: Binary data

Reply via email to