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

Home » Public Forums » archive » Amoeba function
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Amoeba function [message #68678] Wed, 18 November 2009 17:18 Go to previous message
Nicki is currently offline  Nicki
Messages: 14
Registered: September 2009
Junior Member
I have the following problem with my amoeba code: It does not do its
job ;) (Probably because i didn't write it right). It's supposed to
find the minimum. But it only finds a local minimum (I guess) not a
global one.

This is the code:

FUNCTION CONSTRAINT,Pin
COMMON FUNC_XY, P0, dP
return,P0+2*dP/!pi*atan(Pin)
END
FUNCTION FUNC, Pin, NOCONSTR=NOCONSTR
if keyword_set(NOCONSTR) then P=Pin $
else P=CONSTRAINT(Pin)
nrows=1. ;number of rows
mu=438.689 ;attenuation coefficient
r_tot=1.5 ;target resolution
r_i=P[3] ;detector intrinsic resolution
rad=P[0] ;distance 'centre of source'-pinhole
wdet=P[1] ;detector width
dfov=P[2] ;diameter of the field-of-view
a=180/!pi*2*asin(dfov/2/rad) ;pinhole opening angle
f=wdet/2/(tan(a/2/180*!pi)) ;distance pinhole-detector
N=2.*!pi*(rad+f)/(1.1*wdet)*Nrows ;number of pinholes/detectors
d=sqrt(R_tot^2-(rad/f)^2*(R_i)^2)/((rad/f)+1.)-alog(2)/mu*ta n(a/2*!pi/
180) ;pinhole diameter
deffs=sqrt(d^2+2/mu*d*tan(a/2*!pi/180)+2/(mu^2)*(tan(a/2/180 *!pi))
^2) ;effective diameter (Sensitivity)
S=N*deffs^2/16/(rad^2)*100 ;Sensitivity
if ~finite(s) then stop
RETURN, -S
END

pro numerical
COMMON FUNC_XY, P0, dP
P0=[60., 80., 80., 0.45] ;initial starting point
dP=[27., 20., 20., 0.4] ;scale
R=AMOEBA(1.0e-5,SCALE=dP, P0=P0, FUNCTION_VALUE=fval) ;result
if r[0] eq -1 then begin
print,'No minimum found.'
return
endif
xmax=CONSTRAINT(r)
ymax=-fval[0]
END
_______________________________________________
It gives me a minimum (or in this case actually maximum, but
anyway...) for R_i=0.05 and w_det=100. S_max is then 0.0088 or s.th
like that. However, if i remove R_i and w_det from the constraint and
put them into the input, as R_i=0.05 and w_det=100,
________________________
..............
r_i=0.05 ;detector intrinsic resolution
rad=P[0] ;distance 'centre of source'-pinhole
wdet=100. ;detector width
dfov=P[1] ;diameter of the field-of-view
a=180/!pi*2*asin(dfov/2/rad) ;pinhole opening angle
f=wdet/2/(tan(a/2/180*!pi)) ;distance pinhole-detector
N=2.*!pi*(rad+f)/(1.1*wdet)*Nrows ;number of pinholes/detectors
d=sqrt(R_tot^2-(rad/f)^2*(R_i)^2)/((rad/f)+1.)-alog(2)/mu*ta n(a/2*!pi/
180) ;pinhole diameter
deffs=sqrt(d^2+2/mu*d*tan(a/2*!pi/180)+2/(mu^2)*(tan(a/2/180 *!pi))
^2) ;effective diameter (Sensitivity)
S=N*deffs^2/16/(rad^2)*100 ;Sensitivity
if ~finite(s) then stop
RETURN, -S
END
pro numerical
COMMON FUNC_XY, P0, dP
P0=[60., 80.] ;initial starting point
dP=[27., 20.]
........................
__________________________________________________
i get a much higher S_max of 0.012, which is pretty weird. Does
anybody get what i mean and can maybe help me out???
[Message index]
 
Read Message
Read Message
Previous Topic: Re: Add SCOPE_TRACEBACK output, other tags into PostScript files
Next Topic: Re: Add SCOPE_VARFETCH output, other tags into PostScript files

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

Current Time: Thu Oct 09 22:09:53 PDT 2025

Total time taken to generate the page: 0.16044 seconds