previous technique didnt work for the present code

조회 수: 2 (최근 30일)
MINATI
MINATI 2019년 2월 24일
댓글: Walter Roberson 2019년 2월 27일
function main
so=1;
c=-1.25;
% a=1;
Pr=1;
%n=2;
n=input('n=') %%n=-0.3,-0.5
x=[1 1];
x1=fsolve(@solver,x);
function F=solver(x)
[t,u]=ode45(@equation,[0,20],[so c 1 x]);
s=length(t);
F=[u(s,2)-1; u(s,4)];
end
figure(1)
plot(t,u(:,4),'b-');
hold on
function dy=equation(t,y)
dy=zeros(5,1);
dy(1)=y(2);
dy(2)=y(3);
dy(3)=y(2)^2-y(1)*y(3)-1;
dy(4)=y(5);
dy(5)=Pr*(n*y(2)*y(4)-y(1)*y(5));
end
end
ERROR is
code is not running
  댓글 수: 21
Jan
Jan 2019년 2월 27일
@MINATI: This is a link to asking a new question, but not to your new question.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Get Started with MuPAD에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by