Thanks!
Suppose I have the initial conditions.
I solve the system in this way, tell me if it is write!
I have a 3 dof system in heave, roll and pitch, of the second order.
I call y=[ heave position, heave velocity, roll position, roll velocity, pitch position, pitch velocity].
I call yd=[heave velocity, heave acceleration, roll velocity, roll acceleration, pitch velocity, pitch acceleration]
I rewrite the system in the form:
function yd=deriv(t,y)
yd(1)=y(2)
yd(2)=f(y,t)
yd(3)=y(4)
yd(4)=f(y,t)
yd(5)=y(6)
yd(6)=f(y,t)
The problem is that in f(y) compare other acceleration terms. Can I write the system in this way?
yd=zeros(6,1)
yd(1)=y(2)
yd(2)=f(t,y,yd)
yd(3)=y(4)
yd(4)=f(t,y,yd)
yd(5)=y(6)
yd(6)=f(t,y,yd)
I think if I know y is it possible. What do you think??
The second question is: to solve the system I only have to write
[t,y]=ode45('deriv',[t0 tf],y0)
Is it true? Or I have to study something related to singularities??
Thanks