main content

multi-凯发k8网页登录

this example shows how to solve a pole-placement problem using the multiobjective goal attainment method. this algorithm is implemented in the function fgoalattain.

equation that describes evolution of system

consider a 2-input 2-output unstable plant. the equation describing the evolution of the system x(t) is

dxdt=ax(t) bu(t),

where u(t) is the input (control) signal. the output of the system is

y(t)=cx(t).

the matrices a, b, and c are

a =  [ -0.5  0  0;  0  -2  10;  0  1  -2 ];
b =  [ 1  0;  -2  2;  0  1 ];
c =  [ 1  0  0;  0  0  1 ];

optimization objective

suppose that the control signal u(t) is set as proportional to the output y(t):

u(t)=ky(t)

for some matrix k.

this means that the evolution of the system x(t) is:

dxdt=ax(t) bkcx(t)=(a bkc)x(t).

the object of the optimization is to design k to have the following two properties:

1. the real parts of the eigenvalues of (a bkc) are smaller than [–5, –3, –1]. (this is called pole placement in the control literature.)

2. abs(k) <= 4 (each element of k is between -4 and 4)

in order to solve the optimization, first set the multiobjective goals:

goal = [-5, -3, -1];

set the weights equal to the goals to ensure same percentage under- or over-attainment in the goals.

weight = abs(goal);

initialize the output feedback controller

k0 = [ -1 -1; -1 -1];

set upper and lower bounds on the controller

lb = repmat(-4,size(k0)) 
lb = 2×2
    -4    -4
    -4    -4
ub = repmat(4,size(k0))
ub = 2×2
     4     4
     4     4

set optimization display parameter to give output at each iteration:

options = optimoptions('fgoalattain','display','iter');

create a vector-valued function eigfun that returns the eigenvalues of the closed loop system. this function requires additional parameters (namely, the matrices a, b, and c); the most convenient way to pass these is through an anonymous function:

eigfun = @(k) sort(eig(a b*k*c));

call optimization solver

to begin the optimization we call fgoalattain:

[k,~,attainfactor] = ...
        fgoalattain(eigfun,k0,goal,weight,[],[],[],[],lb,ub,[],options);
                 attainment        max     line search     directional 
 iter f-count        factor    constraint   steplength      derivative   procedure 
    0      6              0       1.88521                                            
    1     13          1.031       0.02998            1           0.745     
    2     20         0.3525       0.06863            1          -0.613     
    3     27        -0.1706        0.1071            1          -0.223    hessian modified  
    4     34        -0.2236       0.06654            1          -0.234    hessian modified twice  
    5     41        -0.3568      0.007894            1         -0.0812     
    6     48        -0.3645      0.000145            1          -0.164    hessian modified  
    7     55        -0.3645             0            1        -0.00515    hessian modified  
    8     62        -0.3675     0.0001549            1        -0.00812    hessian modified twice  
    9     69        -0.3889      0.008326            1         -0.0075    hessian modified  
   10     76        -0.3862             0            1         0.00568     
   11     83        -0.3863     5.561e-13            1          -0.998    hessian modified twice  
local minimum possible. constraints satisfied.
fgoalattain stopped because the size of the current search direction is less than
twice the value of the step size tolerance and constraints are 
satisfied to within the value of the constraint tolerance.

the value of the control parameters at the solution is:

k
k = 2×2
   -4.0000   -0.2564
   -4.0000   -4.0000

the eigenvalues of the closed loop system are in eigfun(k) as follows: (they are also held in output fval)

eigfun(k)
ans = 3×1
   -6.9313
   -4.1588
   -1.4099

the attainment factor indicates the level of goal achievement. a negative attainment factor indicates over-achievement, positive indicates under-achievement. the value attainfactor we obtained in this run indicates that the objectives have been over-achieved by almost 40 percent:

attainfactor
attainfactor = -0.3863

evolution of system via solution to ode

here is how the system x(t) evolves from time 0 to time 4, using the calculated feedback matrix k, starting from the point x(0) = [1;1;1].

first solve the differential equation:

[times, xvals] = ode45(@(u,x)((a   b*k*c)*x),[0,4],[1;1;1]);

then plot the result:

plot(times,xvals)
legend('x_1(t)','x_2(t)','x_3(t)','location','best')
xlabel('t');
ylabel('x(t)');

figure contains an axes object. the axes object with xlabel t, ylabel x(t) contains 3 objects of type line. these objects represent x_1(t), x_2(t), x_3(t).

set goals to be achieved exactly

suppose we now require the eigenvalues to be as near as possible to the goal values, [–5, –3, –1]. set options.equalitygoalcount to the number of objectives that should be as near as possible to the goals (i.e., do not try to over-achieve):

all three objectives should be as near as possible to the goals.

options.equalitygoalcount = 3;

call optimization solver

we are ready to call the optimization solver:

[k,fval,attainfactor,exitflag,output,lambda] = ...
    fgoalattain(eigfun,k0,goal,weight,[],[],[],[],lb,ub,[],options);
                 attainment        max     line search     directional 
 iter f-count        factor    constraint   steplength      derivative   procedure 
    0      6              0       1.88521                                            
    1     13          1.031       0.02998            1           0.745     
    2     20         0.3525       0.06863            1          -0.613     
    3     27         0.1528     -0.009105            1           -0.22    hessian modified  
    4     34        0.02684       0.03722            1          -0.166    hessian modified  
    5     41     -3.469e-18      0.005703            1          -0.116    hessian modified  
    6     48      1.117e-18     9.612e-06            1        3.95e-16    hessian modified  
    7     55     -5.805e-21      4.77e-11            1       -5.93e-14    hessian modified  
local minimum possible. constraints satisfied.
fgoalattain stopped because the size of the current search direction is less than
twice the value of the step size tolerance and constraints are 
satisfied to within the value of the constraint tolerance.

the value of the control parameters at this solution is:

k
k = 2×2
   -1.5953    1.2040
   -0.4201   -2.9047

this time the eigenvalues of the closed loop system, which are also held in output fval, are as follows:

eigfun(k)
ans = 3×1
   -5.0000
   -3.0000
   -1.0000

the attainment factor is the level of goal achievement. a negative attainment factor indicates over-achievement, positive indicates under-achievement. the low attainfactor obtained indicates that the eigenvalues have almost exactly met the goals:

attainfactor
attainfactor = -5.8048e-21

evolution of new system via solution to ode

here is how the system x(t) evolves from time 0 to time 4, using the new calculated feedback matrix k, starting from the point x(0) = [1;1;1].

first solve the differential equation:

[times, xvals] = ode45(@(u,x)((a   b*k*c)*x),[0,4],[1;1;1]);

then plot the result:

plot(times,xvals)
legend('x_1(t)','x_2(t)','x_3(t)','location','best')
xlabel('t');
ylabel('x(t)');

figure contains an axes object. the axes object with xlabel t, ylabel x(t) contains 3 objects of type line. these objects represent x_1(t), x_2(t), x_3(t).

see also

related topics

网站地图