How do I use fsolve

조회 수: 3 (최근 30일)
Barry Ellis
Barry Ellis 2019년 10월 10일
댓글: Barry Ellis 2019년 10월 13일
Consider the following unconstrained optimization problem: minimize f(x1,x2,…xn)=x1^3+x1^2+2x2^2+3x3^2+x1x2+x2x3-8x1-16x2-32x3+110
Solve it using Matlab’s built-in function: fsolve.

답변 (1개)

Walter Roberson
Walter Roberson 2019년 10월 10일
You cannot directly use fsolve() for that.
However, you can manually find the partial derivatives by doing minor calculus yourself, and then use fsolve() to find where the partial derivatives are all 0.
Partial derivatives of all 0 will be either a minima or a maxima or a saddle point. It happens that that equation has a minima and a maxima, so you will need to be careful.
  댓글 수: 2
Barry Ellis
Barry Ellis 2019년 10월 13일
Thank you Walter. I am new to MATLAB and I guess I didn't ask the question right. I was asked to solve this using MATLAB functions fsolve and fminunc. I was told to first solve it using the analytical method and verify that the found solution is a minimum rather than a maximum, or inflection point. Then I'm supposed to solve it using fsolve, and then solve it using fminunc.
I'm completely lost on this.
Barry Ellis
Barry Ellis 2019년 10월 13일
I found that x(1) can either be 1.0604 or -1.6401. I can do this by hand, but MATLAB has me stumped.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Calculus에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by