
Can somebody help with curve fitting app custom equation problem please?
3 views (last 30 days)
Show older comments
Marathon_Mike
on 30 Oct 2020
Commented: Marathon_Mike
on 31 Oct 2020
Hello All,
Trying to use the curve fit app to fit a simple function (custom equation) to the x-y data attached (csv format). Matlab custom equation is:
y = f(x) = (2/(1.602e-19*(4.71e-3^2)*8.85e-14*10*Na))*(V-x)
I am attemtping to extract Na and V from the equation.
For some reason when I enter this function into the "custom equation" section of the curve fitting app the fit is extremely poor. However when I replace the Na value with 8e15, the fit becomes clear and a value for V is extracted accurately from the data (95% confidence). Isn't the purpose of the curve fit app to perform my manual guess for Na this in the first place?
Any help as to what I am doing wrong is much appreciated.
Thanks,
Mike
0 Comments
Accepted Answer
Cris LaPierre
on 30 Oct 2020
Edited: Cris LaPierre
on 30 Oct 2020
My suspicion is that your equation is overly complex for the data, so MATLAB is having a hard time guessing the right starting points. Open the 'Fit Options' (button under your custom equation) and provide reasonable guesses for your Na and V StartPoints.
One thing that might be compounding your issue is the scale of your data: 10e20. The default settings are way too small for data of this magnitude. If I change DiffMinChange to 1.0e5 and DiffMaxChange to 10e5, if performs the fit on its own.

More Answers (0)
See Also
Categories
Find more on Fit Postprocessing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!