ERROR: odearguments (line 90), ode45 (line 113)

5 ビュー (過去 30 日間)
EJ_JEONG
EJ_JEONG 2019 年 4 月 24 日
コメント済み: EJ_JEONG 2019 年 4 月 24 日
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, ...

採用された回答

Stephan
Stephan 2019 年 4 月 24 日
編集済み: Stephan 2019 年 4 月 24 日
add:
yprime = zeros(4,1);
before assigning values to yprime
  1 件のコメント
EJ_JEONG
EJ_JEONG 2019 年 4 月 24 日
Thanks Stephan!!
I solved^^.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeOrdinary Differential Equations についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by