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

Home » Public Forums » archive » Re: Func define
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
Re: Func define [message #19946] Sun, 07 May 2000 00:00
Kenneth P. Bowman is currently offline  Kenneth P. Bowman
Messages: 585
Registered: May 2000
Senior Member
In article <3914EBCF.64D4E023@crsa.bu.edu>, Yu Zhang
<yuzhang@crsa.bu.edu> wrote:

> I happen to have a small problem when I tried to do some
> integrations with IDL. For example, I want to use INT_2D or QSIMP to do
> a calculation. But I found out that the "Func" defined in these
> functions
> only have limited parameters (equal to dimension of integral you want to
> do).
> Other coefficiences must be fixed.
> What to do if I need more parameter in the defined function?
> (e.g. I need y=a*x+b and want to change a, b value outside)
> It seems strange that this shouldn't be difficult to consider,
> or I just fail to catch up the spirit of IDL.

A simple way to do this, although not the only way, is to include a
common block in the function.

FUNCTION MY_FUN, x

COMMON MY_FUN_PARAMETERS, a, b

RETURN, a + b*x
END

Regards, Ken Bowman
Re: Func define [message #19947 is a reply to message #19946] Sun, 07 May 2000 00:00 Go to previous message
meron is currently offline  meron
Messages: 51
Registered: July 1995
Member
In article <3914EBCF.64D4E023@crsa.bu.edu>, Yu Zhang <yuzhang@crsa.bu.edu> writes:
>
> I happen to have a small problem when I tried to do some
> integrations with IDL. For example, I want to use INT_2D or QSIMP to do
> a calculation. But I found out that the "Func" defined in these
> functions
> only have limited parameters (equal to dimension of integral you want to
> do).
> Other coefficiences must be fixed.
> What to do if I need more parameter in the defined function?
> (e.g. I need y=a*x+b and want to change a, b value outside)
> It seems strange that this shouldn't be difficult to consider,
> or I just fail to catch up the spirit of IDL.
> Thank you very much for your help.
>
> Yu Zhang
>
You could use ROMBERG, from my library. Of course, then, you'll need
other fuctions that ROMBERG is calling, so it'll be best to take the
whole library.

Mati Meron | "When you argue with a fool,
meron@cars.uchicago.edu | chances are he is doing just the same"
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Sharing an info structure
Next Topic: Interpolating over faults

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

Current Time: Wed Oct 08 11:37:05 PDT 2025

Total time taken to generate the page: 0.00798 seconds