problem in using fmincon
조회 수: 7 (최근 30일)
이전 댓글 표시
Hello,
I want to use fmincon for optimization but i don't have objective function and constrain, so i used external software to generate data for objective function and constrain but in each iteration that external soft ware is running it is time consuming and need space in Hdd. so when i used fmincon, in each iteration need to evaluated function several time, therefor run external software several time to generate new design variables, that is my problem.
Here is an example for 3 variable problem as shown below for do next iteration it count f several times. this calculation has been done in 30 min and need 1 gigabyte of space. i want to reduce these.
Iter F-count f(x) Feasibility optimality step
0 7 3.040648e+01 0.000e+00 3.537e+00
1 14 3.582462e+00 5.513e-05 5.402e-01 5.336e+00
2 22 3.683843e+00 4.303e-05 2.717e-01 1.394e-01
3 30 3.628141e+00 4.317e-05 1.343e-01 3.923e-02
4 38 3.600498e+00 4.325e-05 1.051e-01 1.923e-02
5 45 3.146932e+00 5.681e-05 2.702e-02 1.751e-01
6 52 3.127886e+00 5.748e-05 2.356e-02 7.630e-03
7 61 3.127862e+00 5.748e-05 2.355e-02 9.664e-06
8 68 3.127789e+00 5.749e-05 2.354e-02 2.904e-05
9 91 3.127788e+00 5.749e-05 2.354e-02 3.912e-07
10 103 3.127788e+00 5.749e-05 2.354e-02 8.558e-08
11 113 3.127788e+00 5.749e-05 2.354e-02 7.488e-08
12 129 3.127788e+00 5.749e-05 2.354e-02 1.024e-09
13 140 3.127788e+00 5.749e-05 2.354e-02 4.479e-10
Best, Haghnejat
댓글 수: 0
답변 (1개)
Alan Weiss
2017년 7월 31일
편집: Alan Weiss
2017년 7월 31일
I cannot help you use an external software package better. But I can point you to documentation on objectives and nonlinear constraints in the same function, in case your external package does that computation. And also suggestions on optimizing a simulation or ODE, in case that is what you are doing.
Alan Weiss
MATLAB mathematical toolbox documentation
댓글 수: 4
Alan Weiss
2017년 8월 1일
Sorry, no, I don't have any real good suggestions. In general, it is hard to optimize a general nonlinear function, and having 140 or so function evaluations does not seem like a lot to me for a 7-variable problem.
You can always look at suggestions for when the solver takes too long, but I don't know if any of those suggestions are pertinent for your case.
Good luck,
Alan Weiss
MATLAB mathematical toolbox documentation
John D'Errico
2017년 8월 1일
I'd suggest the optimizer has done pretty well here. 140 evals is not at all large in a multi-variable optimization. Everyone wants their problem solved immediately. I was under the impression that the shown case was a 3 variable problem however.
I might suggest, if you are willing to accept lower tolerances, that you might back off on the default convergence tolerances. So TolFun, TolX. Easing them will allow the optimizer to SOMETIMES terminate more quickly, at some risk of course in that it might also stop looking too soon.
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!