tshort / FunctionalModels.jl

Equation-based modeling and simulations in Julia
https://tshort.github.io/FunctionalModels.jl/stable/
Other
112 stars 19 forks source link

Initial equations and initialization #28

Open tshort opened 9 years ago

tshort commented 9 years ago

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.

iraikov commented 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.

tshort commented 9 years ago

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.

tshort commented 9 years ago

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: