Fit parameters using ODE 45 and 1 differential equation
1 view (last 30 days)
Show older comments
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
David Goodmanson
on 15 Jan 2020
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.
Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!