Reverse problem of finding time-varying parameters of an ODE with the help of solution data.

2 ビュー (過去 30 日間)
Anshuman
Anshuman 2022 年 11 月 23 日
コメント済み: Anshuman 2022 年 11 月 23 日
Any way in which I can find the time-varying parameters of an ODE ; The solution to which is know in the form of time-series data.
Background:
Example: SIR model ode: as following.
% The SIR model differential equations.
def deriv(y, t, beta, gamma):
S, I, R = y
dSdt = -beta * S * I
dIdt = beta * S * I - gamma * I
dRdt = gamma * I
return dSdt, dIdt, dRdt
Then, I use odeint(deriv, y0, t, args=( beta, gamma)) (In python) to solve for S, I and R using minimisation of these parameters.
Question
But I want to ask, is there any way in which a reverse problem can be constructed such that; I have the data for S, I and R as time-sereis. and then we can calculate 'beta' and 'gamma' paramter from there?
Note beta and gamma should be time dependent.They can be assumed as sum of natural cubic splines; Where N_k(t), k=1 to K, are K natural cubic spline basis functions evaluated at K-2 equally spaced knots in addition to the boundary knots .
Can this problem be solved on matlab?
Thanks.
  7 件のコメント
Torsten
Torsten 2022 年 11 月 23 日
Fine. And why do you want to change a winning python ?
Anshuman
Anshuman 2022 年 11 月 23 日
Actually I couldn't find a way to implement python packages for this time dependent problem; so I thought of switching to matlab.

サインインしてコメントする。

回答 (1 件)

Torsten
Torsten 2022 年 11 月 23 日
Use "lsqcurvefit" to fit the parameters together with an integrator (e.g. ODE45).
For an example, see Star Strider's code under
Here, four parameters from a Monod Kinetic are fitted against measurement data.
  3 件のコメント
Torsten
Torsten 2022 年 11 月 23 日
編集済み: Torsten 2022 年 11 月 23 日
For your first shot, you wanted to estimate the constants a1, b1, a2 and b2, and these are not time-dependent. So the above code can be applied.
For fully time-dependent estimates, look this video to understand how to proceed:

サインインしてコメントする。

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by