014-programacion-lineal-2d

Todas

a

c

b

d

Región

Recta

a)\ 2x+y≤5 \b)\ x+2y≤8\c)\ x≥0\d)\ y≥0

a1 = 2
a2 = 1
b1 = 1
b2 = 2
a3 = 5
b3 = 8
c1 = 1
c2 = 0
c3 = 0
cc = -1 (slider from -5 to 5, step 0.05)
c(x, y) = (cc * ((c1 * x) + (c2 * y))) ≤ (cc * c3)
d1 = 0
d2 = 1
d3 = 0
dd = -1
d(x, y) = (dd * ((d1 * x) + (d2 * y))) ≤ (dd * d3)
aa = 1
bb = 1
a(x, y) = (aa * ((a1 * x) + (a2 * y))) ≤ (aa * a3)
b(x, y) = (bb * ((b1 * x) + (b2 * y))) ≤ (bb * b3)
k = 10 (slider from -1 to 10, step 0.05)
fx = -1
fy = -1
fc = 5
f(x, y) = (fx * x) + (fy * y) + fc
e: (fx * x) + (fy * y) + fc = k
l = false
g = false
i = false
h = false
j = false
P: (((a3 * b2) - (b3 * a2)) / ((a1 * b2) - (a2 * b1)), ((a1 * b3) - (b1 * a3)) / ((a1 * b2) - (a2 * b1)))
Q: (((c3 * b2) - (b3 * c2)) / ((c1 * b2) - (c2 * b1)), ((c1 * b3) - (b1 * c3)) / ((c1 * b2) - (c2 * b1)))
R: (((a3 * d2) - (d3 * a2)) / ((a1 * d2) - (a2 * d1)), ((a1 * d3) - (d1 * a3)) / ((a1 * d2) - (a2 * d1)))
S: (((c3 * d2) - (d3 * c2)) / ((c1 * d2) - (c2 * d1)), ((c1 * d3) - (d1 * c3)) / ((c1 * d2) - (c2 * d1)))
polígono1, q, s, r, p = Polygon(Q, S, R, P)
PP: (x(P), y(P), f(x(P), y(P)))
QQ: (x(Q), y(Q), f(x(Q), y(Q)))
RR: (x(R), y(R), f(x(R), y(R)))
SS: (x(S), y(S), f(x(S), y(S)))
m = Segment(RR, R)
n = Segment(P, PP)
t = Segment(Q, QQ)
a_1 = Segment(S, SS)
polígono2, qq, pp, rr, ss = Polygon(QQ, PP, RR, SS)
o = CurveCartesian(t, (k - (fy * t) - fc) / fx, k, t, -10, 10)
u = Plane(o(t), e)
polígono3: polígono1
v = false
w = false