For each problem, show all work including formulation, MATLAB code, and output 1
ID: 3145819 • Letter: F
Question
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
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.