Академический Документы
Профессиональный Документы
Культура Документы
of
UCLA-PSO ALGORITHM
(MATLAB VERSION)
http://www.ee.ucla.edu/antlab
April 2007
Chapter 1
1
Figure 1.1 shows the flowchart of subroutines in the RPSO algorithm. Before starting an
optimization, the optimizer is configured by specifying input parameters in init global.m.
The subroutine PSO.m contains the main loop that updates V, X, P and G iteratively. In
this loop, boundary conditions are implemented by bc fit.m and the evaluator is called by
evalfit.m. The main loop is executed for the number of iterations specified in init global.m.
The position and fitness values of all candidate designs encountered in the optimization is
recorded in an output file, and the subroutine convg.m is applied for post-processing.
4. SEED: The optimization is executed without using a seed (a randomly initialized searm)
if SEED = 0. The seed specified in seed.mat is used if SEED = 1.
5. VMAX: The fractional maximum velocity of each agent. Its value is typically selected
between 0.1 and 0.2.
6. MAX WEIGHT, MIN WEIGHT: The upper and lower limits of the time varying inertia weight.
Their values are typically selected as 0.9 and 0.4, respectively.
File convg.m is a post-processing subroutine that plots the convergence curve and necessary
properties of the global optimum. In convg.m, the command lines:
load xxxx.txt;
c = xxxx(1:NUM AGENTS*MAX ITER, :);
should be modified according to the output file name ‘xxxx’. The post-processing is exe-
cuted by typing:
>> convg
in the command window, with the global optimum stored in a variable best design.
The optimization takes about 20 seconds and an output file ‘output.txt’ is generated.
The post-processing subroutine ‘convg.m’ generates three figures that plot the convergence
curve, the element positions and the radiation pattern of the optimal design, respectively.
These concrete numbers can be viewed by typing:
best design =
0.2146 1.5870 1.0612 0.5998
The element locations are plotted in Fig. 1.4(a). Its radiation pattern is plotted in Fig 1.4(b),
which has a peak SLL of -19.7dB.
The input of the subroutine is a row vector x which represents a candidate design. An in-
ternal or external evaluator (it is the analyzer that addresses the desired application) is then
called to analyze x, with a result y returned by the evaluator. The fitness value f(y) is calcu-
lated in evalfit.m and is finally returned to the main subroutine PSO.m. For instance, in the
aperiodic array design example shown above, an internal analyzer is applied to calculate the
radiation pattern of each candidate design. The analyzer is directly imbedded in evalfit.m.
The fitness function is defined as the peak SLL in the sidelobe region. Its value is given to
variable ‘fitness’ and returned.
For a general external evaluator, its .exe file can be called in Matlab by:
>> ! xxxx
where ‘xxxx’ is the name of the executable file. In this case, evalfit.m should also read
the output of the evaluator as the input of the fitness function.