while in ode45
이전 댓글 표시
Let me solve an ODE .
dy/dt=y.
y(0)=1.
Now i want to just solve the ODE for 5 seconds. Let y(5) denote the value of state 'y' at time =5.
At t=5 I want to update the initial condition as: y(5)=0.5*y(5) and again solve the given ODE for next 10 seconds.
I want to use while statement for this work. Can I do that ? If yes, please provide some outline of the code.
Thanks
댓글 수: 2
James Tursa
2024년 11월 30일
What have you done so far? What specific problems are you having with your code? Can you code up the first part, without any while loop, to just solve for the first 5 seconds?
Arnab
2024년 11월 30일
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Ordinary Differential Equations에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
