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

Home » Public Forums » archive » function minimization
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
function minimization [message #35554] Fri, 20 June 2003 13:31 Go to next message
lyubo is currently offline  lyubo
Messages: 34
Registered: March 2002
Member
[f1(x,y)-A]^2+ [f2(x,y)-B]^2 = 0

Is there any function in IDL that I can use to minimize the above equation
with respect to x and y? (A and B are constants).

I was looking at LMFIT but I am not sure if I can apply in this case.

Any feedback would be appreciated.

Thanks,

Lyubo
Re: Function minimization [message #53445 is a reply to message #35554] Thu, 12 April 2007 13:29 Go to previous message
news.verizon.net is currently offline  news.verizon.net
Messages: 47
Registered: August 2003
Member
> I have been singularly unsuccessful on implementing a procedure/
> function which implements minF_parabolic to minimize a quadratic
> function. Specifically, I am not at all clear how any function gets
> minimized if only a scalar - px - is being passed. Wouldn't one want
> to pass an array of independent variables?

Not necessarily, because the function gets called iteratively, as one
refines the the position of the minimum.

For a simple example, consider a simple quadratic

function quadfunc, x
return, (x[0]-2.345)^2
end

In this case we know the position of the minimum is at 2.345, but
we'll let minf_parabolic figure it out numerically. As a starting
point , we need 3 points which bracket the minimum, i.e. f(b) < f(a)
and f(b) < f(c) with a<b<c. You could get these using
minf_bracket.pro for example, but let's say we know that the 3 points
0, 2, and 5 bracket the minimum. Then

IDL> minf_parabolic,0,2,5,xmin,func_name='quadfunc' & print,xmin
2.34508


(MINF_PARABOLIC is an IDL implementation of the "Brent" algorithm in
"Numerical Recipes" available at http://idlastro.gsfc.nasa.gov/ftp/pro/math/minf_parabolic.pr o
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: idl segfaults in FC5
Next Topic: problem with widget_draw and draw_button_events under windows

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

Current Time: Fri Oct 10 16:23:33 PDT 2025

Total time taken to generate the page: 1.12214 seconds