How to fit complicated function with 3 fitting parameters using Least square regression
42 views (last 30 days)
I want to fit below equation J(v). J and V data areavailable.
Epsilon=26.5 x 10^-14
Initial values may be x0=[µ l H]=[10^-5 5 10^18]
3 fitting parameters are: µ, l and H. other parameters are known.
can some one help me to solve this?
I am not expert in Matlab
V is xdata:
J is ydata:
Alex Sha on 25 Mar 2020
Hi, you may try to use "lsqcurvefit" command or curve fitting tool box (cftool), it is also better if you post data as well as known constant values, so other persons may try for you.
More Answers (1)
Jeff Miller on 25 Mar 2020
I assume you have vectors of values for V and J, in which case fminsearch might be a good choice. The basic steps are:
- Write a function "predicted" to compute a predicted value of J for any given V, µ, l and H.
- Write a function "error" that computes the sum of (predictedJ - actualJ)^2, summing across the J vector.
- call fminsearch and pass it this error function as the function to be minimized. You will have to give it reasonable guesses for µ, l and H.