FE501 – 1012

Fund Allocation Problem

image-20221023203108957

Variables:

x1,x2 : amounts (in 1000$) allocated for the corporate or government bonds.

Objective:

Maximize4x1+3x2

Constraints:

CleanShot 2022-10-23 at 21.44.42

CleanShot 2022-10-23 at 21.46.56

Excel File

Note on this problem:

Because they have different Risk Level and Maturity, when then original problem say avarage risk level or the avarage maturity it is not the arithmetic mean, this is here calcyulated as weighted arithmetic mean or weighted mean 1

here the weigheted avarage is calculated as:

weighted varage(risk)=2×x1+1×x2x1+x2weighted varage(maturity)=3×x1+4×x2x1+x2

Func Allocation - Matrix-Vector Notation

 

image-20221021000338914

CleanShot 2022-10-21 at 00.04.24

Decision variables xi:money allocated for fund iObjective function: Maximize z=0.1x1+0.15x2+0.16x3+0.08x4
subject to: 0.5x1+0.30x2+0.25x3+0.60x40.35×800.3x1+0.10x2+0.4x3+0.2x40.30×800.2x1+0.60x2+0.35x3+0.20x40.15×80
i=14xi=80,x[1,4]

 

CleanShot 2022-10-23 at 13.28.00

Link to Excel File

maxrTxs.t. Ax=bDxdx0Wherer=[0100.150,160,08],A=[1111],b=80,D=[01501301250.60,30.10140.20,2ab0,35012]X0andd=[282412]

Standard form

A linear programming model is in standard form if it is written as follows:

min cTxs.t. Ax=bx0

Any linear program can be rewritten in standard form. In particular , inequality constraints, can be rewritten as equality constraints after the introduction of a so-called slack or surplus variable.

For example ,

image-20221023221357713

can be written as:

maximize 4x1+3x2s.t.  because we have three ineuqlity constraints, we introduce three new variables x3,x4,x5x1+x2+x3+0×x4+0×x5=1002x1+2x+0x3+x4+0x5=1503x1+4x2+0x3+0x4+x5=360xi0,i[1,5]

More generally, a linear program of the form

mincTxs.t. Axbx0

can be written as

mincTxS.t.Ax+s=bx,S0,

It can be rewritten , using matrix notation, in the following standard form:

min[c0]T[xs]s.t. [AI][xs]=b[xs]0

Un restricted variables can be expressed as the difference of two new non-negative variables. For example,

mincTxs.t.Axb.

The unrestricted variable x can be replaced by uv where u,v0 .Hence the above linear program can be rewritten as

mincT(uv)s.t. A(uv)bu,v0

It can also be rewritten, after adding slack variables and using the matrix notation in the following standard form:

min [cc0]T[uvs]s.t. [AAI][uvs]=b[uvs]0

Supplier-warehouse-user Problem

Q: Suppoe we are retailer and we have 10 outlets as i,i[1,10] and demand for each item noted as di,i[1,10]. Seding the outlests directly from supplier to the warehouse costs 50$ per unit, cost for leasing a warehouse is K$, if total units in one order meets the requriement as D then the delivering cost from supplier to ware house is 35 $ per unit.

CleanShot 2022-10-23 at 22.56.13

CleanShot 2022-10-24 at 11.20.14

 

Decision variables and their boundaries

Objective Function

Monimize overall cost, that is :

Z= Cost from Supplier to Outlets + Cost from Supplier to Warehouse + Cost from warehouse to Outlets + Cost of leasing ware house

Cost from Supplier to Outlets = 50×i=1i=10xi

Cost from Supplier to Warehouse = 35×U

Cost from warehouse to Outlets = i=1i=10Ci×Yi

Cost of leasing warehouse = kw

Objective functionminz=35×U+k×w+i=1i=10(ci×yi)+50×i=1i=10xis.t. xi+yi=diUi=1i=10di×wi=1i=10yiUD×wUxi,yi0,w={1leased0otherwise

Solving with Excel Solver:

CleanShot 2022-10-25 at 19.34.58

CleanShot 2022-10-25 at 19.36.20

Excel File

Update: 2022-10-24

[In detail explanation] (https://raw.githubusercontent.com/azataiot/images/master/2022/10/upgit_20221025_1666709901.pdf)

TOYCO Model

CleanShot 2022-10-25 at 19.41.08

Excel File

Decision variables

objective function

max 5×x1+2×x2+5×x3

Constraints

1×x1+2×x2+1×x34303×x1+0×x2+2×x34601×x1+4×x2+0×x3420

 

Answer Report

CleanShot 2022-10-25 at 19.44.58

Notice Constraints - Total OP3 row, status is Not Binding, because we have slack of 20.

Slack is what you need to add to the LHS so that to make the inequality equal.

Ax+s=b

s : slack

Sensitivity Report

CleanShot 2022-10-25 at 21.22.40

In a linear program as z=cTx

Final Value

Final values are the values ofx for the optimal z.

Reduced cost

The reduced cost for a variable is nonzero only when the variable’s value is equal to its upper or lower bound at the optimal solution.

The reduced cost measures the change in the objective function’s value per unit increase in the variable’s value.

The reduced costs tell us how much the objective coefficients (unit profits) can be increased or decreased before the optimal solution changes.

 

Allowable increase

 

CleanShot 2022-10-25 at 22.16.34

CleanShot 2022-10-25 at 22.16.58

CleanShot 2022-10-25 at 22.17.31

CleanShot 2022-10-25 at 22.18.17

 

CleanShot 2022-10-25 at 22.18.48

CleanShot 2022-10-25 at 22.19.47

CleanShot 2022-10-25 at 22.20.32

Allowable decrease

CleanShot 2022-10-25 at 22.21.41

CleanShot 2022-10-25 at 22.23.13

Shadow Price

CleanShot 2022-10-25 at 22.24.59

The Shadow Price for a constraint is nonzero only when the constraint is equal to its bound. ( all material used)

The Shadow Price measures the change in the objective function’s value per unit increase in the constraint’s bound.

CleanShot 2022-10-25 at 22.27.37

CleanShot 2022-10-25 at 22.28.00

CleanShot 2022-10-25 at 22.28.38

CleanShot 2022-10-25 at 22.29.31

Allowable increase

The Allowable Increase and Allowable Decrease fields in the report show the range of increases and decreases for which the Reduced Costs and Shadow Prices remain constant.

CleanShot 2022-10-25 at 22.33.12

CleanShot 2022-10-25 at 22.33.35

Standard form of LPS

The standard form of an LPS is

minz=cTxs.t. Ax=bx0

 

Surplus and Slack value

minx2ys.t. 2x+y5x+3y10in standard form will be minx2ys.t. 2x+ys1=5x+3y+s2=10

s1 is called surplus variable

s2 is called stack variable.

min x2ys.t. x+y=4x0,y0let y=y,y=y
minx+2ys,t, xy=4.x0,y0.

image-20221025224757996

image-20221025225045218

 

Graphical solution Procedure

max x+2ys.t. x+y4x2y22x+y2x,y0

First draw the c1:x+y=4

image-20221025225709059

Then draw c2:x2y=2

image-20221025225819041

Then c3:2x+y=2

image-20221025225927228

Then x0, y0

image-20221025232217047

geogebra-export

Extras

Stanford cvx

Standofrd Convex Optimization Book

CVX site

cvx github

ECE236B - Convex Optimization

EE364a: Convex Optimization I