Optimisation
Author: Mustapha Boudghene Stambouli

Exemple d'optimisation

Pour suivre les étapes faire bouger le curseur

Définir les variables

X :

Y :

Étape 1: Déterminer le nombre de contraintes

Étape 2 : Déterminer les contraintes sous la forme  A x + B y  = C

Étape 3 : Déterminer la fonction à optimiser

x +

y    (ineq)

x +

y  (ineq)

x +

y (ineq)

x +

y (ineq)

x +

y (ineq)

x +

y (ineq)

x +

y (ineq)

x +

y (ineq)

x +

y (ineq)

x +

y (ineq)

ineq  <

ineq >

ineq≤

ineq≥

ineq <

ineq >

ineq ≤

ineq ≥

ineq <

ineq >

ineq ≤

ineq ≥

ineq <

ineq >

ineq ≤

ineq ≥

ineq <

ineq >

ineq ≤

ineq ≥

ineq <

ineq >

ineq ≤

ineq ≥

ineq <

ineq >

ineq ≤

ineq ≥

ineq <

ineq >

ineq ≤

ineq ≥

ineq <

ineq >

ineq ≤

ineq ≥

ineq <

ineq >

ineq ≤

ineq ≥

y

Z =

x +

Étape 4 : Déterminer le polygone de contraintes

Maximiser

Minimiser

Nombre de sommet du polygone de contraintes excluant l'origine (0,0)

A (

,

)

B (

,

)

C (

,

)

D (

,

)

E (

,

)

F (

,

)

G (

,

)

H (

,

)

I (

,

)

J (

,

)

ineq ≥

ineq <

Étape 5 : La fonction optimisée

Déterminer les sommets du polygone en déterminant les points d'intersections en utilisant 

Les coordonnées sont affichées dans la fenêtre Algèbre

Fait par : Mustapha Boudghene Stambouli
Enseignant de mathématiques à la CSPO

Si les points d'intersections des contraintes n'apparaissent pas dans la fenêtre graphique,  
                                              Faire un zoom avant ou arrière en tournant la roulette de la souris

