tBuLi / symfit

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

Connectivity infer #250

Closed tBuLi closed 5 years ago

tBuLi commented 5 years ago

In the case of a CallableNumericalModel with mixed analytical and non-analytical components, the connectivity mapping corresponding to the analytical components can just be infered automatically. This is a lot easier on the eyes:

x, y, z = variables('x, y, z')
a, b = parameters('a, b')
model_dict = {z: lambda y, a, b: a * y + b,
              y: x ** a}

mixed_model = CallableNumericalModel(
    model_dict, connectivity_mapping={z: {y, a, b}}
)

Giving the full connectivity mapping however, is also allowed.