Fit parameters using ODE 45 and 1 differential equation

Hello,
I'd like to fit one single differential eq which is dv/dt = (alpha * beta * caa(t)) *v(t)
I have attempted to find a solution on how to fit this differential equation with some data that I've got but I didn't succeed. I have uploaded my 2 files here that I use for my fit. I'd like to find alpha and beta and the rate of change of the volume as a fonction of time. I know the concentration caa for each day of each time t.
I was thinking that maybe I should divide this eqt into 2 diff equations ?
Thanks in advance,

8 Comments

I was thinking that providing ‘Caa’ would allow us to run your code!
Cannot do anything without it.
I have obtained the values of caa (concentration of a drug in the body) which depend on time. These values can be seen by running the caa2 file (they will be stored in the y vector) (you need the Injection function that I have also attached to run it).
But then after I don't know how to use these values into my differential equation described above to do my fit as the value of Caa is updated every day..
I still haven't found a solution to my problem unfortunatly. Any help would be much appreciated ..
Thanks in advance,
Hi hna,
To run 'injection' would require a few input parameters, not yet supplied.
Caa2 has V as one of its inputs. Is that the same as the v in the differential equation, so that Caa depends on v, or is V a constant so that Caa is independent of v?
It doesn't appear that
volume(1)=(param(1)-param(2))*Caa(t)*volume(1);
from ‘fit’ is consistent with
dv/dt = (alpha * beta * caa(t)) *v(t)
from the question statement. Is
dv/dt = (alpha + beta*caa(t)) *v(t)
perhaps what is intended?
hna
hna on 13 Jan 2020
Edited: hna on 13 Jan 2020
sorry for the confusion. so V is a constant and it is not the same v from the differential equation.
However my problem is more on the fit itself as I m pretty confident with the values of caa I've got.
Also my differential equation is:
dvdt = (alpha - beta * caa(t)) * v(t)
alpha being param(1) et beta param(2)
The values of caa I've got are:
[0 0 0 0 0 0 0 0 0 0 0.00858153179233264 0.0195388667177738 0.0300407570895817 0.0389951832902153 0.0461588987089660 0.0516652957836138 0.0557835934342281 0.0588033107108602 0.0609846639721674 0.0625422009976807 0.0636440711947127 0.0644177476349396 0.0649576299525786 0.0653324257038246 0.0655914841531320 0.0657698825359039 0.0658923453312628 0.0659761806681628 0.0660334362202103 0.0660724581078524 0.0660990048623137 0.0661170359889019 0.0661292659406828 0.0661375508542440 0.0661431571246373 0.0661469471004581 0.0661495069943135 0.0661512347074094 0.0661523999639216 0.0661531853867959 0.0661537144966037 0.0661540707617244 0.0661543105391007 0.0661544718524240 0.0661545803392483 0.0661546532756236 0.0661547022970346 0.0661547352363405 0.0661547573642982 0.0661547722262741 0.0661547822062423 0.0575732571144107 0.0466159266869567 0.0361140393341864 0.0271596151596681 0.0199959011005149 0.0144895049381133 0.0103712078995300 0.00735149103347847 0.00517013804758817]
But then how to use these mutiple values dependents on time onto my diff eqt to then fit alpha and beta ?
Hi hna,
what are the values of t that go along with the values of caa?
caa is the concentration calculated every day for a period of 60 days. So t is a vector with 60 values.
Hi hna,
If you temporarily take away caa from the equation, the result is
v = v0*exp(a*t) or log(v) = log(v0) + a*t
so the plot of log(v) vs t is a straight line. Looking at your data, that's approximately what you get, so unfortunately the data may not be very favorable for finding a constant b that depends on caa.
Since caa(t) is an independent function of time and does not depend on v, the solution to the full equation is
log(v) = a*t + b*Integral{t0,t}caa(t')dt' + C
In the data, the first point v=0 has to be excluded because of the log, but that still leaves 24 points, in which case t0 would be 7. You can do the integral numerically, for example with some interpolation and then cumtrapz. Denoting the integral by Icaa, the solution is simply
abc = [t Icaa ones(size(t))]\log(v)
a = abc(1)
b = abc(2)
c = abc(3)
where t,Icaa and v are all column vectors. I tried this with several other choices for a starting point in the data, and also with smoothing and interpolating v first, but did not come up with a useful result. The value of b comes out negative occasionally but not in any consistent way. It is not so clear that caa is having much of an effect.

Sign in to comment.

Answers (0)

Asked:

hna
on 11 Jan 2020

Commented:

on 15 Jan 2020

Community Treasure Hunt

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

Start Hunting!