Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

Integration of a function

조회 수: 5 (최근 30일)
aymos
aymos 2018년 6월 19일
마감: MATLAB Answer Bot 2021년 8월 20일
Hi I have function:
dy/dt = A(1-y/B)*exp(C*y)
y(at t=0) = 0 y (at t = infinity) = 1
A,B,C are constants and y is an unknown function of t.
I would like to solve for y and plot it as function of t. (t is time). This will allow me to compare with experimental results.
Can you please help, I am not able to get started.
I look forward to your response
  댓글 수: 2
Torsten
Torsten 2018년 6월 19일
help ode45
aymos
aymos 2018년 6월 19일
Thanks Torsten !...
I am trying to use runge kutta 4th order and ode45, but Im not able to implement the code ! That is why I posted the question...

답변 (1개)

Torsten
Torsten 2018년 6월 19일
function main
A=...;
B=...;
C=...;
fun=@(t,y)A*(1-y(1)/B)*exp(C*y(1));
tspan=[0 1];
y0=0;
[t,y]=ode45(fun,tspan,y0);
plot(t,y)
end
  댓글 수: 2
aymos
aymos 2018년 6월 19일
Hi Torsten ! Thanks...
Can you please tell if I have to change the range of t from 1e-5 to 1, how shall I do it ?
Torsten
Torsten 2018년 6월 19일
tspan = [1e-5 1]

이 질문은 마감되었습니다.

Community Treasure Hunt

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

Start Hunting!

Translated by