What Is Optimization Toolbox?

What Is Optimization Toolbox? What Is Optimization Toolbox?

cda.psych.uiuc.edu
from cda.psych.uiuc.edu More from this publisher
12.07.2015 Views

fgoalattainC = [1 0 0; 0 0 1];K0 = [-1 -1; -1 -1]; % Initialize controller matrixgoal = [-5 -3 -1];% Set goal values for the eigenvaluesweight = abs(goal)% Set weight for same percentagelb = -4*ones(size(K0)); % Set lower bounds on the controllerub = 4*ones(size(K0)); % Set upper bounds on the controlleroptions = optimset('Display','iter'); % Set display parameter[K,fval,attainfactor] = fgoalattain(@(K)eigfun(K,A,B,C),...K0,goal,weight,[],[],[],[],lb,ub,[],options)You can run this example by using the demonstration script goaldemo.(From the MATLAB Help browser or the MathWorks Web sitedocumentation, you can click the demo name to display the demo.) Afterabout 12 iterations, a solution isActive constraints:124910K =-4.0000 -0.2564-4.0000 -4.0000fval =-6.9313-4.1588-1.4099attainfactor =-0.3863DiscussionThe attainment factor indicates that each of the objectives has beenoverachieved by at least 38.63% over the original design goals. Theactive constraints, in this case constraints 1 and 2, are the objectivesthat are barriers to further improvement and for which the percentage8-24

fgoalattainof overattainment is met exactly. Three of the lower bound constraintsarealsoactive.In the preceding design, the optimizer tries to make the objectivesless than the goals. For a worst-case problem where the objectivesmust be as near to the goals as possible, use optimset to set theGoalsExactAchieve option to the number of objectives for which thisis required.Consider the preceding problem when you want all the eigenvaluesto be equal to the goal values. A solution to this problem is found byinvoking fgoalattain with the GoalsExactAchieve option set to 3.options = optimset('GoalsExactAchieve',3);[K,fval,attainfactor] = fgoalattain(...@(K)eigfun(K,A,B,C),K0,goal,weight,[],[],[],[],lb,ub,[],...options)After about seven iterations, a solution isK =-1.5954 1.2040-0.4201 -2.9046fval =-5.0000-3.0000-1.0000attainfactor =1.0859e-20In this case the optimizer has tried to match the objectives to the goals.The attainment factor (of 1.0859e-20) indicates that the goals havebeen matched almost exactly.NotesThis problem has discontinuities when the eigenvalues become complex;this explains why the convergence is slow. Although the underlying8-25

fgoalattainC = [1 0 0; 0 0 1];K0 = [-1 -1; -1 -1]; % Initialize controller matrixgoal = [-5 -3 -1];% Set goal values for the eigenvaluesweight = abs(goal)% Set weight for same percentagelb = -4*ones(size(K0)); % Set lower bounds on the controllerub = 4*ones(size(K0)); % Set upper bounds on the controlleroptions = optimset('Display','iter'); % Set display parameter[K,fval,attainfactor] = fgoalattain(@(K)eigfun(K,A,B,C),...K0,goal,weight,[],[],[],[],lb,ub,[],options)You can run this example by using the demonstration script goaldemo.(From the MATLAB Help browser or the MathWorks Web sitedocumentation, you can click the demo name to display the demo.) Afterabout 12 iterations, a solution isActive constraints:124910K =-4.0000 -0.2564-4.0000 -4.0000fval =-6.9313-4.1588-1.4099attainfactor =-0.3863DiscussionThe attainment factor indicates that each of the objectives has beenoverachieved by at least 38.63% over the original design goals. Theactive constraints, in this case constraints 1 and 2, are the objectivesthat are barriers to further improvement and for which the percentage8-24

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!