Open tshort opened 9 years ago
Kinsol should be able to find a solution if you give it a reasonable initial guess. By the way, does 'solve' update its input SimState with the solution it has found? If not, perhaps the API should be updated so that the solution found with solve can be passed to the main simulation procedures.
I don't think solve
does update, but it should. When I first tried Kinsol, I couldn't get it to solve underdetermined initial conditions.
I'm going to leave this open for now. initialize!
has been added, but has some limitations:
I've got a working initialize!
. The issues are:
@require
to make it optional, but I couldn't get it to work. Overall, I think this is okay. We'll have package caching sooner or later. JuMP is an uber-cool package.sim(m, init = :none)
.
Many problems currently fail during initialization. The initialization approaches in Sundials and DASSL are pretty simple. Lots has been written on the subject:
We can use KINSOL or NLSolve.jl to help. The main issue is that most models have underdetermined initial conditions, and KINSOL can't handle that. The methods outlined in the papers above might take a bit of work. It'd be nice to find something simple that's at least better than what we do now. The last paper above mentions turning the initial solution into an optimization problem. That might be something to try given that Julia has several good optimization packages.