I am using OdePkg in Octave to solve a system of stiff ODEs, e.g. by ode5r:
function yprime = myODEs(t,Y,param)
yprime = [
- param(1) * Y(1); # ODE for Y(1)
param(1) * Y(1) - param(2) Y(2) * Y(3); # ODE for Y(2)
param(2) Y(2) * Y(3) # ODE for Y(3)
# etc.
];
time_span = [1, 24] # time span of interest
Y0 = [1.0, 1.1, 1.3] # initial values for dependent variables Y
param = [7.2, 8.6, 9.5] # parameters, to be optimized
[t, Y] = ode5r(@myODEs, time_span, Y0, ..., param);
The solver stores the dependent variables Y in a matrix with respect to time t (vector):
t Y(1) Y(2) Y(3)
0.0 1.0 1.1 1.3
0.1 ... ... ...
0.5 ... ... ...
0.9 ... ... ...
... ... ... ...
4.0 ... ... ...
... ... ... ...
24.0 ... ... ...
I want to fit the parameters in param, so that the resulting variables Y best fit my reference values, e.g.:
t Y(1) Y(2) Y(3)
0.5 1.1 N/A N/A
1.0 1.9 N/A N/A
4.0 2.3 2.7 2.1
5.0 N/A 2.6 2.2
24.0 0.9 1.5 2.0
Which Octave/Matlab (other languages are welcome) routine can perform a multi-parameter (least square / spline) fit? How is it possible to combine parameter sets for different initial values Y0 in the fit? I would be glad if you could provide me with some hints and possibilities.
Best regards, Simon