Some question about a special code for solving an ODE system by Runge-Kutta method
2 ビュー (過去 30 日間)
古いコメントを表示
Mojtaba Mohareri
2020 年 1 月 20 日
コメント済み: Mojtaba Mohareri
2020 年 1 月 21 日
The solution of my problem consists of two parts:
First, I want to solve the follwong system
by Runge-Kutta fourth order method and obtain the values of (C,R,P), where N=C+R+P, lambda and alpha values are known, gamma and beta functions are given and u1(t) and u2(t) are as follows
where k2 and k3 are known.
Next using those values, I solve the following system
again by Runge-Kutta fourth order method and obtain the values of (p1,p2,p3).
My problem is that I don't know how to solve C, R and P in terms of p1, p2 and p3 (in the first system) by Runge-Kutta method for substituting in the next system. I can just solve the first system when u1(t) and u2(t) are constants. I was wnodering if you could help me about my problem. Thank you in advance.
0 件のコメント
採用された回答
Bjorn Gustavsson
2020 年 1 月 20 日
Since u1 and u2 depends on p1, p2 and p3, that in turn will depend on time, you have 6 coupled ODEs. The best(?) way to solve these is to do it simultaneously, that is write yourself a function something like this:
function dRCPp1p2p3dt = ode4RCPp1p2p3(t,RCPp1p2p3,alpha1,kappa2)
dRCPp1p2p3dt = zeros(6,1);
dRCPp1p2p3dt(1) = -lambda2* ...etc, for your equation of R-dot
dRCPp1p2p3dt(2) = -lambda1* ...etc, for your equation of C-dot
% and so on, you should be able to calculate your derivatives of all your function here
end
You obviosly also have to make sure that the other time-dependent functions are callable. Then it should just be to integrate this with the standard ODE-functions for the initial conditions of interest.
HTH.
その他の回答 (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!