I have 250 data points from a timecourse exeriment in a list, with columns specifying (1) time, (2-4) initial conditions, (5) absorbance reading. I want to fit 4 parameters (k1, k2, k3, k4) in a DAE system of 7 species to this dataset, where species7 is absorbance.
At the moment, the program needs 20 seconds for two NMinimize iterations and seems to break down after 10 minutes. I'm also using a different program (Copasi), which is able to solve the problem and perform the computations about 2 magnitudes faster. So where does this code get stuck and how do I solve it? I suspect part of the problem is that the system must be calculated for every single time point.
func[ic1,ic2,ic3] :=
species7[k1, k2, k3, k4] /. ParametricNDSolve[
{"species1-7 DAEs, species1-7 initial conditions, partly given by ic1-3"},
species7,
{t, 0, 120},
{k1, k2, k3, k4}
]
fit = NMinimize[
{
Sum
[
(data[[i, 5]] -
func[data[[i, 2]], data[[i, 3]], data[[i, 4]]][data[[i, 1]]]
)^2, {i, Length[data]}
],
{{10^-2 < k1 < 10^2},
{10^-2 < k2 < 10^2},
{10^-2 < K3 < 10^2},
{10^-2 < k4 < 10^2}}
},
{k1, k2, k3, k4},
]
Thanks
edit: here is a notebook with data https://www.dropbox.com/s/4mvnn4m8ldy7373/2013-05-16%20Stackexchange.nb please note, I'm not expecting a great fit at the moment. It takes ~1min to run