Chapter 3 Graphical Solution Method and Basic Optimization Concepts
MATLAB Code
Formulation 2:
[Ro,Ri]=meshgrid(0.195:0.001:0.2, 0.195:0.001:0.2);
%Enter functions for the minimization problem
cla reset
axis auto %Minimum and maximum values for axes are determined automatically
xlabel(‘Ro’),ylabel(‘Ri’) %Specifies labels for x– and y–axes
hold on %retains the current plot and axes properties for all subsequent plots
cv1=[0 0];
const1=contour(Ro,Ri,g1,cv1,’k’,’LineWidth’,3);
text(0.196,0.1955,’g1′)
cv11=[0.00005:0.00001:0.0002];
text(0.1,0.005,’g2′)
text(0.35,0.008,’g3′)
const4=contour(Ro,Ri,g4,cv1,’k’,’Linewidth’,3);
text(0.2,0.0095,’g5′)
text(0.198,0.1955,’Feasible Region’)
fv=[15.7 48 78]; %Defines contours for the minimization function
fs=contour(Ro,Ri,f,fv,’k’); %’k’ specifies black dashed lines for function contours