stochastic gompertz model and using ode15s

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

Réponses (1)

Torsten
Torsten le 23 Fév 2022
Modifié(e) : Torsten le 23 Fév 2022
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 commentaires

George Hendry
George Hendry le 23 Fév 2022
when i compute this and enter the dx(1) as I previously had it comes up with error is there a better way for the dx(1) to be entered or is it not needed?
Torsten
Torsten le 23 Fév 2022
Modifié(e) : Torsten le 23 Fév 2022
Your dx(1) has many errors in it: y(t) has to be replaced by y(1), dt is undefined, dw(y) doesn't make sense.
You will have to correct these errors.
George Hendry
George Hendry le 23 Fév 2022
Okay I understand the y(1) an y(t) being wrong but if we use dx(1) so we implement that into the original model I don't understand how I could make the dt defined or the dw(t) to make sense as they are in the oringinal model
Torsten
Torsten le 24 Fév 2022
Modifié(e) : Torsten le 24 Fév 2022
MATLAB doesn't know what the "original model" is - and I don't know either.
MATLAB only interprets your settings and will search for a variable dt that is not defined and a function dw depending on t that does not exist.
George Hendry
George Hendry le 24 Fév 2022
My model is dX(t)= [a*x(t)-b(2)*log(x(t))*x(t)]*dt+(d*x(t))*dw(t) with a,b,d all being parameters which have set values. So do I need to define this in my code?
Torsten
Torsten le 24 Fév 2022
Modifié(e) : Torsten le 24 Fév 2022
I don't know what dt and dw(t) in the model equation of the right-hand side mean. So how should MATLAB know it ? Can you explain ? Is the gompertz equation a stochastic differential equation ? These cannot be solved using MATLAB's ODE integrators.
George Hendry
George Hendry le 25 Fév 2022
Yes the Gompertz equation is a stochastic differential equation with the dw(t) representing the Weiner process which is the same as the brownian process which I saw matlab can define and dt representing time of the tumour cell population. What would be the best way to tackle this now? Thanks
Torsten
Torsten le 25 Fév 2022
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 le 25 Fév 2022
Okay thankyou for your help

Connectez-vous pour commenter.

Catégories

En savoir plus sur Wavelet Toolbox dans Centre d'aide et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by