How can I get the graph using fminimax function.
1 view (last 30 days)
Show older comments
I want to get the graph that between objective1 and objective2. I attached three M-files.
#1.minimax_multiobj.m
function y = minimax_multiobj(x)
y(1)=(0.7531*pi*(3^2-2.6^2)*(cos(x(4))*(0.5*x(1)*x(1)+x(1)*x(2)+x(1)*x(3)) + (cos(x(5))*(0.5*x(2)*x(2)+x(2)*x(3))) + cos(x(6))*0.5*x(3)*x(3))) ...
- 10000*(x(1) + x(2)*cos(x(5)) + x(3)*(cos(x(6))));
y(2)= -sqrt((x(3)*cos(x(4))*cos(x(5))*cos(x(6)) + (x(3)*cos(x(4))*(-sin(x(5))*sin(x(6)))) + (x(2)*cos(x(4))*cos(x(5))) + x(1)*cos(x(4)) + 20)^2 ...
+ (-x(3)*sin(x(5))*cos(x(6)) - (x(3)*cos(x(5))*sin(x(6))) - x(2)*sin(x(5)))^2 ...
+ (x(3)*sin(x(4))*cos(x(5))*cos(x(6)) + x(3)*sin(x(4))*(-sin(x(5)))*sin(x(6)) + x(2)*cos(x(5))*sin(x(4)) + x(1)*sin(x(4)) + 20)^2);
#2.nonlcon
%%Constraints function
function [c, c_eq] = nonlcon(x)
c = [-100 + x(1) + x(2) + x(3) ; (-x(3)*sin(x(5))*cos(x(6)) - (x(3)*cos(x(5))*sin(x(6))) - x(2)*sin(x(5)))-10 ; -(-x(3)*sin(x(5))*cos(x(6)) - (x(3)*cos(x(5))*sin(x(6))) - x(2)*sin(x(5)))];
c_eq = [ ];
end
#3.main.m
x0=[10 10 10 0 0 0];
ObjFcn = @minimax_multiobj;
LB = [8 20 30 0*pi/180 80*pi/180 -90*pi/180];
UB = [12 30 60 0*pi/180 80*pi/180 -90*pi/180];
ConsFcn = @nonlcon;
opt = optimoptions('fminimax','AbsoluteMaxObjectiveCount',2, 'Display', 'iter'); % Minimize abs. values
[x,fval] = fminimax(ObjFcn, x0, [], [], [], [], LB, UB, ConsFcn, opt);
hold on;
plot(fval(1,1),fval(1,2), 'r+'); -------------->> I want it to _get graph each Iteration_.
I looking forward to your answers. Thank you.
0 Comments
Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!