From: Tom Lintern on
Hi,

I currently have the eqtuations of motion for a pendlum with a moving support. The x co-ord of the origin moves along some known path, prescribed in the main file before the solver is called. i.e x = [x(t=0),x(t+dt),x(t+2dt).....]

The paramaters I am solving for are the angle of the pendulum (y(1)) and the angular velocity (y(2)) and an example of the form that the equations of motion are in is shown below:

-(l*m*cos(y(1))* x'' +phi*y(2)+l*m+l*m*g)*sin(y(1)))/(l^2*m)

The problem occurs when I have to access x''. I can differentiate x to get another array and it is then padded to be the same length as x. I therefore need to access x'' at the appropriate time index depending on where in the solver I am. However the solver does not increment t in multiples of dt.

Does anyone know how I can get around this? Possibly interpolate x'' within each function call?

Thanks very much!!