This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

Plot 3-D Pareto Front

This example shows how to plot a Pareto front for three objectives. Each objective function is the squared distance from a particular 3-D point. For speed of calculation, write each objective function in vectorized fashion as a dot product. To obtain a dense solution set, use 200 points on the Pareto front.

fun = @(x)[dot(x - [1,2,3],x - [1,2,3],2), ...
    dot(x - [-1,3,-2],x - [-1,3,-2],2), ...
    dot(x - [0,-1,1],x - [0,-1,1],2)];
options = optimoptions('paretosearch','UseVectorized',true,'ParetoSetSize',200);
lb = -5*ones(1,3);
ub = -lb;
rng default % For reproducibility
[x,f] = paretosearch(fun,3,[],[],[],[],lb,ub,[],options);
Pareto set found that satisfies the constraints. 

Optimization completed because the relative change in the volume of the Pareto set 
is less than 'options.ParetoSetChangeTolerance' and constraints are satisfied to within 
'options.ConstraintTolerance'.

Create 3-D Scatter Plot

Plot points on the Pareto front by using scatter3.

figure
subplot(2,2,1)
scatter3(f(:,1),f(:,2),f(:,3),'k.');
subplot(2,2,2)
scatter3(f(:,1),f(:,2),f(:,3),'k.');
view(-148,8)
subplot(2,2,3)
scatter3(f(:,1),f(:,2),f(:,3),'k.');
view(-180,8)
subplot(2,2,4)
scatter3(f(:,1),f(:,2),f(:,3),'k.');
view(-300,8)

By rotating the plot interactively, you get a better view of its structure.

Interpolated Surface Plot

To see the Pareto front as a surface, create a scattered interpolant.

figure
F = scatteredInterpolant(f(:,1),f(:,2),f(:,3),'linear','none');

To plot the resulting surface, create a mesh in x-y space from the smallest to the largest values. Then plot the interpolated surface.

sgr = linspace(min(f(:,1)),max(f(:,1)));
ygr = linspace(min(f(:,2)),max(f(:,2)));
[XX,YY] = meshgrid(sgr,ygr);
ZZ = F(XX,YY);

Plot the Pareto points and surface together.

figure
subplot(2,2,1)
surf(XX,YY,ZZ,'LineStyle','none')
hold on
scatter3(f(:,1),f(:,2),f(:,3),'k.');
hold off
subplot(2,2,2)
surf(XX,YY,ZZ,'LineStyle','none')
hold on
scatter3(f(:,1),f(:,2),f(:,3),'k.');
hold off
view(-148,8)
subplot(2,2,3)
surf(XX,YY,ZZ,'LineStyle','none')
hold on
scatter3(f(:,1),f(:,2),f(:,3),'k.');
hold off
view(-180,8)
subplot(2,2,4)
surf(XX,YY,ZZ,'LineStyle','none')
hold on
scatter3(f(:,1),f(:,2),f(:,3),'k.');
hold off
view(-300,8)

By rotating the plot interactively, you get a better view of its structure.

Plot Pareto Set in Control Variable Space

Create a scatter plot of the x-values in the Pareto set.

figure
subplot(2,2,1)
scatter3(x(:,1),x(:,2),x(:,3),'k.');
subplot(2,2,2)
scatter3(x(:,1),x(:,2),x(:,3),'k.');
view(-148,8)
subplot(2,2,3)
scatter3(x(:,1),x(:,2),x(:,3),'k.');
view(-180,8)
subplot(2,2,4)
scatter3(x(:,1),x(:,2),x(:,3),'k.');
view(-300,8)

This set does not have a clear surface. By rotating the plot interactively, you get a better view of its structure.

See Also

|

Related Topics