ERROR: odearguments (line 90), ode45 (line 113)
Show older comments
function yprime=swing_brake(t,y)
cd=0.6;
A0=0.5*10^(-6);
density=800;
Bulk=2*10^9;
Ap=10^(-4);
M=0.1;
k=40000;
x0=0.005;
V10=10^(-4);
V20=10^(-5);
Amax=0.5*10^(-6);
delP_set=100*10^5;
x=delP_set-y(2);
if (x <= 50)
Ared=Amax;
else
Ared=-Amax/(50-y(2))*(x-50)+Amax;
DelP=y(1)-y(2);
Q2=cd*A0*sqrt(2*y(2)/density);
Qred=cd*Ared*sqrt(2*abs(DelP)/density);
yprime(1)=Bulk*(Ap*y(4)-Qred)/(V10-Ap*y(3));
yprime(2)=Bulk*(Qred-Q2)/V20;
yprime(3)=y(4);
yprime(4)=(k*(x0-y(3))+y(1)*Ap)/M;
end
>>[t,y]=ode45('swing_brake',[0 0.06],[0 0 0 0]);
ERROR:
odearguments (line 90)
SWING_BRAKE must return a column vector.
ode45 (line 113)
[neq, tspan, ntspan, next, t0, tfinal, tdir, y0, f0, odeArgs, odeFcn, ...
Accepted Answer
More Answers (0)
Categories
Find more on Ordinary Differential Equations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!