FE501 – 1019

Graphical solution with Isoprofit lines

max 20x1+10x2s.t. x1x213x1+x27x1,x20

Steps

  1. Draw constraint boundary lines
  2. Get intersections and feasible region
  3. Draw parallel isoprofit lines

CleanShot 2022-10-27 at 13.35.33

 

image-20221027134531215

image-20221027134605443

image-20221027134651692

Changing the slope of the Linear function

What happens if we change the objective function as:

max 20x1+10x215x1+10x2s.t. x1x213x1+x27x1,x20

slope of the original problem

20x1+10x2=z10x2=20x1+zs1=2

slope of the changed problem (similarly):

s2=1510=1.5

image-20221027135209837

c1x1+c2x2=zslope=c1c2

CleanShot 2022-10-27 at 13.57.23

We changed the slope, but the optimav value and the optimal solution (optimal point ) did not changed

In other words,

In the original problem, to get the maximum value

20x1+10x2=70x2=7020x110

In other words,

c1c2

is always the slope of the isoprofit line which are the slope of the objective functions of the linear programming.

Which corner point will be the optimal solution when the slope changed to the second one?

same

what happens if slope = -4 ?

What happens if slope = 1 ?

z=10x110x2

image-20221027140441827

 

which is the optimal solution for this then?

max:z=10x110x2

CleanShot 2022-10-27 at 14.09.33

Simplex Algo Steps

Make it to standard form

min (max)Z=cTxs.t. Ax=bx,b0

In this case, we have

max 20x1+10x2s.t. x1x213x1+x27x1,x20

and we have two inequality functions, so we will introduce two slack variables:

max z=20x1+10x2+0x3+0x4s.t. x1x2+x3=13x1+x2+x4=7xi0,i=1,2,3,4

We can not solve if we have two equations and 4 unknowns.

A system of linear equations, can be solved if you have n equations and n unknowns or variables.

So, this can be solved:

x+y=22xy=5

but we can not solve this:

x+y+z=22xyz=5

To solve this, we need to assume and give z some value, for example :

letz=0x+y=22xy=5

so we converted the problem to a solveable problem,

x=7/3,y=1/3

In general, we have n decision variables and m equations. most of the time we have:

nm

what we do in simplex method is, in each iteration we make

nm variables=0 and solve remaining equations

So we have:

 

Non-basic variables: their value if equal to zero.

Basic variables: their value is non-zero

 

for our problem,

max z=20x1+10x2+0x3+0x4s.t. x1x2+x3=13x1+x2+x4=7xi0,i=1,2,3,4

 

first change the shape of the problem:

z20x110x20x30x4=0s.t.x1x2+x3=13x1+x2+x4=7xi0,i[1,4]

Q: which one of the decision variables must be increased so that objective value increases ? ( in other words, words we have to select one of the non-basic vairables, whos value is currently zero, if we increase the value of one of the basic variables, which gives you increase in the objective value?)

We can see this from the objective function,

Either from

max z=20x1+10x2+0x3+0x4

or from

z20x110x20x30x4=0

For example:

Each unit increase in the

 

Now, in each iteration in the simplex method, we select one of the non-basic variables (current value is zero), and increase the values of the non-basic values to the positive values so that one of them becomes basic.

But this means that, one of the basic variables, must become non-basic. ( we can have only two variables non-basic and only two basic in our case)

 

First Hypothesis (x1=0,x2=0)

x1=0,x2=0,x1x2+x3=1x3=13x1+x2+x4=7x4=7
z=20x1+10x2+0x3+0x4z=0

Which is the point C (0,0)

image-20221027150930228

 

Second Hypothesis (1,0,0,4)

Now, which of the basic variables will become non-basic? ( x3 or x4 ?)

We use the algebric check, the algebrick check is the following:

 

In the first constraint :

for example, if we give x1 the value of 1.1

then we have:

x1x2+x3=10+x3=11.1=0.1

but because all x should be non-negative so, the constraints dose not satisfy, so the maximum number we can give to x1 is 1 then we have x3=0.

In the second constraint:

3x1+x2+x4=7

we have x2 =0

x1+x4=7

so the largest number we can give to x1 is 7, in such case x4 = 0

If we consider both of them, what is the largest number we can give to x1 ?

So in order to satisfy both constraints, the maximum value can be given to x1 is min(max_1,max_2 that is min(1,7) = 1

In other words we have to take the minimum.

We forced x1 to be positive , so one of the current positive values (x3,x4) must become zero.

Which of the x3 or x4 should become 0 ?

Now we have :

x1=1,x2=0

which of the basic variables should be forced to zero?

we calcualted that, x1 is 1 then we have x3=0.

so we have :

x3=0,

so :

x1=1,x2=0,x3=0,3x1+x2+x4=73+0+x4=7x4=4

So our corresponding z value is :

z=20x1+10x2+0x3+0x4=20

Which is the Point B(1,0 )

image-20221027151031187

 

(Matrix) Transformation in the linear system of equations

Solving linear systems with matrices

if we have:

Ax=bAA1x=A1bIx=A1bx=A1b

Solving the original problem with matrix notation

We can write the original problem as follows:

z20x110x20x30x4=0s.t.x1x2+x3=13x1+x2+x4=7xi0,i[1,4]
x1x2x3x4 
-20-10000
1-1101
31017

So that, we can get, x1 = x2 = 0, x3 = 1, x4 = 7. z = 0 (C)

image-20221027210906558

This time we select x1 to be become basic and x3 to be non basic.

x1x2x3x4 
0-3020020
1-1101
04-314

z=20 (B)

image-20221027210935505

We select x2 this time. and because r1 is negative , we select r4.

x1x2x3x4 
00-2.57.550
101/41/42
01-3/41/41

z = 50 (A)

image-20221027211008669

In a maximization problem. there is a negative value in the row of the objkective function, we continue. And also -2.5 is an indicator for us that x3 must become a basic variable this time.

x1x2x3x4 
10001070
40118
31017

z = 70 (D)

image-20221027211043274

 

Short - term finance Problem

Notice: Moved to the 1026 Note.

Extra - Answers to the Book Excersises

Exercise 2.1

CleanShot 2022-10-28 at 10.05.56

Draw all constraint lines as shown: where

eq1=x1+x2=1eq2=x1x2<=0eq3=3x1+x2=6

image-20221028101502599

Get all intersection points

image-20221028101838558

Draw the feasible area

image-20221028102145312

where we have:

eq4=2x1x2

image-20221028102436057

eq4 goes to maximum at point D.

Exercise 2.2

CleanShot 2022-10-28 at 12.40.34

image-20221028130503697

by drawing the feasible region, we can find that , feasible region goes infinite, so the minimum values of the problem occurs at either B and A.

because we have:

θ1=1θ2=23θ2<θ1

we can find that, minimum value of the Z will be at point B, where

Z=2×3+3×2=12,x1,x2b,Z(x1,x2)Z(3,2),

We can also prove this with graphical solution:

image-20221028131058039

Exercise 2.3 **

CleanShot 2022-10-28 at 13.11.35

Fro mthe given we have:

primal:max cTxAxbx0dual: min bTyATycy0

Exercise 2.4

CleanShot 2022-10-28 at 21.11.20

a:

A linear program is infeasible if there exists no solution that satisfies all of the constraints -- in other words, if no feasible solution can be constructed.

Example:

b:

Exercise 2.5 **

CleanShot 2022-10-28 at 21.13.28