• Aucun résultat trouvé

Optimization with constraints

N/A
N/A
Protected

Academic year: 2021

Partager "Optimization with constraints"

Copied!
2
0
0

Texte intégral

(1)

Optimization with constraints

The use of Lagrange multipliers

A simple problem

Weconsiderthesurfaceofrectangle,whichistobemaximizedsubjecttotheconstraintthatthe sumofwidthandheightisconstant.

◼ Thisthesurfaceoftherectangle

In[1]:= A[x_,y_]=x*y

Out[1]= xy

◼ Thetheconstraintisoftheformσ(x,y)=0,where

In[2]:= σ[x_,y_]=x+y-L

Out[2]= -L+x+y

Use elimination of one variable

Forthisexampletheproblemcanbeeasilysolvedbyeliminationofonevariable.Usethecondition x+y=L to write y=L-x and maximize A(x,L-x) with respect to x :

In[3]:= solx=Solve[D[A[x,L-x],x]0,x]

Out[3]= x L 2

Usethissolutiontofindy

In[4]:= soly=Solve[(σ[x,y]/.solx[[1]])0,y]

Out[4]= y L 2

The surface of the of the rectangle is thus maximized if x=y=L/2. This can be seen from the follow- ingplotforA(x,L-x),whereL=1:

(2)

In[5]:= Plot[A[x,1-x],{x,0,1},FrameTrue,FrameLabel{"x","A(x,1-x)"}]

Out[5]=

0.0 0.2 0.4 0.6 0.8 1.0

0.00 0.05 0.10 0.15 0.20 0.25

x

A(x,1-x)

Method of Lagrange multipliers

Alternatively,constructtheextendedfunctiontobeoptimized

In[6]:= Atilde[x_,y_,λ_]=A[x,y]-λ*σ[x,y]

Out[6]= xy-(-L+x+y)λ

andlookforextremevalueswithrespectofx,y,andλ

In[7]:= eq1=D[Atilde[x,y,λ],x]0

Out[7]= y-λ0

In[8]:= eq2=D[Atilde[x,y,λ],y]0

Out[8]= x-λ0

In[9]:= eq3=D[Atilde[x,y,λ],λ]0

Out[9]= L-x-y0

In[10]:= Solve[{eq1,eq2,eq3},{x,y,λ}]

Out[10]= x L

2,y L

2,λ L 2

2 LargrangeMultipliers.nb

Références

Documents relatifs

Nous montrons tout d’abord qu’avec de telles hypothèses, l’exploration avec arrêt dans un anneau est possible de manière déterministe dans un environnement asynchrone si

Figure 7: Deviation in cents of the first resonance frequencies from the target value for the first register (9 first fingerings) for the starting design (Sec. 5.4) and for

The aim is to minimize the total cost of agents while satisfying chance constraints defined over the service level and the average waiting time, in a given set of time periods..

Marcos Vinícius dos Santos Issa, Americo Cunha Jr, Francisco Soeiro.. Cross-entropy Method In Struc- tural Optimization with

suivant Itinéraires combinés par les Voyageurs Dans toutes les gares désignées ci-après, il sera délivré, en dehors des billets circulaires déjà fixés pour certains

Hence, we can enounce the following well-known phase problem in X-ray crystallography, like as in [2, 8, 15, 28]: given the magnitudes of the structure factors, find the correct

Stochastic programs with linear probabilistic con- straints are in general non convex non linear optimiza- tion problems, see [18] among others.. If furthermore some variables

The integration of energy constraints in deterministic scheduling models, such as job-shop scheduling or resource-constrained project scheduling, yields a combinatorial