lmfit / lmfit-py

Non-Linear Least Squares Minimization, with flexible Parameter settings, based on scipy.optimize, and with many additional classes and methods for curve fitting.
https://lmfit.github.io/lmfit-py/
Other
1.05k stars 274 forks source link

Error in Documentation: DampedOcsillatorModel #704

Closed ghost closed 3 years ago

ghost commented 3 years ago

I believe there is an error in the equation for the Damped Oscillator Model. The center position is inserted into the equation as (x/mu), but actually should be (x-mu). It would also be nice if the fwhm was included for this model.

newville commented 3 years ago

@loganfoote Um, not to pick on you personally, but perhaps you can explain why it is that essentially everyone ignores the message clearly marked DO NOT IGNORE? You must have seen that you need to include a minimal example and that you must give the versions you are using. It is just not believable that you did not notice or thought that these instructions do not apply to you. No, you did purposely and willfully ignored all of the instructions. It looks like you created a github account so that you could submit this issue. That's like real work. And then you simply erased all of the instructions about submitting this issue. It's very puzzling to me. So, really: why did you think that was the right thing to do?

Anyway, https://github.com/lmfit/lmfit-py/blob/master/lmfit/lineshapes.py#L178 and https://github.com/lmfit/lmfit-py/blob/master/lmfit/models.py#L920 look consistent to me. Maybe I'm misunderstanding your point. I am definitely going to update the instructions on submitting an issue.

If you know of an accurate formula for FWHM, let us know.

ghost commented 3 years ago

I apologize for the lack of clarity. I did not think an example was relevant to my question, since I originally thought there was just a simple discrepancy between the code and the documentation. I also am new to GitHub and I did not understand how the documentation is versioned. I am using the version 1.0.1.

In any case, I think I have found the root of my problem. The Damped Oscillator model does not keep the convention for the center variable as the other models. I have found a workaround for my purposes by adding in a linear model.

Thanks for bearing with me while I learn how to navigate GitHub. I will post to the mailing list next time before submitting a request here.