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.

Antworten (1)

John D'Errico
John D'Errico am 20 Jul. 2016

0 Stimmen

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.

Diese Frage ist geschlossen.

Tags

Noch keine Tags eingegeben.

Gefragt:

LT
am 20 Jul. 2016

Geschlossen:

am 20 Aug. 2021

Community Treasure Hunt

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

Start Hunting!

Translated by