0% found this document useful (0 votes)
16 views2 pages

The Objective Function

Uploaded by

Raja
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views2 pages

The Objective Function

Uploaded by

Raja
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

The objective function is

𝛼 + 𝛽𝐿 + 𝛿∑𝐹!

As alpha is a constant, we can basically ignore it from the function. We can clearly see that we
have 6 variables in this problem. L and 𝐹" , 𝐹# 𝐹$ , 𝐹% , 𝐹& .

Along with that we have 5 constraint equations. Writing them out sequentially.

𝑆" 𝛾𝐿 + 𝜂𝐹" = 𝐷

𝑆# 𝛾𝐿 + 𝜂𝐹# = 𝐷

𝑆$ 𝛾𝐿 + 𝜂𝐹$ = 𝐷

𝑆% 𝛾𝐿 + 𝜂𝐹% = 𝐷

𝑆& 𝛾𝐿 + 𝜂𝐹& = 𝐷

As gamma is constant, we can combine S and gamma to create another set of constraints to
simply our problem. Or as I did in the Python file, I chose gamma as 1. Similarly, I also chose
eta to be 1

Thus in the LP problem, we have 6 variables and 5 constraints. Thus, the problem is Not
Trivial, and we need to optimize it to solve it. We cannot solve it as a simultaneous equation.

In the given question, we do not have any upper or lower bounds on the variables. This problem
can now be solved using LP solvers over a variety of platforms. I chose to try this in Python as I
wanted to learn Scipy LP programming.
For python LP solver from the Scipy module, we need to rewrite these equations as matrix
equations. That needs some mathematical munging, and we can get the proper form as
required by the solver.

Lets start by creating a column vector of our variables –


𝐿
⎡𝐹 ⎤
⎢𝐹" ⎥
⎢ #⎥
⎢𝐹$ ⎥
⎢𝐹% ⎥
⎣𝐹& ⎦

We need to write our objective function in matrix form. That can be done by creating a
coefficient matrix
[𝛽 𝛿 𝛿 𝛿 𝛿 𝛿]

Multiplying these two vectors will give us the objective function.

Similarly for writing the constraints in the matrix form we create a coefficient matrix and the D
vector.

𝑆" 𝛾 𝜂 0 0 0 0
⎡𝑆 𝛾 0 𝜂 0 0 0⎤
⎢ # ⎥
⎢𝑆$ 𝛾 0 0 𝜂 0 0⎥
⎢𝑆% 𝛾 0 0 0 𝜂 0⎥
⎣𝑆& 𝛾 0 0 0 0 𝜂⎦

Multiplying the coefficient matrix with the variable vector provides the left-hand side of the
constraints.
The right-hand side is just a column vector with 5 Ds.

𝐷
⎡𝐷 ⎤
⎢ ⎥
⎢𝐷 ⎥
⎢𝐷 ⎥
⎣𝐷 ⎦

We create these matrices and solve the optimization problem in the attached python file.

You might also like