Message Boards Message Boards

0
|
2968 Views
|
0 Replies
|
0 Total Likes
View groups...
Share
Share this post:

Perform optimisation with constraints?

Posted 7 years ago

Im quite new to Mathematica and im trying to perform an optimisation of a function using the NMaximise tool. However, I want to place a number of constraints upon the optimisation. Below is my attempt at the optimisation:

NMaximize[{(
  6 (2 ? Rp + 2 (2.6` - c - 2 l Cos[?/2] - 2 Sqrt[Rp^2 - l^2 Sin[?/2]^2])))/
(a k (2 Rp + 2 l Cos[?/2])), (k ((g1 + g2)/2 + 
((-g1 + g2)^2 p)/(2 ?^2 (2.6` - c - 2 l Cos[?/2] - 
          2 Sqrt[Rp^2 - l^2 Sin[?/2]^2])) + (2.6` - c - 2 l Cos[?/2] - 
        2 Sqrt[Rp^2 - l^2 Sin[?/2]^2])/p))/(
    2 ? Rp + 2 (2.6` - c - 2 l Cos[?/2] - 
        2 Sqrt[Rp^2 - l^2 Sin[?/2]^2])) ? 
    Integer && (g1 + g2)/2 + ((-g1 + g2)^2 p)/(2 ?^2 (2.6` - c - 2 l Cos[?/2] - 
        2 Sqrt[Rp^2 - l^2 Sin[?/2]^2])) + (2.6` - c - 2 l Cos[?/2] - 
      2 Sqrt[Rp^2 - l^2 Sin[?/2]^2])/p ? Integer && (
    2 ? Rp + 2 (2.6` - c - 2 l Cos[?/2] - 
        2 Sqrt[Rp^2 - l^2 Sin[?/2]^2]))/k ? Integer}, {Rp, l, ?}]

What I want to achieve is to find the values for Rp, L and Beta so that the function before the comma is maximised. The constraints I wish to place on the system are that each of the functions after the first comma must be whole, positive numbers. I should also mention that a, k and c in the above equation are simply just numbers that I have a value for.

Many thanks for your help.

Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract