how to find the minimum value of the function of two variables with contour plot?
조회 수: 9 (최근 30일)
이전 댓글 표시
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
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개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Contour Plots에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!