Can somebody help with curve fitting app custom equation problem please?

21 Ansichten (letzte 30 Tage)
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

Akzeptierte Antwort

Cris LaPierre
Cris LaPierre am 30 Okt. 2020
Bearbeitet: Cris LaPierre am 30 Okt. 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.
You can also solve this manually if you want. See this post on how to get started.
  1 Kommentar
Marathon_Mike
Marathon_Mike am 31 Okt. 2020
Hi Cris,
Thank you for your kind response.
I should have realised that those difference changes were way too small for the magnitude of the data.
Many thanks,
Mike

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by