ODE45 error, "inputs must be scalar and square"
이전 댓글 표시
Running my code is giving me this error:
"??? Error using ==> mpower Inputs must be a scalar and a square matrix.
Error in ==> marchup at 11 Mu=(Mi/(1-Mi^2))*(-((1+(((gam-1)/2)*Mi))/A)*dA+((2*gam*(Mi^2)*((1+((...
Error in ==> odearguments at 110 f0 = feval(ode,t0,y0,args{:}); % ODE15I sets args{1} to yp0.
Error in ==> ode45 at 173 [neq, tspan, ntspan, next, t0, tfinal, tdir, y0, f0, odeArgs, odeFcn, ...
Error in ==> combflow at 66 [Xu, Mu]=ode45(@marchup,[xs,0],[1, Mi], f);"
Here's the ODE function:
function Mu=marchup(X, Mi, f)
Dt=5/100;
gam=1.4;
L=2;
D=2*Dt*(1+.5*cos((pi/L)*X));
A=(pi/4)*D^2;
dD=-(pi/L)*Dt*sin((pi/L)*X);
dA=(pi/4)*dD^2;
Mu=(Mi/(1-Mi^2))*(-((1+(((gam-1)/2)*Mi))/A)*dA+((2*gam*(Mi^2)*((1+((... (gam-1)/2)*Mi^2)*f)/D))));
end
How I'm calling it:
Mi=1-Bp*(xs-x(j-1));
[Xu, Mu]=ode45(@marchup,[xs,0],[1, Mi], f);
Where xs is the sonic point in a flow and x(j-1) is the point just before that.
댓글 수: 1
Star Strider
2014년 3월 4일
답변 (1개)
Melody
2014년 3월 4일
0 개 추천
댓글 수: 1
Star Strider
2014년 3월 4일
My pleasure!
I probably should have put that as an answer!
카테고리
도움말 센터 및 File Exchange에서 Programming에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!