Using ODE solvers with interlinked variables
조회 수: 2 (최근 30일)
이전 댓글 표시
Hello,
I am not really sure how to phrase my problem, so apologies if it is a little difficult to understand. I will not post my exact problem, but will use similar functions to that which I am coding for.
I have already managed to use an ODE solver for the following function: dB(t)/dt=A(t)-B(t) and have managed to code successfully for this and plotting my function for B(t).
However, I must now extend this and solve the following equation: dA(t)/dt=B(t)+dB(t)/dt-A(t)(1+c) such that c is a constant. I am a little confused on how I would code for this as there are now two differentials in the equation. I am assuming that since I have already solved the first equation, that by isolating dA(t)/dt I can solve this somehow by referring back to my known values for B(t) and dB(t). I am not sure if this makes sense, however my code is working fine with the simpler code and I am just a little confused as to how you would introduce a second unknown into the differential equation.
I am looking for just a little guidance as to how I would now solve the second equation.
Many thanks! :)
댓글 수: 0
답변 (1개)
Torsten
2015년 1월 29일
Just insert A(t)-B(t) for dB(t)/dt in the second equation:
dA(t)/dt=B(t)+(A(t)-B(t))-A(t)*(1-c)
Simplifying the right-hand side gives
dA(t)/dt = c*A(t).
Best wishes
Torsten.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Ordinary Differential Equations에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!