Info

This question is closed. Reopen it to edit or answer.

Non Linear curve fitting

1 view (last 30 days)
Venkatesa
Venkatesa on 30 Aug 2011
Closed: MATLAB Answer Bot on 20 Aug 2021
Hi,
I have an equation of the following form.
Y = K1 * (( x1 - (K2*x2) + (K3*x3)) * (x4 - x2))
x1 is fixed at 1.5. The models accounts for behavior in a nonlinear region. Its a current equation which has a slight nonlinear behavior.
The points I have are the following.. x4 varies from 0.51 - 0.6 and for each x4 I have x3 varying from a nominal value +/- 75mV. The nominal value of x3 will be different for different x4. And again for each x3+/- 75mV I have x2 varying from 0.25-0.5.
Essentially there are two nested loops. x2 always runs from 0.25-5 for every x3+/-75mV for every x4 between 0.51 - 0.6 .
Since I will have a Y for every combination of x2,x3,x4. I read it as a matrix with the input combinations of x2,x3,x4 as say INP and the output Y as a matrix OUT.
Then I used the following to find my coefficients.
Z = (INP' * INP ) \ (INP' * OUT )
The error I am getting is around 15% but I want to have less than 5% error. Could someone please help me in this?
Thanks in advance for the help.
Thanks, Venkat
  1 Comment
Venkatesa
Venkatesa on 31 Aug 2011
Hi,
Anyone any suggestions?
Thanks,
Venkat

Answers (1)

Walter Roberson
Walter Roberson on 31 Aug 2011
Sounds like fmincons() might perhaps be suitable for this, but if you have the curvefitting toolbox or optimization toolbox then there are more specific tools there.
  2 Comments
Venkatesa
Venkatesa on 31 Aug 2011
Hi Walter,
Thanks for your suggestion. But I am not so conversant with Matlab. I tried using fmincon but Not sure how and what options I should be using. How do I give my constraints et all.
I am not sure how to know if I am having a constraint in my problem or not.
Some advice would help.
Thanks,
Venkat
Walter Roberson
Walter Roberson on 31 Aug 2011
Saying that "x4 varies from 0.51 - 0.6" is a constraint on x4; likewise you have a constraint on x2 I think (I might be misreading.) You might be able to program some of the other constraints through the A*x<=b parameter to fmincon() -- if not exactly then perhaps close enough as to meaningfully reduce the search domain.

Community Treasure Hunt

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

Start Hunting!