필터 지우기
필터 지우기

Why ode45 is not working??

조회 수: 2 (최근 30일)
Frane
Frane 2021년 7월 19일
편집: Frane 2021년 7월 22일
Hello,
I've uploaded the two following files:
1. epas_steering_system.m is the main file, and it is the file where ode45 gives me an error,
2. epasFun.m is the function file.
My question is, does somebody know why ode45 won't work?
Thanks.
  댓글 수: 35
Torsten
Torsten 2021년 7월 21일
According to the equations you posted, they seem to be implemented correctly in epasFun.
Of course, I can't tell whether they are correct or whether the parameters you chose make sense.
Frane
Frane 2021년 7월 22일
I checked the parameters, they are okey; checked the equations, they are okey.
It could be something with the code itself (probably with the ode45 part). To be honest I don't know what, and I'm stuck at the moment.

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

답변 (1개)

Tesfaye Girma
Tesfaye Girma 2021년 7월 21일
you can try this approach if it worked for you
f = (t,y) [ 4.86*y(3) - 4.86*10^14*y(1)*y(2);
4.86*y(3) - 4.86*10^14*y(1)*y(2);
-4.86*y(3) + 4.86*10^14*y(1)*y(2) ];
opt = odeset('maxstep',1e-13);
tspan = [0 1e-11];
y0 = [1.48e-8; 6.7608e-3; 1];
[t,y] = ode45(f,tspan,y0,opt);
subplot(311)
plot(t,y(:,1))
subplot(312)
plot(t,y(:,2))
subplot(313)
plot(t,y(:,3))
  댓글 수: 3
Tesfaye Girma
Tesfaye Girma 2021년 7월 22일
you are right thank you brother!!
Frane
Frane 2021년 7월 22일
편집: Frane 2021년 7월 22일
Where did you get this numbers that are multiplying y(1), y(2) and y(3) in f=(t,y), and the numbers from y0?
Did you try my code and added these numbers and it worked or?
And what should y(1), y(2) and y(3) represent?

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

카테고리

Help CenterFile Exchange에서 Ordinary Differential Equations에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by