how to find the minimum value of the function of two variables with contour plot?

7 ビュー (過去 30 日間)
Sophia Sagala
Sophia Sagala 2019 年 3 月 21 日
コメント済み: Walter Roberson 2019 年 3 月 21 日
How to find minimum value of the function below? I was able to make the contour plot but unable to get the min value using the fminsearch. It kept giving error message when I tried to get the min value. Below is the function and the contour I tried:
x = linspace(0.5,6);
y = linspace(0.5,6);
[X,Y] = ndgrid(x,y);
Q2 = 4.74/4*(3*exp(-2.054*(X-1.401))-2*exp(-1.027*(X-1.401)));
Q1 = 4.74/4*(3*exp(-2.054*(Y-1.401))-2*exp(-1.027*(Y-1.401)));
Q3 = 4.74/4*(3*exp(-2.054*(X+Y-1.401))-2*exp(-1.027*(X+Y-1.401)));
J2 = 4.74/4*(-exp(-2.054*(X-1.401))+6*exp(-1.027*(X-1.401)));
J1 = 4.74/4*(-exp(-2.054*(Y-1.401))+6*exp(-1.027*(Y-1.401)));
J3 = 4.74/4*(-exp(-2.054*(X+Y-1.401))+6*exp(-1.027*(X+Y-1.401)));
Z = 0.904.*(Q1+Q2+Q3-(sqrt(0.5.*((J2-J1).^2+(J1-J3).^2+(J3-J2).^2))));
contour(X,Y,Z,100,'black');
  5 件のコメント
Sophia Sagala
Sophia Sagala 2019 年 3 月 21 日
Can you please explain me how did you get the minima at X = 1.863 with that corresponding value? What code did you use? I did substitute Y = X.
Thanks before.
Walter Roberson
Walter Roberson 2019 年 3 月 21 日
fminsearch() is enough to get this result. The exact solution is X =
-(1000*ln(3))/1027 - (1000*ln(5))/1027 + (1000*ln((7*exp(1438827/1000000) + 4)*(343*exp(4316481/1000000) + 588*exp(1438827/500000) + 30*exp(1438827/2000000)*sqrt(343*exp(4316481/1000000) + 588*exp(1438827/500000) + 1011*exp(1438827/1000000) + 64)*sqrt(3) + 1686*exp(1438827/1000000) + 64)^(1/3) + 49*exp(1438827/500000) + 56*exp(1438827/1000000) + (343*exp(4316481/1000000) + 588*exp(1438827/500000) + 30*exp(1438827/2000000)*sqrt(343*exp(4316481/1000000) + 588*exp(1438827/500000) + 1011*exp(1438827/1000000) + 64)*sqrt(3) + 1686*exp(1438827/1000000) + 64)^(2/3) + 16))/1027 - (1000*ln(343*exp(4316481/1000000) + 588*exp(1438827/500000) + 30*exp(1438827/2000000)*sqrt(343*exp(4316481/1000000) + 588*exp(1438827/500000) + 1011*exp(1438827/1000000) + 64)*sqrt(3) + 1686*exp(1438827/1000000) + 64))/3081
which I found with Maple.

サインインしてコメントする。

回答 (1 件)

KSSV
KSSV 2019 年 3 月 21 日
[c,h] = contour(X,Y,Z,'showtext','on');
min(h.LevelList)
  1 件のコメント
Sophia Sagala
Sophia Sagala 2019 年 3 月 21 日
I am sorry the value does not show the right minimum value.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeContour Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by