Hello Jason,
As a start to understand Pydy, I have created a very simple pendulum.
I have started very simple, with a 1 DOF, single body (a particle on distance r) pendulum. I am able to generate my mass matrix and forcing vector, from the equation of Kane, and I have entered them into the function.
My arguments are as follows (and are correct):
mass_matrix = matrix([[m*r**2]])
forcing_vector = matrix([[m*g*r*sin(q(t))]])
constants = [m g r]
coordinates = [q(t)]
speeds [u(t)]
I have entered them as follows:
RHS = generate_ode_function(mass_matrix, forcing_vector, constants, coordinates, speeds)
Unfortunately, the function generate_ode_function does not work. The error that I get is: “ AttributeError: 'list' object has no attribute ‘shape’ “ referring to the mass_matrix doing a consistency check. I am having troubles finding out what the reason is, since there are no requirements on the order of entering the arguments. Do you know what I have done wrong?
Furthermore, I wanted to ask two questions:
- does the function work with just one body?
- which requirements there are on the description of the arguments. Do you always need to refer to “mass_matrix” etc or can a name as MM can be entered as well?
With kind regards,
Anita Le mair