ValueOf in optimisation toolbox
情報
この質問は閉じられています。 編集または回答するには再度開いてください。
古いコメントを表示
I have a simple equation which is a=(b/c)*100. I want a to change value of a (objective) from say 2 to 5. How do I achieve this using the optimisation toolbox? I am used to doing this on the Excel solver.
0 件のコメント
回答 (1 件)
John D'Errico
2016 年 7 月 20 日
You would not have gotten an intelligent answer from the Excel solver on this problem. At least, not one that recognizes the true solution. There are infinitely many solutions here. Not just one. In fact, the optimization toolbox, or ANY such numerical solver, will not produce the infinitely many solutions. At best, you could produce ONE of the infinitely many solutions using any such solver.
So, using a more proper tool for the problem,
syms b c
c = solve(b/c*100==2,c)
c =
50*b
That is, given ANY value of b, the solution for c is 50*b. We can think of the infinity of solutions as the ordered pair (b,c)=(b,50*b). Of course, at b==0, this solution becomes degenerate, making sense only as we approach 0 as a limit.
An important skill in mathematics, as well as MATLAB is learning to understand a problem, and thus to understand the proper tool to solve that problem.
0 件のコメント
この質問は閉じられています。
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!