tBuLi / symfit

Symbolic Fitting; fitting as it should be.
http://symfit.readthedocs.org
MIT License
233 stars 17 forks source link

Parameters should be allowed as initial values to ODEModel #160

Closed tBuLi closed 4 years ago

tBuLi commented 6 years ago

In relation to this SO question, it might be worth re-investigating how to allow Parameters to be allowed as initial values, e.g.

x0 = Parameter('x0')
ode_model = ODEModel(model_dict, initial={t: 0.0, x: x0, s: 20.0, p: 0.0})

A quick scan of the source tells me this should be straightforward, it will require one extra line to dump any Parameters from initial into the list of parameters of the model, and an extra line or two in __call__ to correctly feed the provided guesses to the ode-solver.

pckroon commented 6 years ago

Yes. From a minimization viewpoint this is trivial, but possibly expensive.

tBuLi commented 6 years ago

Not my problem ;).