Info

This question is closed. Reopen it to edit or answer.

Optimization of a series of linear equations to maximize profit

1 view (last 30 days)
This question was flagged by 2 contributors
M.
  1 Comment
Image Analyst
Image Analyst on 5 Oct 2021
Why do equations 2 and 6 not have == or <= in them. I'm not sure what they are saying or requiring.

Answers (1)

John D'Errico
John D'Errico on 4 Oct 2021
Edited: John D'Errico on 4 Oct 2021
This answer was flagged by Cassondra Cavegn
They are not differential equations. So I'm not sure what you were possibly thinking.
They are LINEAR equations. But you do not have any single goal. Instead, you have multiple criteria. So you need to use a tool like fgoalattain. This is a multi-criteria optimization, exactly what a tool like that is designed to solve. Also, you cannot use solve.
And finally, you cannot use solve. Solve is not an optimizer. It is not used to maximize variables, etc.
But if I look at your code, I see P. It appears in only ONE place, as a function of A and B.
The variable N NEVER appears, so you can make N as large as infinity.
I see equations like this:
eqn6 = 0.75 + 0.001*y;
Sorry, but that is meaningless. Do you want eqn6 to be set to zero?
eqn7 and eqn8 are just upper bound constraints on x and y.
I see the variable Y as well as y.
I give up. Sorry, but anything you were trying to do with that is never going to work. I have not a clue what you intend with that code, but clearly, you are totally confused too.

Community Treasure Hunt

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

Start Hunting!