QROMB and parameters [message #34043] |
Thu, 13 February 2003 06:18  |
mikko.inkinen
Messages: 1 Registered: February 2003
|
Junior Member |
|
|
I would like know what is the best way of using a function with
parameters when integrating with QROMB. I tryed to save parameters in
procedure (SAVE,a,b,FILENAME='a_b.txt') and restore them in function
(restore,'a_b.txt') where a and b are used, but this doesn't seem to
work as it should.
What is the best and recommended practise to handle this quite simple
thing with IDL?
|
|
|
Re: QROMB [message #39879 is a reply to message #34043] |
Tue, 15 June 2004 15:05  |
Craig Markwardt
Messages: 1869 Registered: November 1996
|
Senior Member |
|
|
Paul Van Delst <paul.vandelst@noaa.gov> writes:
> New2IDL wrote:
>> hi,
>> The function I am trying to integrate is :
>>
>> F(x) = a*exp(-b*(x^2))
>>
>> where: a and b are parameters
>> x ranges from 0,20
>>
>> We have experimental data to fit with the above integral (a and b as
>> parameters to be found from fit).
>>
>> When I tried to integrate the above mentioned funciton with QROMB we
>> get a single value as the answer. I cannot fit this value to my data.
>>
>> Can anybody please help me to get the F(x) value for each value of X.
>
> If you want to fit the data, why are you integrating it? Check out Craig Markwardt's IDL
> fitting package MPFIT at
> http://cow.physics.wisc.edu/~craigm/idl/fitting.html
Thanks for the plug Paul, but I think the original poster wants to fit
the integrated function, i.e., the *antiderivative*, to the data.
The antiderivative of the gaussian function is the error function, or
ERF() / ERRORF() in IDL, so the answer is built into IDL already. One
needs to take care, since there is a simple change of variables from
the IDL function to the one that "New2IDL" wants.
And of course I recommend MPFIT for the actual fitting :-)
Craig
--
------------------------------------------------------------ --------------
Craig B. Markwardt, Ph.D. EMAIL: craigmnet@REMOVEcow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
------------------------------------------------------------ --------------
|
|
|
Re: QROMB [message #39881 is a reply to message #34043] |
Tue, 15 June 2004 13:06  |
mmeron
Messages: 44 Registered: October 2003
|
Member |
|
|
In article <162586e3.0406150744.514aba92@posting.google.com>, biomedthesis2002@yahoo.com (New2IDL) writes:
> hi,
> The function I am trying to integrate is :
>
> F(x) = a*exp(-b*(x^2))
>
> where: a and b are parameters
> x ranges from 0,20
>
> We have experimental data to fit with the above integral (a and b as
> parameters to be found from fit).
>
> When I tried to integrate the above mentioned funciton with QROMB we
> get a single value as the answer. I cannot fit this value to my data.
>
> Can anybody please help me to get the F(x) value for each value of X.
>
The integral *is* a single value. Unless you mean an indefinite
integral (say, from 0 to x, for various values of x). Is this the
case?
Mati Meron | "When you argue with a fool,
meron@cars.uchicago.edu | chances are he is doing just the same"
|
|
|
Re: QROMB [message #39887 is a reply to message #34043] |
Tue, 15 June 2004 08:57  |
Paul Van Delst[1]
Messages: 1157 Registered: April 2002
|
Senior Member |
|
|
New2IDL wrote:
> hi,
> The function I am trying to integrate is :
>
> F(x) = a*exp(-b*(x^2))
>
> where: a and b are parameters
> x ranges from 0,20
>
> We have experimental data to fit with the above integral (a and b as
> parameters to be found from fit).
>
> When I tried to integrate the above mentioned funciton with QROMB we
> get a single value as the answer. I cannot fit this value to my data.
>
> Can anybody please help me to get the F(x) value for each value of X.
If you want to fit the data, why are you integrating it? Check out Craig Markwardt's IDL
fitting package MPFIT at
http://cow.physics.wisc.edu/~craigm/idl/fitting.html
paulv
|
|
|