99 lines
3.9 KiB
HTML
99 lines
3.9 KiB
HTML
<HTML>
|
|
<HEAD>
|
|
<TITLE>The Peak Optimiser</TITLE>
|
|
</HEAD>
|
|
<BODY>
|
|
<H1>The Peak Optimiser</H1>
|
|
<P>
|
|
In instrument control the need may arise to optimise a peak with respect to
|
|
several variables. Optimising means finding the maximum of the peak with
|
|
respect to several variables.
|
|
This is useful during instrument calibration, for example.
|
|
Four circle diffractometers use this facility on a day to day basis
|
|
for finding and verifying the exact position of reflections. In order to
|
|
support both usages a more general module has been implemented. The
|
|
algorithm is like this:
|
|
<pre>
|
|
while errors gt precision and cycles lt maxcycles
|
|
for all variables
|
|
do a scan
|
|
Try find the maximum, two halfwidth points and the peak center.
|
|
if failure extend the scan.
|
|
if success shift the variable, remember last shift.
|
|
If shift lt precicison mark this variable as done
|
|
end for
|
|
end while
|
|
</pre>
|
|
Possible outcomes of this procedure are: success, the peak was lost or the
|
|
maximum number of cycles was reached. This routine requires that the
|
|
instrument is currently placed somewhere on the peak and not miles away.
|
|
</P>
|
|
<p>
|
|
The peak optimiser supports another optimisation algorithm which is faster but
|
|
may not be as accurate. This is hill climbing:
|
|
<pre>
|
|
while errors gt precision and cycles lt maxcycles
|
|
for all variables
|
|
find the direction into which the intensity rises
|
|
step into this direction until the intensity drops
|
|
end for
|
|
end while
|
|
</pre>
|
|
</p>
|
|
<p>
|
|
The Peak Optimiser is implemented as an object with the name opti. It
|
|
understand the following commands:
|
|
<DL>
|
|
<DT>opti clear
|
|
<DD> clears the optimiser.
|
|
<DT>opti addvar name step nStep precision
|
|
<DD>This command adds a variable to optimise to the optimiser. The user has
|
|
to specify the name of the variable, the step width to use for scanning, the
|
|
number of steps needed to cover the full peak when scanning and the
|
|
precision which should be achieved when optimising the peak. The step width
|
|
and number of steps parameters should cover the whole peak. However, the
|
|
Optimiser will extend the scan is the specified range is not sufficient.
|
|
<DT>opti run
|
|
<DD>Starts the optimiser. It will then optimise the peak. This may take some
|
|
time as it uses a time consuming scan based algorithm.
|
|
<DT>opti climb
|
|
<DD>Starts the optimiser in hill climbing mode. Hill climbing is faster but may
|
|
not be as accurate as a scan based optimization.
|
|
</DL>
|
|
The behaviour of the optimiser can be configured by modifying some
|
|
parameters. The synatx is easy: <b>opti parameter</b> prints the value of the
|
|
parameter, <b>opti parameter newval</b> sets a new value for the parameter.
|
|
The following parameters are supported:
|
|
<DL>
|
|
<DT>maxcycles
|
|
<DD>The maximum number of cycles the optimiser will run when trying to
|
|
optimise a peak. The default is 7.
|
|
<DT>threshold
|
|
<DD>When a peak cannot be identified after a scan on a variable, the
|
|
optimiser will check if there is a peak at all. In order to do that it
|
|
searches for a count rate higher then the threshold parameter. If such a
|
|
rate cannot be found the optimiser will abort and complain that he lost the
|
|
peak.
|
|
<DT>channel
|
|
<DD>The counter channel to use for scanning. The default is to use the
|
|
counter. By modifying this parameter, the optimiser can optimise on a
|
|
monitor instead.
|
|
<DT>countmode
|
|
<DD>The counting mode to use when scanning. Possible values are <b>timer</b> or
|
|
<b>monitor</b>.
|
|
<DT>preset
|
|
<DD>The preset value to use for counting in the scan. Depending on the
|
|
status of the countmode parameter this is either a preset time or a preset
|
|
monitor.
|
|
</DL>
|
|
</p>
|
|
<p>
|
|
It is the users reponsability to provide meaningful step widths. Usually this is
|
|
dependent on the instrument resolution and thus fairly constant. Also these
|
|
optimisation algorithms will fail if the instrument is not positioned at the
|
|
flank of a peak. Probaly the best will be to do several cycles of hill
|
|
climbing first, followed by one cycle of scan optimisation for extra accuracy.
|
|
</p>
|
|
</BODY>
|
|
</HTML>
|