sympy.physics.mechanics. Kane's fr, frstar #26252
Replies: 3 comments 1 reply
-
By definition, |
Beta Was this translation helpful? Give feedback.
-
Fair enough! :-( ValueError Traceback (most recent call last) File c:\Users\Peter\anaconda3\envs\sympy-dev\Lib\site-packages\cyipopt\cython\ipopt_wrapper.pyx:621, in ipopt_wrapper.Problem.solve() ValueError: Wrong length of x0. But I have to look somewhere else. I just have no idea, where to look at the moment. |
Beta Was this translation helpful? Give feedback.
-
I found the problem. I had declared the specified_symbols as sm.symbols instead of as me.dynamicsymbols when I set up Kane's equations. |
Beta Was this translation helpful? Give feedback.
-
Below is a simple program to generate the EOMs of a single 3D pendulum, modelled as a rigid body, swinging around O, the fixed point in the inertial frame N.
I came across this: frstar contains the accelerations of the generalized coordinates. As per my understanding, this should not be so.
Also
If I form force = KM.forcing_full, force does not contain any accelerations.
This does not seem to happen with 2D simulations.
Explanation: I have played around with many 2D and 3D simulations, but never pad attention to fr, frstar, as I needed the mass matrix and the force vector to integrate numerically, using solve_ivp. Only when I started to play with opty recently. did I use fr, frstar. I started with 2D simulations with opty, and there was no problem. Only when a 3D problem did not work, a hint from @tjstienstra gave me the idea of looking at fr, frstar, and I noticed these acceleratrions in fstar.
Any help would the greatly appreciated!
I think, forming rhs =$massmatrix^{-1} \cdot forcevektor$ and then putting EOM = rhs - state_vector should give the EOM as required by opty. Is this correct?
(But calculating rhs symbolically is not feasible for larger simulations as per my experinece (?) )
Beta Was this translation helpful? Give feedback.
All reactions