Reputation: 13
I have an ode equation in matrix form.
A=[ -0.1078 0 0 0 -10 0; 0 -0.0898 0 0 0 -8.3333; 0 0 -0.2352 0 10 0; 0 0 0 -0.196 0 8.3333; 1 0 -1 0 0 0; 0 1 0 -1 0 0];
and B=[0.3313 0 -8.9335 0; 0 0.2761 0 -7.4446; 0 0 3.7249 0;0 0 0 3.104; 0 0 0 0; 0 0 0 0];
. C=[ 0 0 1.4206 1.4206 0 0]
and D= [0 0 -15 -15]
. x=[x1;x2;x3;x4;x5;x6];
u=[u1;u2;f1;f2];
, where u1=0.045, u2=0.038 in which u1 is acting at t=0 and u2 will act after 20 seconds before that it is 0 (i.e. if t<=20 u2=0; else u2=0.038;)
and f1=0; f2=0;
. xdot=[x1dot;x2dot;x3dot;x4dot;x5dot;x6dot];
Initial conditions is x0=[0 0 0 0 0 0]
, Tspan=[0 40]
Finally the ode is
dx=A*x + B*u
and output equation is y= C*x + D*u
.
How to solve this ode equation where one input u2 has some delay in MATLAB ode45?
Upvotes: 0
Views: 145
Reputation: 2636
Run your system for 20 seconds with u2=0. Then take that result as initial conditions for a new run with u2=0.038
Upvotes: 0