tBuLi / symfit

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

bad operand On fit #226

Closed whinis closed 5 years ago

whinis commented 5 years ago

I am attempting to use SymFit to make a more user friendly model for my data and it fits however on attempt to run the model with the fit I get the following error bad operand type for unary -: 'list'

Here is my model


gibbsHelmholtModel=deltaH*(1-(T/Tm))-Cp*((Tm-T)+T*log(T/Tm))

fqcrModel = (thetaN+thetaD*exp(gibbsHelmholtModel))\
           /(1+exp(gibbsHelmholtModel))```
tBuLi commented 5 years ago

Hi @whinis, thanks for reporting your issue. However, it is impossible to answer this question with the information you have provided. Can you provide a minimal example so we can run the code, and include the complete traceback? Thanks!

whinis commented 5 years ago

I have changed how I evaluate the model by using

for param in fit.model.params:
        newModel = newModel.subs(param,fit_result.value(param))

instead of the example in order to graph it. I didn't version the code so I don't have that example anymore

tBuLi commented 5 years ago

You can evaluate the model as e.g.

newModel(x=xdata, **fit_results.params)

depending on what the dependent variables are, here I assume you called them x.

whinis commented 5 years ago

Using that is what gave me the bad operand however using subs did not

pckroon commented 5 years ago

Until there's a minimum working example we can use to investigate this further there is not much more we can do or say. So I'll close this issue. Feel free to reopen it or continue the conversation if you have further questions.