Re: qsimp, qromb, qromo [message #39625 is a reply to message #39621] |
Thu, 03 June 2004 13:29   |
Craig Markwardt
Messages: 1869 Registered: November 1996
|
Senior Member |
|
|
gnarloo@libero.it (michele) writes:
> Dear all,
> I'm new to this newsgroup so first of all, hello everybody!
>
> The problem i encountered is the following:
>
> I tried to use
> qsimp and qromb to integrate a couple of functions (scattering
> problems, nothing special) but the system crashes..
I've never found the IDL integration routines to be particular useful.
You might try my adaptive routine, QPINT1D. Which is based on the
tried and trusted library called Quadpack.
> I tried to integrate cos(x) between 0 and pi (the result is obviously
> zero)
> and these functions give out some kind of error message but not the
> result..
Example:
print, qpint1d('cos(x)', /expression, 0d, !dpi)
4.7089631e-17
...which is as close to zero as you are practically going to get.
Of course, you can also integrate pure IDL functions rather than IDL
expressions, but the /EXPRESSION option can be very useful at the
command line.
Craig
http://cow.physics.wisc.edu/~craigm/idl/idl.html (under Mathematics)
--
------------------------------------------------------------ --------------
Craig B. Markwardt, Ph.D. EMAIL: craigmnet@REMOVEcow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
------------------------------------------------------------ --------------
|
|
|