ode45 with multi functions

19 visualizaciones (últimos 30 días)
ali
ali el 7 de Dic. de 2013
Actually i want a problem with ode45, but there is three function which express the problem here is my script: tspan = 0 : 0.001 : 3; y0 = [0;0]; [t,y] = ode45(@nonlinsys, tspan,y0); function f = force(wn_sq,damping,Umax,ydot,y,x_desire) f = wn_sq*(x_desire-y)+ damping*(-ydot);
if f > Umax
f = Umax;
else
f < -Umax
f = -Umax;
end
end
function xd = x_desire(t)
xd = heaviside(t-0.5);
end
function dy = nonlinsys(t,y,wn_sq,damping,Umax,ydot,x_desire) dy(1)=y(2); dy(2) = force. dy = dy'; end
would you please help where the source errors are?

Respuestas (0)

Categorías

Más información sobre Ordinary Differential Equations en Help Center y File Exchange.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by