The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum for Programming
 Forum for Origin C
 Initialization parameter and code to estimate coef
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

egonnelli

Brazil
9 Posts

Posted - 03/26/2012 :  10:39:16 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Hello,

I am trying to create an initialization code to estimate my initialization fitting parameters.

the equation that I am using is:

y = (T2^2+Lc^2*(2*pi*x)^2)/(T6^2+T8*(2*pi*x)^2+(2*pi*x)^4*Lc^2);

where the coefficients are Lc, T2, T6 and T8.

Its a rational function, where i have a ratio between a second degree with a fourth degree.

Do i necessarily need a initialization code to make this fit?

Thanks

Sam Fang

293 Posts

Posted - 03/27/2012 :  05:43:04 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
I think over-parameterization exists in your fitting function. If you are sure that T2 is not zero, your function can be simplified with three parameters as follows:

y=(1+a*x^2)/(b+c*x^2+a*(2*pi)^2*x^4)

where a=(2*pi*Lc/T2)^2 b=(T6/T2)^2 c=T8*(2*pi/T2)^2 and a,b>0


It is not easy to provide an initialization code for this function.

Sam
OriginLab Technical Services

Edited by - Sam Fang on 03/27/2012 05:43:51 AM
Go to Top of Page

egonnelli

Brazil
9 Posts

Posted - 04/04/2012 :  12:28:02 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

thank you for help me.

I am reading some articles where the author can fit his data with this kind of function. But the article is from 60s, and the only reference is "private communication" with two mathematicians about "Weighted Non-Linear Least-Square Program".
So i think that there is a way to make this kind of fit. In the appendix there is the function, that is:

y = A + B * ( (2*pi*x)^2 + Alfa4^2 ) * ( (2*pi*x)^2 + Alfa5^2) / ( (2*pi*x)^2 + Alfa1^2 ) * ( (2*pi*x)^2 + Alfa2^2 )*( (2*pi*x)^2 + Alfa3^2);

or
see the image



if they were able to fit in the sixties, i think we can also do this.... But i dont know how!

Thanks
Go to Top of Page

Sam Fang

293 Posts

Posted - 04/06/2012 :  03:22:34 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
You can try the following method.

1. Simplify the fitting function.

y = (a + b*x^2)/(1 + c*x^2 + 4*pi^2*b*x^4);


Derived Parameters:

T6=1
T2=sqrt(a)
Lc=sqrt(b)/(2*pi)
T8=c/(4*pi^2)


Parameter Bounds:

a>=0
b>=0


2. Parameter Initialization.

  sort( x_y_curve );
  double coeff[11];
	
  if (!fitpoly( x_y_curve, 10, coeff))
  {
	nErr = -1;
	return;
   }
   a = coeff[0];
   c=(-coeff[4]-4*pi^2*coeff[0]*coeff[2])/(coeff[2]+4*pi^2*coeff[0]^2);
   b = coeff[2] + c * coeff[0];


Sam
OriginLab Technical Services
Go to Top of Page

egonnelli

Brazil
9 Posts

Posted - 05/07/2012 :  6:21:54 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Do I need necessery to fix any parameters, or I vary all of them ?!
Go to Top of Page

egonnelli

Brazil
9 Posts

Posted - 05/07/2012 :  7:13:49 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
and why T6 is 1 ?!
Go to Top of Page

Sam Fang

293 Posts

Posted - 05/15/2012 :  01:34:56 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
T6 is fixed because over-parameterization exists in your fitting function. i.e. Parameters multiplied by the same constant are also solutions.

If T6 is fixed, the solution is unique.

Sam
OriginLab Technical Services
Go to Top of Page

egonnelli

Brazil
9 Posts

Posted - 05/22/2012 :  11:28:07 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Ok, I understood that I need to fix T6 because over-parameterization exists in my problem.

But when I try to Fit my experimental results I want to derive T6 too. And if it is always equal to 1, I can not solve my problem.

I put another equation above, with alphas 1 to 5. Is it possible to make a code for the inicialization?!

Thank you very much !!!

Eduardo
Go to Top of Page

Sam Fang

293 Posts

Posted - 05/24/2012 :  06:53:01 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
If you don't want to fix T6, you can also apply a constraint for parameters, which can also make parameters unique.

For another equation above, you can simplify the equation:

y=(a+b*x^2+c*x^4+d*x^6)/(1+e*x^2+f*x^4+g*x^6)


where

A=d/g
B=(2*pi)^2*(c-A*f)/g


a4 and a5 are roots of a quadratic equation for parameters. a1, a2, a3 are roots of a cubic equation.

So you'd better use the simplified form, which can determine initial parameters easily.

Sam
OriginLab Technical Services
Go to Top of Page

egonnelli

Brazil
9 Posts

Posted - 06/25/2012 :  10:53:27 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Then what will be the types of constraints for this problem ?

I tried to fit my experimental data, but Alfa 4 and Alfa 5 tend to the same value.

I get the equation with the Alphas and I simulated the parameters, and with the values of X and Y I ploted the graph. Than I tried to fit to obtain the parameters again. But this method did not work.

I realy need create an initialization code to estimate my initialization fitting parameters.


Go to Top of Page

egonnelli

Brazil
9 Posts

Posted - 06/25/2012 :  11:13:44 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
In the case of the equation of alphas I know the expressions of Alpha 1, Alpha 2 and Alpha3.
It already help me to get an idea of the magnitude of the values of these parameters for a initialization.
But I could not calculate the values of Alpha 4 and Alpha 5.

I know the values of the alphas are the roots of equations.
But when I apply the same procedure as applied in Alpha 1, 2 and 3 for Alpha 4 and Alpha 5 can not obtain them.

Do you have any idea how to do this from the equation (01) and obtain the equation (02)?

Thank you,

Eduardo

Go to Top of Page

Sam Fang

293 Posts

Posted - 06/28/2012 :  04:20:49 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Parameters are unique in your second equation. So you needn't apply constraints on your 2nd equation's parameters.

You can click Send File to Tech support button on the top right of the forum, and send your fitting data and fitting function to us. We can try it.

Thanks.

Sam
OriginLab Technical Services
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000