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

Home » Public Forums » archive » Solving nonlinear equations
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
Solving nonlinear equations [message #36837] Sat, 01 November 2003 14:21 Go to next message
Thierry Savin is currently offline  Thierry Savin
Messages: 5
Registered: July 2002
Junior Member
Hi all,

Is it possible to create a function called let's say "solvef":

IDL> x=solvef(a,'f')

that returns x the solution of f(x,a)=0 ?

Thanks for any suggestion.
Re: Solving nonlinear equations [message #36917 is a reply to message #36837] Mon, 03 November 2003 10:36 Go to previous message
Thierry Savin is currently offline  Thierry Savin
Messages: 5
Registered: July 2002
Junior Member
Ok, after a long week-end spend in the IDL6 "stupid PDF" help, I give
myself an answer.

function myfunc,x
common myfunca,a
return,f(x,a)
end

function solvef,b
common myfunca,a
a=b
x=fx_root([0,1,2],'myfunc')
return,x
end


I was missing the common block trick.
Thanks for your answers and procedures,
but they are way too complicated for me.

-T



Thierry Savin wrote:

> Hi all,
>
> Is it possible to create a function called let's say "solvef":
>
> IDL> x=solvef(a,'f')
>
> that returns x the solution of f(x,a)=0 ?
>
> Thanks for any suggestion.
>
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: IDL on SuSE v9.0?
Next Topic: How to make IDL faster

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

Current Time: Thu Oct 09 07:48:36 PDT 2025

Total time taken to generate the page: 1.44133 seconds