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

For each problem, show all work including formulation, MATLAB code, and output 1

ID: 3145819 • Letter: F

Question


For each problem, show all work including formulation, MATLAB code, and output 1. Find analytically the minimum of f(x) = (x + 2)2 subject to inequality constraint r 24 2. Find analytically the minimum of f(z) = (x + 3)2 subject to nequality constraint 3. Find the minimum of numerically using MATLAB function fmins (or fminsearch) 4. Find the minimum of (, 32 subject to algebraic constraint (z, y) 2+y-2 numerically using MATLAB function fmins (or fminsearch) 5. Find the minimum of subject to algebraic constraints (x, y, 2) x + y-3 (x, y, z) := y-z+2 numerically using MATLAB function fmins (or fminsearch)

Explanation / Answer

1)

f(x)=(x+2)2

with constraint x>=4

since f(x) is increasing function of x

hence its minimum is possible at minimum value of x which is x=4

fmin = f(4)=(4+2)2=36

2)

f(x)=(x+3)2

-4<x< 0

f(x) is miminum when x+3 is mimimum

x+3 is mimimum when x=-3 which lies in the range of (-4 0)

thus fmin is at x=-3

fmin=f(-3)=(-3+3)2=0

3)

%%% matlab code %%%

f=@(x) x^2-6*x+9;
[x_,fval]=fminsearch(f,1);
fprintf(' minimum value of f(x) is %f at x= %f ',fval,x_);

output:

minimum value of f(x) is -0.000000 at x= 3.000000