Info

Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.

Optimization of a series of linear equations to maximize profit

1 Ansicht (letzte 30 Tage)
Cassondra Cavegn
Cassondra Cavegn am 4 Okt. 2021
Geschlossen: Walter Roberson am 13 Okt. 2021
Diese(r) Frage wurde durch 2 Mitwirkende markiert
M.
  1 Kommentar
Image Analyst
Image Analyst am 5 Okt. 2021
Why do equations 2 and 6 not have == or <= in them. I'm not sure what they are saying or requiring.

Antworten (1)

John D'Errico
John D'Errico am 4 Okt. 2021
Bearbeitet: John D'Errico am 4 Okt. 2021
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!

Translated by