Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Create a MATLAB script called OpFun_Name.m that graphically identifies the optim

ID: 3862238 • Letter: C

Question

Create a MATLAB script called OpFun_Name.m that graphically identifies the optimum of the function: f(W) = (5W^2 - W) e^-2W/3. Evaluate from W = 0 to 10. Use the min fx (not the max!) to find the optimum W. Use the disp fx to display the optimum W in the Command Window. 2. Create a MATLAB script called LinSys_Name.m that solves for the following system of linear equations. E = 7D - 11 - 4B - 4D 5A = 15/4 E - (A + D + 340) 255/3 = A + B + C + D + E 24B + 2A - 20B - 3C = 236 - 10D + 4B 0 = 18.5 - 0.5B - 0.1E + 0.8C = F 1. Given the graph of the function below. Identify all the global and local optima (i.e. minima and maxima).

Explanation / Answer

2. (25 points)

If you have MATLAB's Symbolic Math Toolkit, you can also use the "solve" command to solve the above system. Enter

syms A, B, C, D, E
eqn1 = '-4B + 3D - E = 11';
eqn2 = '24A + 4D - 15E = -1360';
eqn3 = '3A + 3B + 3C + 3D+ 3E = 255';
eqn4 = '2A - 3C + 10D = 236';
eqn5 = '5B - 8C + E = 185';
sol = solve([eqn1, eqn2, eqn3, eqn4, eqn5], [A, B, C, D, E]);
ASol = sol.A
BSol = sol.B
CSol = sol.C
DSol = sol.D
ESol = sol.E

else

A = [0 -4 0 3 -1
24 0 0 4 -15
3 3 3 3 3
2 0 -3 10 0
0 5 -8 0 1]
b = [11; -1360; 255; 236; 185]
X = A (backward slash)

On solving

X = 3.0000

   -15.0000                                                                                                                                                                                                                                            

   -20.0000                                                                                                                                                                                                                                            

    17.0000                                                                                                                                                                                                                                            

   100.0000

So F = > 5B - 8C + E = 5 * -15 - 8 * -20 + 100 = 185

1. ( 5points)

Local minima will be at points = 1.5, 2.5, 3.5, 4.5 (y values)

Local maxima will be at points (say points) = 7, 4, 3, 2, 1 ( x values)

Global maximum = 7 ( x value)

Global minimum = 1.5 ( y value)