Nonlinear Optimization problem in Matlab

조회 수: 10 (최근 30일)
Talal Alharbi
Talal Alharbi 2019년 3월 7일
댓글: Talal Alharbi 2019년 4월 14일
Hi
I hve problem when I use x(0) in nonlinear constraint in my code and I have to start with x(0)!.
Please, Could any one solve this issue. I have to solve it to find the lower and upper bounds.
Screen Shot 2019-03-06 at 10.07.31 PM.png
Screen Shot 2019-03-06 at 9.50.28 PM.png
THE ERROR:
Screen Shot 2019-03-06 at 10.03.23 PM.png
  댓글 수: 12
Torsten
Torsten 2019년 4월 10일
What do you mean by "different value" ? Different to what ?
Talal Alharbi
Talal Alharbi 2019년 4월 14일
I attached the code. The problem when I try to find the upper bound (max) which after I multply by (-)Screen Shot 2019-04-14 at 3.09.01 PM.png

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

채택된 답변

David Wilson
David Wilson 2019년 4월 10일
Are you confusing x0, the start guess with x(0), which does not exist. In your constraint, you write x(0). If that is really what you want, then you need to roll your indices on by one. But somehow I doubt it. If you hadpasted your code, I'd have taken a look at it.
  댓글 수: 3
Walter Roberson
Walter Roberson 2019년 4월 14일
You assign the output of the first fmincon() call to a pair of variables named x and fmincon . When you do that, fmincon becomes a numeric scalar instead of a function, and the [x,fval] = fmincon(etc) that you have becomes a request to index into the scalar named fmincon and somehow return two different variables from that, which is not possible from an indexing operation.
Talal Alharbi
Talal Alharbi 2019년 4월 14일
Ok, I got it. Thank you so much. :)

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Solver Outputs and Iterative Display에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by