Non Linear curve fitting

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 个评论

Hi,
Anyone any suggestions?
Thanks,
Venkat

回答(1 个)

Walter Roberson
Walter Roberson 2011-8-31

0 个投票

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 个评论

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
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.

此问题已关闭。

提问:

2011-8-30

关闭:

2021-8-20

Community Treasure Hunt

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

Start Hunting!

Translated by