always this message : The first-order optimality measure, 0.0, is less than options
2 次查看(过去 30 天)
显示 更早的评论
hello all,
Recently I came to the forum to ask for help about the functions of the tool box "optimization". I used "lsqnonlin" "lsqcurvefit" "finminuc" and every time I the same result:
my optimization stops after one iteration and the result: The first-order optimality measure, 0.000000e +000, IS = Less than options.TolFun 1.000000e-006.
after reading the documentation, it understand that is possible that i have a local minimum, yet when I change a little the starting values i have always the same problem: it seems odd to me that every time I put a game parameters of the algorithm says I have a local minimum?!?
can you tell me your opinion on that and how can I solve this. thank you very much
1 个评论
Jan
2011-11-4
Walter asked you already to show the relevant parts of the code. Without seeing them, only wild guessing is possible.
回答(3 个)
21did21
2011-11-7
2 个评论
Jan
2011-11-7
Please post the code by editing the original image and use code formatting as explained in the "Markup help" link. In the current form, the code is not readable.
Walter Roberson
2011-11-7
We would need to see WriteCalculTreatment to determine more.
What also need to see the functions Rm_exp and Fv_exp. We deduce they are functions because if they were variables they would have to be initialized within the scope of calculs.
Why do you bother to set RmMine or FvMine ? They are not global or persistent variables, so their value is going to be thrown away (unless they happen to be shared within a scope that you do not show us.)
21did21
2011-11-7
1 个评论
Walter Roberson
2011-11-7
No variable is global unless it has been declared as global in the scope of the routine that is using it. The most obvious way to do that is with a "global" statement right inside calculs; the other methods require that the various routines be "nested" within the routine that declares the variable as global.
Your WriteCalculTreatment function needs all 6 of the variables declared in its header, as it attempts to pass all 6 of them to WriteT6DataFile() . Your calcul() routine is, however, only passing three parameters to WriteCalculTreatment
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Financial Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!