1.15 Six-hump camel back function | Contents | 2.2 Linear-quadratic system |
dx1/dt=u; dx2/dt=x1;
y=x2
The value of x2 has to be changed during a time period with as little control effort as possible and the final conditions must be met, such that the following criteria are satisfied.
0<=t<=1,
x1(0)=0, x2(0)=-1,
x1(0)=0, x2(0)=0,
f(u)=integral(u(t)^2 dt), 0<=t<=1.
u=6-12·t, Minimum=12.
Figure 1 shows the optimal control vector and states for the continuous system:
Fig. 1: Input and states of double integrator for optimal solution
The double integrator is implemented in the m-file objdopi using a Simulink model, an s-function and Control System Toolbox routines. The model used by the objective function is chosen through the first parameter of the function, the default is the Simulink model.
Fig. 2: Block diagram of double integrator
G(s)=1/s^2
.
The double integrator is the preferred system for learning the advanced features of the Genetic Algorithm Toolbox, i.e.:
For using the first 2 features the appropriate option parameters (parameter 42 and 43) and the corresponding name of the special function in global variables must be set. The concept of setting the parameter in the options structure for using or not the special feature and defining the name of the special function in global variables is very flexible. For every objective function a special function for initialization or state plot can be defined (every problem needs it's own initialization or state plot function) and via parameter the use can be switched on or off. An example of all this is provided with the start script scrdopi, the objective function objdopi , the initialization function initdopi and the state plot function plotdopi.