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
 All Forums
 Origin Forum
 Origin Forum
 Interpolation using polynomial fit function

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
Pest Posted - 08/02/2000 : 8:08:00 PM
Hi folks,

I performed a sixth order polynomial fit to my data set and now I want to interpolate between two points using the polynomial function. Do I really have to take the function with the six parameters out of the log-window manually and perform the calculation? There should be a more comfortable way. Unfortunately the function is not copied automatically to the "Set Column Value"-Window. Can anybody help?

Thanks a lot,
Peter

1   L A T E S T    R E P L I E S    (Newest First)
Jose Posted - 08/02/2000 : 8:57:00 PM
I have modified mi pr.ogs script, the one that makes these polynomial regressions, to give the equation of the polynomial after the fitting. I added in a couple of places (there are two different output styles, something like "full" and "simplified", and I wanted it in both) the following lines:

%o=y=$(Stat.PR.A,*15); // Independent term of the function, full precision (15)

for (ii=1;ii<=stat.pr.order;ii+=1) // Do this from 1 to the polynomial order, to include all terms

{
if($(Stat.PR.B$(ii))>=0) {%o=%o+$(Stat.PR.B$(ii),*15);}
else {%o=%o$(Stat.PR.B$(ii),*15);}; // Dependent terms coefficients, (taking care of the sign), full precision (15)

%o=%o*x^$(ii); // Coefficient multiplies the ii power of x
}

type %o;

The full precision is necessary when you want the function to fully reproduce the fitting, mainly when using high-order polynomials.

The output of this code, directed to the script window, must be something like

y=0.478790630070108-0.0308866691670104*x^1+1.00152612350376*x^2

All you have to do, to define your new function, is to change the "y=" with something like "f2(x)=" and execute the line, creating with this a new function called f2.

Of course, you don't need to modify the pr.ogs script. You can also paste this code to your script window and run it right after the fitting. It will avoid the hard work of taking the parameters from the result table and constructing the function. You could also modify my code in the last line inside the loop, for example replacing "X" with "col(A)", to make a function to be pasted in the "Set column values" dialog box.

Hope this helps.

jose.

[This message has been edited by Jose (edited 08-02-2000).]


The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000