In: Accounting
Refer to Example 3.2–1. Use a surface plot and a contour plot of the perimeter length L as a function of d and θ over the ranges 1 ≤ d ≤ 30 ft and 0.1 ≤ θ ≤ 1.5 rad. Are there valleys other than the one corresponding to d = 7.5984 and θ = 1.0472? Are there any saddle points?
It is required to plot a surface plot and contour plot of the perimeter length L as a function of d and ?? over the ranges
1 ≤ d ≤ 30 feet
0.1 ≤ θ ≤ 1.5 rad
The function is:
L = 100/d – d/tan(θ) + 2d/sin(θ)
The MATLAB plot is given below. Firstly, the data points for d and theta is generated. Then, the mesh grid is created. Finally, length L is calculated at each data point.
Input:
% defining the data
d = 1:1:30;
th = 0.1:0.05:1.5;
[X, Y] = meshgrid(d, th);
L = 100./X - X./tan(Y) + (2.*X)./sin(Y);
% generating the surface and the contour plot
figure(1)
surf(X, Y, L);
xlabel(\'d\');
ylabel(\'sin(\\theta)\');
zlabel(\'Length\')
% generating the countour plot
figure(2)
contour(X, Y, L);
xlabel(\'d\');
ylabel(\'sin(\\theta)\');
Output:
SURFACE PLOT
CONTOUR PLOT
There are no other valley points and no saddle points.
There are no other valley points and no saddle points.