stochastic gompertz model and using ode15s

1 回表示 (過去 30 日間)
George Hendry
George Hendry 2022 年 2 月 23 日
コメント済み: George Hendry 2022 年 2 月 25 日
I have looked at previous examples of gompertz models and how to form the data and produce a graph and following similar examples I tried to reproduce that. My model is dX(t)= [a*x(t)-b(2)*log(x(t))*x(t)]*dt+(d*x(t))*dw(t). And trying to use previous examples I created
function yr = fit_GompModel(y,t) % Objective Function: Integrates ODE & Returns Vector
x0 = [20]; % Initial Value of the differential equation (dx = 20)
[y,ys]=ode15s(@GompModel,t,x0);
function dx = GompModel(t,y)
dx (1) = (p(1)*y(t)-p(2)*log(y(t))*y(1))*dt+(p(3)*y(t))*dw(y);
p(1)= 0.1;
p(2)= 0.3;
p(3)= 1;
end
yr = ys(:,1);
end
I keep getting a error in the third line was wondering what I was doing wrong?thanks

回答 (1 件)

Torsten
Torsten 2022 年 2 月 23 日
編集済み: Torsten 2022 年 2 月 23 日
function yr = fit_GompModel(tr,p) % Objective Function: Integrates ODE & Returns Vector
x0 = 20; % Initial Value of the differential equation (dx = 20)
[T,Y] = ode15s(@(t,y)GompModel(t,y,p),tr,x0);
yr = Y(:,1);
end
function dx = GompModel(t,y,p)
dx(1) = ?;
end
  9 件のコメント
Torsten
Torsten 2022 年 2 月 25 日
I suggest you google "Matlab & stochastic differential equation".
That's the same I had to do since I have no experience in this field.
George Hendry
George Hendry 2022 年 2 月 25 日
Okay thankyou for your help

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

カテゴリ

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