# Perform optimisation with constraints?

Posted 1 year ago
577 Views
|
0 Replies
|
0 Total Likes
|
 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.