Info

此问题已关闭。 请重新打开它进行编辑或回答。

Optimization of a series of linear equations to maximize profit

1 次查看(过去 30 天)
Cassondra Cavegn
Cassondra Cavegn2021-10-4
关闭: Walter Roberson ,2021-10-13
此 个问题 已被 2 个贡献者标记
M.
  1 个评论
Image Analyst
Image Analyst 2021-10-5
Why do equations 2 and 6 not have == or <= in them. I'm not sure what they are saying or requiring.

回答(1 个)

John D'Errico
John D'Errico 2021-10-4
编辑:John D'Errico 2021-10-4
此 个回答 已被 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!

Translated by