이 질문을 팔로우합니다.
- 팔로우하는 게시물 피드에서 업데이트를 확인할 수 있습니다.
- 정보 수신 기본 설정에 따라 이메일을 받을 수 있습니다.
non linear optimization with fmincon
조회 수: 1 (최근 30일)
이전 댓글 표시
Hi, I am solving a nonlinear optimization problem: Xop=fmincon(@ident1,[0.1;0.1],[],[],[],[],[1 1],[50 5]); problem.options =optimset('Display','iter-detailed'); I found Xop= 2.6147 1.0000 I don't understand why the second value of Xop don't change although i change the upper value. If upper value is 0.5 Xop(2)=0.5 Can you help me? thanks
댓글 수: 11
Anoire BEN JDIDIA
2016년 11월 2일
편집: Walter Roberson
2016년 11월 2일
function [eps] =ident1(x)
global Hilb
global tsim
x
eps=sum(abs(Hilb-(x(1)*13270.8617*(55.89*exp(-((tsim- 2.915)/7.182).^2) + 65.16*exp(-((tsim- 378.4)/224.1).^2) + 4.952 *exp(-((tsim-41.41)/9.817).^2) + 8.203*exp(-((tsim-228.6)/ 48.32).^2) + 6.925*exp(-((tsim- 166.4)/54.56).^2) + 2.585*exp(-((tsim-274.2 )/ 28.11).^2) +53.45*exp(-((tsim-50.93)/ 146.7).^2) + 1.155*exp(-((tsim-302)/16.94).^2)-0.29*(30.65*exp(-((tsim-1.463)/1.283).^2) -3.707*exp(-((tsim-12.16)/9.039).^2) + 158.4*exp(-((tsim-9.824e+004)/ 5.722e+004).^2) + 0.09067*exp(-((tsim- 156.9 )/ 0.2263 ).^2)+ 0.1171*exp(-((tsim- 220.8)/23.39).^2) -0.6953*exp(-((tsim- 182.4 )/396.7).^2) + 0.2898*exp(-((tsim- 158.8)/33.83).^2) -0.1958*exp(-((tsim- 183.8)/ 0.3628).^2)))+ x(2)*0.688*(55.89*exp(-((tsim- 2.915)/7.182).^2) + 65.16*exp(-((tsim- 378.4)/224.1).^2) + 4.952 *exp(-((tsim-41.41)/9.817).^2) + 8.203*exp(-((tsim-228.6)/ 48.32).^2) + 6.925*exp(-((tsim- 166.4)/54.56).^2) + 2.585*exp(-((tsim-274.2 )/ 28.11).^2) +53.45*exp(-((tsim-50.93)/ 146.7).^2) + 1.155*exp(-((tsim-302)/16.94).^2)-0.29*(30.65*exp(-((tsim-1.463)/1.283).^2) -3.707*exp(-((tsim-12.16)/9.039).^2) + 158.4*exp(-((tsim-9.824e+004)/ 5.722e+004).^2) + 0.09067*exp(-((tsim- 156.9 )/ 0.2263 ).^2)+ 0.1171*exp(-((tsim- 220.8)/23.39).^2) -0.6953*exp(-((tsim- 182.4 )/396.7).^2) + 0.2898*exp(-((tsim- 158.8)/33.83).^2) -0.1958*exp(-((tsim- 183.8)/ 0.3628).^2))).^2+ 0.87*( 30.65*exp(-((tsim-1.463)/1.283).^2) -3.707*exp(-((tsim-12.16)/9.039).^2) + 158.4*exp(-((tsim-9.824e+004)/ 5.722e+004).^2) + 0.09067*exp(-((tsim- 156.9 )/ 0.2263 ).^2)+ 0.1171*exp(-((tsim- 220.8)/23.39).^2) -0.6953*exp(-((tsim- 182.4 )/396.7).^2) + 0.2898*exp(-((tsim- 158.8)/33.83).^2) -0.1958*exp(-((tsim- 183.8)/ 0.3628).^2)).^2 + x(2)*6156180.1101 +1732750.255 + 567.84 - x(1)*13270.8617*( 39.78*exp(-((tsim- 62.36)/ 51.23 ).^2) + 39.99*exp(-((tsim+13.07)/ 49.11).^2) + 6.574*exp(-((tsim-95.15)/ 7.534).^2) + 7.534*exp(-((tsim-131)/ 20.23).^2) + 3.91e+013*exp(-((tsim- 1.36e+005)/ 2.603e+004).^2) + 15.31*exp(-((tsim-162.5)/49.37).^2) + 11.18*exp(-((tsim- 11.18)/ 41.93).^2) + 5.944*exp(-((tsim- 275.8)/ 15.14 ).^2)-0.29*( 4.629e+004*cos(0.01037*tsim) -8.526e+004*sin(0.01037*tsim ) -6.644e+004*cos(2*0.01037*tsim) + 3426 *sin(2*0.01037*tsim) + 3290*cos(3*0.01037*tsim) + 4.341e+004*sin(3*0.01037*tsim) + 2.338e+004 *cos(4*0.01037*tsim) -2284*sin(4*0.01037*tsim) -1166*cos(5*0.01037*tsim) -1.008e+004*sin(5*0.01037*tsim) -3297 *cos(6*0.01037*tsim) + 421.1*sin(6*0.01037*tsim) + 96.45 *cos(7*0.01037*tsim) + 738.4*sin(7*0.01037*tsim) +6.41*cos(8*0.01037*tsim) -10.68*sin(8*0.01037*tsim)))+ x(2)*0.688*(( 39.78*exp(-((tsim- 62.36)/ 51.23 ).^2) + 39.99*exp(-((tsim+13.07)/ 49.11).^2) + 6.574*exp(-((tsim-95.15)/ 7.534).^2) + 7.534*exp(-((tsim-131)/ 20.23).^2) + 3.91e+013*exp(-((tsim- 1.36e+005)/ 2.603e+004).^2) + 15.31*exp(-((tsim-162.5)/49.37).^2) + 11.18*exp(-((tsim- 11.18)/ 41.93).^2) + 5.944*exp(-((tsim- 275.8)/ 15.14 ).^2)-0.29*( 4.629e+004*cos(0.01037*tsim) -8.526e+004*sin(0.01037*tsim ) -6.644e+004*cos(2*0.01037*tsim) + 3426 *sin(2*0.01037*tsim) + 3290*cos(3*0.01037*tsim) + 4.341e+004*sin(3*0.01037*tsim) + 2.338e+004 *cos(4*0.01037*tsim) -2284*sin(4*0.01037*tsim) -1166*cos(5*0.01037*tsim) -1.008e+004*sin(5*0.01037*tsim) -3297 *cos(6*0.01037*tsim) + 421.1*sin(6*0.01037*tsim) + 96.45 *cos(7*0.01037*tsim) + 738.4*sin(7*0.01037*tsim) +6.41*cos(8*0.01037*tsim) -10.68*sin(8*0.01037*tsim)))).^2+ 0.87*( 4.629e+004*cos(0.01037*tsim) -8.526e+004*sin(0.01037*tsim ) -6.644e+004*cos(2*0.01037*tsim) + 3426 *sin(2*0.01037*tsim) + 3290*cos(3*0.01037*tsim) + 4.341e+004*sin(3*0.01037*tsim) + 2.338e+004 *cos(4*0.01037*tsim) -2284*sin(4*0.01037*tsim) -1166*cos(5*0.01037*tsim) -1.008e+004*sin(5*0.01037*tsim) -3297 *cos(6*0.01037*tsim) + 421.1*sin(6*0.01037*tsim) + 96.45 *cos(7*0.01037*tsim) + 738.4*sin(7*0.01037*tsim) +6.41*cos(8*0.01037*tsim) -10.68*sin(8*0.01037*tsim)).^2)));
end
Alexandra Harkai
2016년 11월 2일
Why should the optimum be at a different Xop(2) value? (Didn't decode the long function but it seems to be the an absolute value of a polynomial, so there could be bits where even though the range is wider, it will not move away from the local optimum.)
Can you plot the ident1 function for a range of [x y] values where x is fixed?
When the upper bound is 0.5, then the lower bound can't be 1, are you changing the problem config?
Alexandra Harkai
2016년 11월 2일
편집: Alexandra Harkai
2016년 11월 2일
In addition to plotting parts of the [x y] surface, the 'iter-detailed' display carries lots of info why the second coordinate doesn't change. Using these optimalisation options it shows where the function argument moves during the iterations. With the 'PlotFcn' defined this would also be displayed:
opts = optimoptions(@fmincon, 'Display','iter-detailed', 'PlotFcn', @optimplotx); % this has to be defined first
Xop = fmincon(@ident1,[0.1;0.1],[],[],[],[],[1 1],[50 5], opts); % then calling the optimisation using those options
Anoire BEN JDIDIA
2016년 11월 2일
not work. error msg: ??? Undefined function or method 'optimoptions' for input arguments of type 'function_handle'.
Error in ==> simultest2 at 18 opts = optimoptions('Display','iter-detailed', 'PlotFcn', @optimplotx); % this has to be defined first
Anoire BEN JDIDIA
2016년 11월 2일
problem.options = optimset('Display','iter','Algorithm','sqp','PlotFcn',@optimplotx); xop=fmincon(@ident1,[0.1;0.1],[],[],[],[],[1 1],[100 100],[],problem.options); its work but i have bad result. xop =
2.6147
1.0000
if lwer value of X(2)=2 we will have xop(2)=2
Alexandra Harkai
2016년 11월 2일
편집: Alexandra Harkai
2016년 11월 2일
What does the iterative display tell you? What reason does it give for finishing the optimisation? You can try to find the exit flag:
[xop, ~, exitflag] = fmincon(...)
How do these compare to when you use a different lower/upper boundary?
These give information for you about why the algorithm stopped and help to think about how you might want to change your optimisation according to What Can Be Wrong If The Solver Succeeds?
Anoire BEN JDIDIA
2016년 11월 2일
if i try : problem.options = optimset('Display','iter-detailed','Algorithm','SQP','PlotFcn',@optimplotx);
[xop, ~, exitflag] = fmincon(@ident1,[3;3],[],[],[],[],[1 2.5],[100 100],[],problem.options); i found xop =
3.1273
2.5000
Alexandra Harkai
2016년 11월 2일
I don't know all the parameters you are using for your optimisation, but regardless, the best advice I can give is to look at all the previous questions above and try to find out how your optimisation behaves. Check the iteration process, not just the final result. Check the linked MATLAB Documentation here too.
답변 (0개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!오류 발생
페이지가 변경되었기 때문에 동작을 완료할 수 없습니다. 업데이트된 상태를 보려면 페이지를 다시 불러오십시오.
웹사이트 선택
번역된 콘텐츠를 보고 지역별 이벤트와 혜택을 살펴보려면 웹사이트를 선택하십시오. 현재 계신 지역에 따라 다음 웹사이트를 권장합니다:
또한 다음 목록에서 웹사이트를 선택하실 수도 있습니다.
사이트 성능 최적화 방법
최고의 사이트 성능을 위해 중국 사이트(중국어 또는 영어)를 선택하십시오. 현재 계신 지역에서는 다른 국가의 MathWorks 사이트 방문이 최적화되지 않았습니다.
미주
- América Latina (Español)
- Canada (English)
- United States (English)
유럽
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom(English)
아시아 태평양
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)