comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » learning how to use mpfit,. need help
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
learning how to use mpfit,. need help [message #87740] Tue, 25 February 2014 13:35 Go to next message
alkyl47 is currently offline  alkyl47
Messages: 2
Registered: February 2014
Junior Member
Hi

I am new to idl and learning how to use mpfit but run into error, please help if you have time.


IDL version 6.3

////////////////////
IDL> x = findgen(101)
IDL> y = 25.*exp(-(x-32.)^2/(2*5.^2))+2.*randomn(0,101)
% Program caused arithmetic error: Floating underflow
///////////////////

these are the tutorial from the daedalus.as.arizona.edu group.

thanks in advance.

LR
Re: learning how to use mpfit,. need help [message #87741 is a reply to message #87740] Tue, 25 February 2014 13:44 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
alkyl47@gmail.com writes:

> I am new to idl and learning how to use mpfit but run into error, please help if you have time.
>
>
> IDL version 6.3
>
> ////////////////////
> IDL> x = findgen(101)
> IDL> y = 25.*exp(-(x-32.)^2/(2*5.^2))+2.*randomn(0,101)
> % Program caused arithmetic error: Floating underflow
> ///////////////////
>
> these are the tutorial from the daedalus.as.arizona.edu group.

Can't help you with MPFIT because I can't even see where you are using
it. I can help with underflow errors, the nemesis of many an IDL
programmer:

http://www.idlcoyote.com/math_tips/underflow.html
http://www.idlcoyote.com/code_tips/underflow.html

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
Re: learning how to use mpfit,. need help [message #87742 is a reply to message #87740] Tue, 25 February 2014 13:55 Go to previous messageGo to next message
alkyl47 is currently offline  alkyl47
Messages: 2
Registered: February 2014
Junior Member
On Tuesday, February 25, 2014 11:35:53 AM UTC-10, alk...@gmail.com wrote:
> Hi
>
>
>
> I am new to idl and learning how to use mpfit but run into error, please help if you have time.
>
>
>
>
>
> IDL version 6.3
>
>
>
> ////////////////////
>
> IDL> x = findgen(101)
>
> IDL> y = 25.*exp(-(x-32.)^2/(2*5.^2))+2.*randomn(0,101)
>
> % Program caused arithmetic error: Floating underflow
>
> ///////////////////
>
>
>
> these are the tutorial from the daedalus.as.arizona.edu group.
>
>
>
> thanks in advance.
>
>
>
> LR

Yes, I am slowly getting to mpfit but in order to learn the usage, I need to generate noisy gaussian curve per this web site but did not get very far.

http://daedalus.as.arizona.edu/wiki/mpfit
Re: learning how to use mpfit,. need help [message #87746 is a reply to message #87740] Tue, 25 February 2014 15:42 Go to previous messageGo to next message
Harald Frey is currently offline  Harald Frey
Messages: 41
Registered: March 1997
Member
On Tuesday, February 25, 2014 1:35:53 PM UTC-8, alk...@gmail.com wrote:
> Hi
>
>
>
> I am new to idl and learning how to use mpfit but run into error, please help if you have time.
>
>
>
>
>
> IDL version 6.3
>
>
>
> ////////////////////
>
> IDL> x = findgen(101)
>
> IDL> y = 25.*exp(-(x-32.)^2/(2*5.^2))+2.*randomn(0,101)
>
> % Program caused arithmetic error: Floating underflow
>
> ///////////////////
>
>
>
> these are the tutorial from the daedalus.as.arizona.edu group.
>
>
>
> thanks in advance.
>
>
>
> LR

Do this in double precision and you will not get the error:

IDL> x = dindgen(101)
IDL> y = 25.*exp(-(x-32.)^2/(2*5.^2))+2.*randomn(0,101)
Re: learning how to use mpfit,. need help [message #87748 is a reply to message #87740] Tue, 25 February 2014 20:13 Go to previous message
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
On Tuesday, February 25, 2014 4:35:53 PM UTC-5, alk...@gmail.com wrote:
> IDL> y = 25.*exp(-(x-32.)^2/(2*5.^2))+2.*randomn(0,101)
> % Program caused arithmetic error: Floating underflow

Floating underflow is almost never an error. It's just warning you that exp(-large_number) far from the centroid of the gaussian, has truncated precision or is being set to zero. Plot your data and you will see it's fine.

Craig
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Using a text list to populate a LIST() in IDL
Next Topic: ps_start output

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 11:53:46 PDT 2025

Total time taken to generate the page: 0.00495 seconds