Étapes = 0 (slider from -5 to 0, step 1)
ChampTexte53 = Textfield()
ChampTexte54 = Textfield()
a_1 = 0 (slider from -1000 to 1000, step 0.1)
b_1 = 0 (slider from -1000 to 1000, step 0.1)
c = 0 (slider from 0 to 10, step 1)
a_2 = 0 (slider from -1000 to 1000, step 0.1)
b_2 = 0 (slider from -1000 to 1000, step 0.1)
a_3 = 0 (slider from -1000 to 1000, step 0.1)
b_3 = 0 (slider from -1000 to 1000, step 0.1)
a_4 = 0 (slider from -1000 to 1000, step 0.1)
b_4 = 0 (slider from -1000 to 1000, step 0.1)
a_5 = 0 (slider from -1000 to 1000, step 0.1)
b_5 = 0 (slider from -1000 to 1000, step 0.1)
a_6 = 0 (slider from -1000 to 1000, step 0.1)
b_6 = 0 (slider from -1000 to 1000, step 0.1)
a_7 = 0 (slider from -1000 to 1000, step 0.1)
b_7 = 0 (slider from -1000 to 1000, step 0.1)
a_8 = 0 (slider from -1000 to 1000, step 0.1)
b_8 = 0 (slider from -1000 to 1000, step 0.1)
a_9 = 0 (slider from -1000 to 1000, step 0.1)
b_9 = 0 (slider from -1000 to 1000, step 0.1)
a_{10} = 0 (slider from -1000 to 1000, step 0.1)
b_{10} = 0 (slider from -1000 to 1000, step 0.1)
c_1 = 0 (slider from -100000 to 100000, step 0.1)
c_2 = 0 (slider from -100000 to 100000, step 0.1)
c_3 = 0 (slider from -100000 to 100000, step 0.1)
c_5 = 0 (slider from -100000 to 100000, step 0.1)
c_4 = 0 (slider from -100000 to 100000, step 0.1)
c_6 = 0 (slider from -100000 to 100000, step 0.1)
c_7 = 0 (slider from -100000 to 100000, step 0.1)
c_8 = 0 (slider from -100000 to 100000, step 0.1)
c_9 = 0 (slider from -100000 to 100000, step 0.1)
c_{10} = 0 (slider from -100000 to 100000, step 0.1)
ChampTexte1 = Textfield(a_1)
ChampTexte2 = Textfield(b_1)
ChampTexte3 = Textfield(c_1)
ChampTexte4 = Textfield(a_2)
ChampTexte5 = Textfield(b_2)
ChampTexte6 = Textfield(c_2)
ChampTexte7 = Textfield(a_3)
ChampTexte8 = Textfield(b_3)
ChampTexte9 = Textfield(c_3)
ChampTexte10 = Textfield(a_4)
ChampTexte11 = Textfield(b_4)
ChampTexte12 = Textfield(c_4)
ChampTexte13 = Textfield(a_5)
ChampTexte14 = Textfield(b_5)
ChampTexte15 = Textfield(c_5)
ChampTexte16 = Textfield(a_6)
ChampTexte17 = Textfield(b_6)
ChampTexte18 = Textfield(c_6)
ChampTexte19 = Textfield(a_7)
ChampTexte20 = Textfield(b_7)
ChampTexte21 = Textfield(c_7)
ChampTexte22 = Textfield(a_8)
ChampTexte23 = Textfield(b_8)
ChampTexte24 = Textfield(c_8)
ChampTexte25 = Textfield(a_9)
ChampTexte26 = Textfield(b_9)
ChampTexte27 = Textfield(c_9)
ChampTexte28 = Textfield(a_{10})
ChampTexte29 = Textfield(b_{10})
ChampTexte30 = Textfield(c_{10})
b = false
a: a_1 * x + b_1 * y < c_1
c_{11} = false
d: a_1 * x + b_1 * y > c_1
e = false
f: a_1 * x + b_1 * y ≤ c_1
g = false
h: a_1 * x + b_1 * y ≥ c_1
i = false
j = false
k = false
l = false
m: a_2 * x + b_2 * y < c_2
o: a_2 * x + b_2 * y > c_2
p: a_2 * x + b_2 * y ≤ c_2
q: a_2 * x + b_2 * y ≥ c_2
r = false
s_5 = false
t = false
u = false
v: a_3 * x + b_3 * y < c_3
w: a_3 * x + b_3 * y > c_3
z: a_3 * x + b_3 * y ≤ c_3
d_6: a_3 * x + b_3 * y ≥ c_3
e_1 = false
f_1 = false
g_1 = false
h_1 = false
i_1: a_4 * x + b_4 * y < c_4
j_1: a_4 * x + b_4 * y > c_4
k_1: a_4 * x + b_4 * y ≤ c_4
l_1: a_4 * x + b_4 * y ≥ c_4
m_1 = false
n_1 = false
o_1 = false
p_1 = false
q_1: a_5 * x + b_5 * y < c_5
r_1: a_5 * x + b_5 * y > c_5
s_1: a_5 * x + b_5 * y ≤ c_5
t_1: a_5 * x + b_5 * y ≥ c_5
u_1 = false
v_1 = false
w_1 = false
w_3 = false
d_7: a_6 * x + b_6 * y < c_6
e_2: a_6 * x + b_6 * y > c_6
f_2: a_6 * x + b_6 * y ≤ c_6
g_2: a_6 * x + b_6 * y ≥ c_6
h_2 = false
i_2 = false
j_2 = false
k_2 = false
l_2: a_7 * x + b_7 * y < c_7
m_2: a_7 * x + b_7 * y > c_7
n_2: a_7 * x + b_7 * y ≤ c_7
o_2: a_7 * x + b_7 * y ≥ c_7
p_2 = false
q_2 = false
r_2 = false
s_2 = false
t_2: a_8 * x + b_8 * y < c_8
u_2: a_8 * x + b_8 * y > c_8
v_2: a_8 * x + b_8 * y ≤ c_8
w_2: a_8 * x + b_8 * y ≥ c_8
o_4 = false
d_3 = false
e_3 = false
f_3 = false
g_3: a_9 * x + b_9 * y < c_9
h_3: a_9 * x + b_9 * y > c_9
i_3: a_9 * x + b_9 * y ≤ c_9
j_3: a_9 * x + b_9 * y ≥ c_9
k_3 = false
l_3 = false
m_3 = false
n_3 = false
o_3: a_{10} * x + b_{10} * y < c_{10}
p_3: a_{10} * x + b_{10} * y > c_{10}
q_3: a_{10} * x + b_{10} * y ≤ c_{10}
r_3: a_{10} * x + b_{10} * y ≥ c_{10}
s_3: a_1 * x + b_1 * y = c_1
d_4: a_2 * x + b_2 * y = c_2
f_4: a_3 * x + b_3 * y = c_3
h_4: a_4 * x + b_4 * y = c_4
j_4: a_5 * x + b_5 * y = c_5
l_4: a_6 * x + b_6 * y = c_6
n_4: a_7 * x + b_7 * y = c_7
q_4: a_8 * x + b_8 * y = c_8
s_4: a_9 * x + b_9 * y = c_9
d_5: a_{10} * x + b_{10} * y = c_{10}
d_1 = 0 (slider from -100000 to 100000, step 0.1)
d_2 = 0 (slider from -100000 to 100000, step 0.1)
ChampTexte31 = Textfield(d_1)
ChampTexte32 = Textfield(d_2)
u_3 = false
v_3 = false
s = 0 (slider from 0 to 10, step 1)
x_1 = 0 (slider from -100000 to 100000, step 0.1)
ChampTexte33 = Textfield(x_1)
x_2 = 0 (slider from -100000 to 100000, step 0.1)
ChampTexte34 = Textfield(x_2)
x_3 = 0 (slider from -100000 to 100000, step 0.1)
x_4 = 0 (slider from -100000 to 100000, step 0.1)
x_5 = 0 (slider from -100000 to 100000, step 0.1)
x_6 = 0 (slider from -100000 to 100000, step 0.1)
x_7 = 0 (slider from -100000 to 100000, step 0.1)
x_8 = 0 (slider from -100000 to 100000, step 0.1)
x_9 = 0 (slider from -100000 to 100000, step 0.1)
x_{10} = 0 (slider from -100000 to 100000, step 0.1)
x_{11} = 0 (slider from -100000 to 100000, step 0.1)
x_{12} = 0 (slider from -100000 to 100000, step 0.1)
x_{13} = 0 (slider from -100000 to 100000, step 0.1)
x_{14} = 0 (slider from -100000 to 100000, step 0.1)
x_{15} = 0 (slider from -100000 to 100000, step 0.1)
x_{16} = 0 (slider from -100000 to 100000, step 0.1)
x_{17} = 0 (slider from -100000 to 100000, step 0.1)
x_{18} = 0 (slider from -100000 to 100000, step 0.1)
x_{19} = 0 (slider from -100000 to 100000, step 0.1)
x_{20} = 0 (slider from -100000 to 100000, step 0.1)
ChampTexte35 = Textfield(x_3)
ChampTexte36 = Textfield(x_4)
ChampTexte37 = Textfield(x_5)
ChampTexte38 = Textfield(x_6)
ChampTexte39 = Textfield(x_7)
ChampTexte40 = Textfield(x_8)
ChampTexte41 = Textfield(x_9)
ChampTexte42 = Textfield(x_{10})
ChampTexte43 = Textfield(x_{11})
ChampTexte44 = Textfield(x_{12})
ChampTexte45 = Textfield(x_{13})
ChampTexte46 = Textfield(x_{14})
ChampTexte47 = Textfield(x_{15})
ChampTexte48 = Textfield(x_{16})
ChampTexte49 = Textfield(x_{17})
ChampTexte50 = Textfield(x_{18})
ChampTexte51 = Textfield(x_{19})
ChampTexte52 = Textfield(x_{20})
z_1: d_1 * x_1 + d_2 * x_2
z_2: d_1 * x_3 + d_2 * x_4
z_3: d_1 * x_5 + d_2 * x_6
z_4: d_1 * x_7 + d_2 * x_8
z_5: d_1 * x_9 + d_2 * x_{10}
z_6: d_1 * x_{11} + d_2 * x_{12}
z_7: d_1 * x_{13} + d_2 * x_{14}
z_8: d_1 * x_{15} + d_2 * x_{16}
z_9: d_1 * x_{17} + d_2 * x_{18}
z_{10}: d_1 * x_{19} + d_2 * x_{20}
A1: z_1
B1: z_2
C1: z_3
D1: z_4
E1: z_5
F1: z_6
G1: z_7
H1: z_8
I1: z_9
J1: z_{10}
K1 = Min(A1:J1)
L1 = Max(A1:J1)
A2: z_1
B2: z_2
C2: z_3
D2: z_4
E2: z_5
F2: z_6
G2: z_7
H2: z_8
I2: z_9
A3: z_1
B3: z_2
C3: z_3
D3: z_4
E3: z_5
F3: z_6
G3: z_7
H3: z_8
A4: z_1
B4: z_2
C4: z_3
D4: z_4
E4: z_5
F4: z_6
G4: z_7
A5: z_1
B5: z_2
C5: z_3
D5: z_4
E5: z_5
F5: z_6
A6: z_1
B6: z_2
C6: z_3
D6: z_4
E6: z_5
A7: z_1
B7: z_2
C7: z_3
D7: z_4
A8: z_1
B8: z_2
C8: z_3
A9: z_1
B9: z_2
K2 = Min(A2:I2)
K3 = Min(A3:H3)
K4 = Min(A4:G4)
K5 = Min(A5:F5)
K6 = Min(A6:E6)
K7 = Min(A7:D7)
K8 = Min(A8:C8)
K9 = Min(A9:B9)
L2 = Max(A2:I2)
L3 = Max(A3:H3)
L4 = Max(A4:G4)
L5 = Max(A5:F5)
L6 = Max(A6:E6)
L7 = Max(A7:D7)
L8 = Max(A8:C8)
L9 = Max(A9:B9)
fmax: K1
fmin: L1
texte22: "Z_{max} = " * L4
texte23: "Z_{max} = " * L5
texte24: "Z_{max} = " * L6
texte25: "Z_{max} = " * L7
texte21: "Z_{max} = " + L3 + ""
texte20: "Z_{max} = " + L2 + ""
texte19: "Z_{max} = " + L1 + ""
texte26: "Z_{max} = " * L8
texte27: "Z_{max} = " * L9
texte28: "Z_{min} = " * K1
texte29: "Z_{min} = " * K2
texte30: "Z_{min} = " * K3
texte31: "Z_{min} = " * K4
texte32: "Z_{min} = " * K5
texte33: "Z_{min} = " * K6
texte34: "Z_{min} = " * K7
texte35: "Z_{min} = " * K8
texte36: "Z_{min} = " * K9
texte39: "Pour          X =" + x_1 + "          et          Y =" + x_2 + ""
texte41: "Pour          X =" * x_3 * "          et          Y =" * x_4
texte42: "Pour          X =" * x_5 * "          et          Y =" * x_6
texte43: "Pour          X =" * x_7 * "          et          Y =" * x_8
texte44: "Pour          X =" * x_9 * "          et          Y =" * x_{10}
texte45: "Pour          X =" * x_{11} * "          et          Y =" * x_{12}
texte46: "Pour          X =" * x_{13} * "          et          Y =" * x_{14}
texte47: "Pour          X =" * x_{15} * "          et          Y =" * x_{16}
texte48: "Pour          X =" * x_{17} * "          et          Y =" * x_{18}
texte49: "Pour          X =" * x_{19} * "          et          Y =" * x_{20}
texte40: "Pour          X =" + x_1 + "          et          Y =" + x_2 + ""
texte50: "Pour          X =" * x_3 * "          et          Y =" * x_4
texte51: "Pour          X =" * x_5 * "          et          Y =" * x_6
texte52: "Pour          X =" * x_7 * "          et          Y =" * x_8
texte53: "Pour          X =" * x_9 * "          et          Y =" * x_{10}
texte54: "Pour          X =" * x_{11} * "          et          Y =" * x_{12}
texte55: "Pour          X =" * x_{13} * "          et          Y =" * x_{14}
texte56: "Pour          X =" * x_{15} * "          et          Y =" * x_{16}
texte57: "Pour          X =" * x_{17} * "          et          Y =" * x_{18}
texte58: "Pour          X =" + x_1 + "          et          Y =" + x_2 + ""
texte59: "Pour          X =" * x_3 * "          et          Y =" * x_4
texte60: "Pour          X =" * x_5 * "          et          Y =" * x_6
texte61: "Pour          X =" * x_7 * "          et          Y =" * x_8
texte62: "Pour          X =" * x_9 * "          et          Y =" * x_{10}
texte63: "Pour          X =" * x_{11} * "          et          Y =" * x_{12}
texte64: "Pour          X =" * x_{13} * "          et          Y =" * x_{14}
texte65: "Pour          X =" * x_{15} * "          et          Y =" * x_{16}
texte66: "Pour          X =" * x_1 * "          et          Y =" * x_2
texte67: "Pour          X =" * x_3 * "          et          Y =" * x_4
texte68: "Pour          X =" * x_5 * "          et          Y =" * x_6
texte69: "Pour          X =" * x_7 * "          et          Y =" * x_8
texte70: "Pour          X =" * x_9 * "          et          Y =" * x_{10}
texte71: "Pour          X =" * x_{11} * "         et          Y =" * x_{12}
texte72: "Pour          X =" * x_{13} * "         et          Y =" * x_{14}
texte73: "Pour          X =" * x_1 * "         et          Y =" * x_2
texte74: "Pour          X =" * x_3 * "        et          Y =" * x_4
texte75: "Pour          X =" * x_5 * "        et          Y =" * x_6
texte76: "Pour          X =" * x_7 * "        et          Y =" * x_8
texte77: "Pour          X =" * x_9 * "        et          Y =" * x_{10}
texte78: "Pour          X =" * x_{11} * "        et          Y =" * x_{12}
texte79: "Pour          X =" * x_1 * "        et          Y =" * x_2
texte80: "Pour          X =" * x_3 * "        et          Y =" * x_4
texte81: "Pour          X =" * x_5 * "        et          Y =" * x_6
texte82: "Pour          X =" * x_7 * "        et          Y =" * x_8
texte83: "Pour          X =" * x_9 * "       et          Y =" * x_{10}
texte84: "Pour          X =" * x_1 * "       et          Y =" * x_2
texte85: "Pour          X =" * x_3 * "       et          Y =" * x_4
texte86: "Pour          X =" * x_5 * "       et          Y =" * x_6
texte87: "Pour          X =" * x_7 * "       et          Y =" * x_8
texte88: "Pour          X =" * x_1 * "       et          Y =" * x_2
texte89: "Pour          X =" * x_3 * "       et          Y =" * x_4
texte90: "Pour          X =" * x_5 * "       et          Y =" * x_6
texte91: "Pour          X =" * x_1 * "       et          Y =" * x_2
texte92: "Pour          X =" * x_3 * "       et          Y =" * x_4
texte96: "Pour          X =" * x_1 * "          et          Y =" * x_2
texte97: "Pour          X =" * x_3 * "          et          Y =" * x_4
texte98: "Pour          X =" * x_5 * "          et          Y =" * x_6
texte99: "Pour          X =" * x_7 * "         et          Y =" * x_8
texte100: "Pour          X =" * x_9 * "         et          Y =" * x_{10}
texte101: "Pour          X =" * x_{11} * "         et          Y =" * x_{12}
texte102: "Pour          X =" * x_{13} * "         et          Y =" * x_{14}
texte103: "Pour          X =" * x_{15} * "         et          Y =" * x_{16}
texte104: "Pour          X =" * x_{17} * "         et          Y =" * x_{18}
texte105: "Pour          X =" * x_{19} * "         et          Y =" * x_{20}
texte106: "Pour          X =" * x_1 * "         et          Y =" * x_2
texte107: "Pour          X =" * x_3 * "        et          Y =" * x_4
texte108: "Pour          X =" * x_5 * "        et          Y =" * x_6
texte109: "Pour          X =" * x_7 * "       et          Y =" * x_8
texte110: "Pour          X =" * x_9 * "       et          Y =" * x_{10}
texte111: "Pour          X =" * x_{11} * "      et          Y =" * x_{12}
texte112: "Pour          X =" * x_{13} * "      et          Y =" * x_{14}
texte113: "Pour          X =" * x_{15} * "      et          Y =" * x_{16}
texte114: "Pour          X =" * x_{17} * "     et          Y =" * x_{18}
texte115: "Pour          X =" * x_1 * "     et          Y =" * x_2
texte116: "Pour          X =" * x_3 * "     et          Y =" * x_4
texte117: "Pour          X =" * x_5 * "         et          Y =" * x_6
texte118: "Pour          X =" * x_7 * "         et          Y =" * x_8
texte119: "Pour          X =" * x_9 * "         et          Y =" * x_{10}
texte120: "Pour          X =" * x_{11} * "         et          Y =" * x_{12}
texte121: "Pour          X =" * x_{13} * "         et          Y =" * x_{14}
texte122: "Pour          X =" * x_{15} * "         et          Y =" * x_{16}
texte123: "Pour          X =" * x_1 * "         et          Y =" * x_2
texte124: "Pour          X =" * x_3 * "        et          Y =" * x_4
texte125: "Pour          X =" * x_5 * "        et          Y =" * x_6
texte126: "Pour          X =" * x_7 * "        et          Y =" * x_8
texte127: "Pour          X =" * x_9 * "        et          Y =" * x_{10}
texte128: "Pour          X =" * x_{11} * "        et          Y =" * x_{12}
texte129: "Pour          X =" * x_{13} * "        et          Y =" * x_{14}
texte130: "Pour          X =" * x_1 * "        et          Y =" * x_2
texte131: "Pour          X =" * x_3 * "       et          Y =" * x_4
texte132: "Pour          X =" * x_5 * "       et          Y =" * x_6
texte133: "Pour          X =" * x_7 * "       et          Y =" * x_8
texte134: "Pour          X =" * x_9 * "       et          Y =" * x_{10}
texte135: "Pour          X =" * x_{11} * "       et          Y =" * x_{12}
texte136: "Pour          X =" * x_1 * "       et          Y =" * x_2
texte137: "Pour          X =" * x_3 * "       et          Y =" * x_4
texte138: "Pour          X =" * x_5 * "       et          Y =" * x_6
texte139: "Pour          X =" * x_7 * "       et          Y =" * x_8
texte140: "Pour          X =" * x_9 * "       et          Y =" * x_{10}
texte141: "Pour          X =" * x_1 * "       et          Y =" * x_2
texte142: "Pour          X =" * x_3 * "       et          Y =" * x_4
texte143: "Pour          X =" * x_5 * "       et          Y =" * x_6
texte144: "Pour          X =" * x_7 * "       et          Y =" * x_8
texte145: "Pour          X =" * x_1 * "       et          Y =" * x_2
texte146: "Pour          X =" * x_3 * "       et          Y =" * x_4
texte147: "Pour          X =" * x_5 * "       et          Y =" * x_6
texte148: "Pour          X =" * x_1 * "       et          Y =" * x_2
texte149: "Pour          X =" * x_3 * "      et          Y =" * x_4