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
 Origin Forum
 Fitting integrals
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

MBIMO

Belgium
Posts

Posted - 11/29/2004 :  10:17:52 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Version (Select Help-->About Origin): 7 SR4
Operating System: Win2k

Hi all,

I want to fit an implicit function y(x) i. e. a function that can't be solved, neither for y nor for x.
However the derivative of the function dy/dx can be calculated.
So I followed the steps of the following knowledge base article:

http://www.originlab.com/www/support/resultstech.aspx?language=english&ID=121

to fit the integral of dy/dx.

A test run using my function revealed that the fitted parameters varied up to 25% from the correct values even when I used the correct values as starting parameters for the fitting process.

I think the rather big errors are due to the numerical integration.
Is there a better way to fit such functions, which doesn't involve integrals?

Thanks for you suggestions.

Best regards,

Martin

verrallr@a

Canada
44 Posts

Posted - 12/01/2004 :  3:33:21 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
I just have some comments, not the complete solution.

I take it you have your function in terms of dy/dx, for example it may be dy/dx=f(x), or possibly even dy/dx=f(x,y). And you want to plot the graph of Int(f(x)dx) or Int(f(x,y)dx). (I have to use Int for integral, because I cannot represent the integral sign using only Ascii characters.)

One thing to note is that, if you want to plot this graph, you can only determine evaluate it within a constant that does not depend on x or y. So, we can add a constant, so that we now have Int(f(x)dx)+C , where C does not depend on x or y. Because dC/dx=0. I wonder if that is how you seem to be "25% off from the correct values".

Secondly, I have looked at the reference you give for evaluating formulas involving integrals. I even did what this reference suggests. Nevertheless, I cannot really understand what they're doing.

If you have dy/dx=f(x), it seems you only need to place x in one column of Worksheet (this would be your X column), and f(x) in another (this would be your Y column), and then use integral for this column. If you did this, I think you would be establishing zero as your C. I haven't done this, and it may take a little work to get the integral values in another column of your original Worksheet.

However, I think you must use an integration to evaluate your function. Since you have only dy/dx, you must then use an integral.

Maybe, others can give more assistance.

Richard.
Go to Top of Page

MBIMO

Belgium
Posts

Posted - 12/02/2004 :  03:43:33 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thanks Richard.

Plotting the function is not the problem, once the parameters are known I can use dx/dy to plot the function iteratively from a given starting point. This would also uniquely determine the integration constant C which is otherwise implicitly set to 0.

Meanwhile I further tracked down the problem. I used the test function:

f(x)=p*x^2

with p=2

So the derivative is:

f'(x)=2*p*x^2

I determined p by fitting Int(f'(x)). The result should be close to 2.
I did two test runs. One with 100 x-values between 0 and 100 and one with 100 x-values between 0 and 1.

Both runs just differ in the scale, however the first run gave an almost perfect result (p=2.05...), while the second run gave
p=-49.25...

So it seems that it's rather a stability problem of the fitting algorithm than a problem of integrating the function properly.

I will try to scale my data points before fitting them and then rescale them afterwards.

I hope this works out.
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