Can anyone help me in optimizing (maximizing) the function of two variables?

5 views (last 30 days)
I have a function of two variables 'x1' and 'x2' and I want to maximise that function
F(x1,x2) = ((1 + x1/x2) * 725.2) - 398
subject to: x1 <= 5; x2 <= 120; x1 >= 1; x2 >= 40
Please help I shall be thankful

Accepted Answer

Roger Stafford
Roger Stafford on 28 Dec 2016
You don’t need matlab to find the maximum value of this function. The subtraction by 398 does not affect maximization, nor does multiplication by 725.2 or addition by 1. Therefore the problem is equivalent to finding x1 and x2 which maximize x1/x2. Since both are restricted to positive values, the maximum clearly occurs at maximum x1 and minimum x2, namely x1 = 5 and x2 = 40. All done without firing up matlab.
  4 Comments
Roger Stafford
Roger Stafford on 28 Dec 2016
You still don’t need matlab for your modified equation! The maximum value of F will occur when (1+x1/x2)*725.2 is maximum and when x3*76 is maximum, independent of one another. This will occur when x1 = 5, x2 = 40, and x3 = 150. Only if the two terms contain a common variable would the maximum occur at other than the maximum of each of the two separate terms.

Sign in to comment.

More Answers (0)

Categories

Find more on Get Started with Optimization Toolbox in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!