Info
이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.
Correct use of ode45
조회 수: 1 (최근 30일)
이전 댓글 표시
Hey,
I have got a problem. I dont understand how to use the ode45 solver.
My prerequisites:
Interval: 48 h
Number of Steps: 5
Increment = Interval/Number of steps = 48/5 = 9.6
This range I called SW
SW = (0:48/5:48)
My equation I want to solve is quite simple:
X = x0*exp((muemax-kd)*t)
For a previous task I already implemented a subfunction 'Wachstumsprozess'
Now I want to approximate with ode45.
-----------------------------------------------------------
function abc
% 1a)
x0 = 0.2;
muemax = 0.06;
kd = 0.01;
t = (0:1:48);
x = Wachstumsprozess (x0, muemax, kd, t);
plot (t,x);
% 2a)
SW = (0:48/5:48);
[SW,x2] = Euler(@(SW,x2)Wachstumsprozess(x0, muemax, kd, t), SW, x0);
end
function X = Wachstumsprozess (x0, muemax, kd, t)
X = x0*exp((muemax-kd)*t);
end
function E = Euler (Fkt, SW, Y0)
E = ode45(Fkt, SW, Y0);
end
댓글 수: 0
답변 (0개)
이 질문은 마감되었습니다.
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!