Using ODE solvers with interlinked variables

3 ビュー (過去 30 日間)
Kelly
Kelly 2015 年 1 月 28 日
回答済み: Torsten 2015 年 1 月 29 日
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! :)

回答 (1 件)

Torsten
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.

カテゴリ

Help Center および File ExchangeOrdinary Differential Equations についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by