I am reading through the tutorial of DiffEqParamEstim.jl (Optimization-Based ODE Parameter Estimation · DiffEqParamEstim.jl) in the section of multiple shooting method.
The code put together reads the following
using DifferentialEquations
using DiffEqParamEstim
using BlackBoxOptim
function ms_f(du,u,p,t)
du[1] = dx = p[1]*u[1] - p[2]*u[1]*u[2]
du[2] = dy = -3*u[2] + u[1]*u[2]
end
ms_u0 = [1.0;1.0]
tspan = (0.0,10.0)
ms_p = [1.5,1.0]
ms_prob = ODEProblem(ms_f,ms_u0,tspan,ms_p)
t = collect(range(0,stop=10,length=200))
sol = solve(ms_prob,Tsit5(),saveat=t,abstol=1e-12,reltol=1e-12)
data = Array(sol)
bound = Tuple{Float64, Float64}[(0, 10),(0, 10),(0, 10),(0, 10),
(0, 10),(0, 10),(0, 10),(0, 10),
(0, 10),(0, 10),(0, 10),(0, 10),
(0, 10),(0, 10),(0, 10),(0, 10),(0, 10),(0, 10)]
ms_obj = multiple_shooting_objective(ms_prob,Tsit5(),L2Loss(t,data);discontinuity_weight=1.0,abstol=1e-12,reltol=1e-12)
result = bboptimize(ms_obj;SearchRange = bound, MaxSteps = 3*1e4)
ms_p_estimated = result.archive_output.best_candidate[end-1:end] #parameter estimated are last
ms_ic_estimated = result.archive_output.best_candidate[1:end-2] #initial conditions over steps
And that works like a charm. However I haven’t understood what is the meaning of bound
, especially what it reprents.
Why is it long 18 (tuples)?
when looking at the results, what are the other values other than the last 2, that are the parameters we are looking for? the docs says they are the ic at different steps, but why are they 16? the data given to interpolate are of length 200 so where (in time) are those ic used?
I found another topic on this [DifferentailEquations.jl error on multiple_shooting_objective], but as often happens the two links suggested in the solution either are broken or point to (perhaps different from what they were at the time) useless pages.
Thanks in advance