This action might not be possible to undo. Are you sure you want to continue?

**Linear Programming Problem
**

Complete the blending problem from the in-class part [included below]

An oil company makes two blends of fuel by mixing three oils. Figures on the costs and daily availability of the oils are given

in Table 1 below.

Table 1. Costs and daily availability of the oils

Also, the requirements of the blends of fuel are given in Table 2 below.

Table 2. Requirements of the blends of fuel

Each litre of blend 1 can be sold for $1.10 and each litre of blend 2 can be sold for $1.20. Long-term contracts require at least

10,000 litres of each blend to be produced. Formulate this blending problem as a linear programming problem:

(a) Find the optimal solution (use both the Large Scale Method and the Medium Scale Method in MATLAB)

(b) Determine the shadow prices for each of the constraints and interpret your results.

Solution

The problem wants to maximize the proﬁt obtained from making and selling the two types of blends of fuel.

Deﬁne the (decision) variables:

x

1

= amount of A oil used in blend 1

x

2

= amount of B oil used in blend 1

x

3

= amount of C oil used in blend 1

x

4

= amount of A oil used in blend 2

x

5

= amount of B oil used in blend 2

x

6

= amount of C oil used in blend 2

The total revenue and cost is given by

Revenue = 1.1(x

1

+x

2

+x

3

) + 1.2(x

4

+x

5

+x

6

)

Cost = 0.3(x

1

+x

4

) + 0.4(x

2

+x

5

) + 0.48(x

3

+x

6

)

and the objective function to be maximized is the linear function

Profit = Revenue −Cost

Next we identify the constrains:

Amount of oil available:

x

1

+x

4

≤ 6, 000

x

2

+x

5

≤ 10, 000

x

3

+x

6

≤ 12, 000

Long term contract requirements:

x

1

+x

2

+x

3

≥ 10, 000

x

4

+x

5

+x

6

≥ 10, 000

Requirement on the composition of the fuels:

x

1

/(x

1

+x

2

+x

3

) ≥ 0.3

x

2

/(x

1

+x

2

+x

3

) ≤ 0.5

x

3

/(x

1

+x

2

+x

3

) ≥ 0.3

x

4

/(x

4

+x

5

+x

6

) ≤ 0.4

x

5

/(x

4

+x

5

+x

6

) ≥ 0.35

x

6

/(x

4

+x

5

+x

6

) ≤ 0.4

Each of the inequalities above need to be rewritten in linear form a

k1

x

1

+ . . . a

k6

x

6

≤ b

k

, for example the ﬁrst one

becomes:

x

1

≥ 0.3(x

1

+x

2

+x

3

), or, equivanently, −0.7x

1

+ 0.3x

2

+ 0.3x

3

≤ 0.

We then setup this linear programming problem in MATLAB, recalling that the standard form of the constraints in

the linprog command is

min f

T

x, subject to Ax ≤ b

R=[1.1; 1.1; 1.1; 1.2; 1.2; 1.2];

C=[0.3; 0.4; 0.48; 0.3; 0.4; 0.48];

f=R-C;

A=[1 0 0 1 0 0;

0 1 0 0 1 0;

0 0 1 0 0 1;

-1 -1 -1 0 0 0;

0 0 0 -1 -1 -1;

-0.7 0.3 0.3 0 0 0;

-0.5 0.5 -0.5 0 0 0;

0.3 0.3 -0.7 0 0 0;

0 0 0 0.6 -0.4 -0.4;

0 0 0 0.35 -0.65 0.35;

0 0 0 -0.4 -0.4 0.6];

b=[6000; 10000; 12000; -10000; -10000; 0; 0; 0; 0; 0; 0];

lb=zeros(6,1);

We employ ﬁrst the Large Scale Method (default in MATLAB):

[x,fval,exitflag,output,lambda] = linprog(-f,A,b,[],[],lb);

x, fmax=-fval

slack=b-A*x

shadowprice=lambda.ineqlin

Optimization terminated.

x =

3414.41

1483.99

5101.60

2585.59

8516.01

6898.40

fmax =

21040.00

slack =

0.00

0.00

0.00

0.00

8000.00

414.41

3516.01

2101.60

4614.41

2216.01

301.60

shadowprice =

0.90

0.80

0.72

0.10

0.00

0.00

0.00

0.00

0.00

0.00

-0.00

This shows the maximum proﬁt is $21,040, obtained when x

1

= 3414.41, x

2

= 1483.99, x

3

= 5101.60, x

4

= 2585.59,

x

5

= 8516.01 and x

6

= 6898.40. In making these blends, the ﬁrst 4 constrains are binding. The shadow prices

indicate that if one can make additional A oil available at a cost of less than .90 ($ per litre) then one would make

an additional proﬁt. Similarly for B and C oil. More over, if one would relax the long-term contract from 10,000

litres to less for blend 1, at a cost of less than 0.72 ($ per litre), then one could make additional proﬁt. Notice that

the 5th constraint is not binding, with a slack of 8,000, which means that blend 2 is produced in a larger quantity

(18,000 litres).

Next, we employ the Medium Scale (simplex method) and compare with the previous results:

options = optimset(’LargeScale’,’off’,’Simplex’,’on’);

[x,fval,exitflag,output,lambda] = ...

linprog(-f,A,b,[],[],lb,[],[],options);

x, fmax=-fval

slack=b-A*x

shadowprice=lambda.ineqlin

Optimization terminated.

x =

3000.00

0

7000.00

3000.00

10000.00

5000.00

fmax =

21040.00

slack =

0

0

0

0

8000.00

0.00

5000.00

4000.00

4200.00

3700.00

2200.00

shadowprice =

0.90

0.80

0.72

0.10

0

0

0

0

0

0

0

Again, the maximum proﬁt is $ 21,040, but with a diﬀerent values of the decision variables. The shadow prices being

the same, the only diﬀerence between the two methods are the slacks for the constraints indicating the requirements

on the composition of each blend. For example, in the second method, the percentage of A oil in Blend 1 is exactly

30%, whereas in the ﬁrst method is more. So the choice of the method should be dictated by other factors (which

are not speciﬁed in this problem).

2. Predator-Prey Problem

Consider the following model for a two-species interaction (one predator, one prey).

dx

dt

= rx

1 −

x

K

+

qxy

x +y

dy

dt

= sy

1 −

y

L

−α

qxy

x +y

Here x = x(t) is the predator population at time t, y = y(t) is the prey population at time t. We assume the environmental

carrying capacity of predator population K = 150, 000 and the environmental carrying capacity of the prey L = 400, 000;

r = 0.05 is the intrinsic growth rate of the predator and s = 0.08 is the intrinsic growth rate of the prey. q = 0.1 is maximal

relative increase rate of the predator population due to prey. α is models the ratio of the mass of a prey individual to the mass of

a predator individual, and is used to account for how much of the biomass of the prey is transformed to the predator population]

(a) For the value α = 0.5, determine the equilibria of the system and determine the stability of the equilibria using the eigenvalue

method.

(b) Plot a complete phase portrait of the dynamical system.

(c) Perform a sensitivity analysis to the parameter α. For which values of α is there a stable coexistence equilibrium?

(d) Indicate what happens to an initial population of 100,000 predators and 400,000 prey for various values of α.

Solutions: Part (a)

syms x y

f=0.05*x*(1-x/150000)+0.1*x*y/(x+y);

g=0.08*y*(1-y/400000)-0.5*0.1*x*y/(x+y);

[xsteady,ysteady]=solve(f,g);

xsteady=double(xsteady);

ysteady=double(ysteady);

disp(’The equilibrium points are’)

disp([xsteady, ysteady])

The equilibrium points are

0 400000.00

150000.00 0

293625.85 269688.21

-20898.58 7584.52

Since we are only interested in steady states in the ﬁrst quadrant, we will discard the 4th steady state.

Eigenvalue method

for i=1:3

G=[f; g];

DG=[diff(f,x) diff(g,x);

diff(f,y) diff(g,y)];

A=subs(DG,[x y],[xsteady(i) ysteady(i)]);

lambda=eig(A);

lambda=double(lambda);

fprintf(’The eigenvalues for the equilibrium (’)

fprintf(’%1.0f, %1.0f’,xsteady(i), ysteady(i)); fprintf(’) are \n’)

fprintf(’%1.2f %1.2f\n\n’,lambda(1), lambda(2));

end

The eigenvalues for the equilibrium (0, 400000) are

0.15 -0.08

The eigenvalues for the equilibrium (150000, 0) are

0.03 -0.05

The eigenvalues for the equilibrium (293626, 269688) are

-0.12 -0.05

By the criterium for stability for continuous time dynamical systems (λ < 0 for asymptotic stability) we conclude

that the coexistence equilibrium is asymptotically stable, the other equilibria being unstable.

Part (b)

We use pplane8.m to generate the complete phase portrait

Part (c)

syms alpha

f=x*(0.05*(1-x/150000)+0.1*y/(x+y));

g=y*(0.08*(1-y/400000)-alpha*0.1*x/(x+y));

[xsteady,ysteady]=solve(f,g,x,y)

ezplot(xsteady(4),[0 1]), hold on

ezplot(ysteady(4),[0 1]), hold off

title(’The coexistence equilibrium’)

DG=[1+diff(f,x) diff(g,x);

diff(f,y) 1+diff(g,y)];

A=subs(DG,[x y],[xsteady(4) ysteady(4)]);

lambda=eig(A);

ezplot(lambda(1),[0 1]), hold on

ezplot(lambda(2),[0 1]), hold off

axis([0 1 0.8 1.05])

title(’the two eigevalues of DG vs a’)

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

0.8

0.85

0.9

0.95

1

1.05

!

the two eigevalues of DG vs a

Conclusion: For α between 0 and the critical value 0.868..., one has an unique stable coexistence equilibrium,

otherwise not.

Part (d)

syms x y

for alpha=[0.1, 0.3, 0.5, 0.7, 0.9]

figure

M=10; % number of samples points

xmin=0; xmax=400000; % domain specification

ymin=0; ymax=500000;

[x,y]=meshgrid(xmin:(xmax-xmin)/M:xmax,ymin:(ymax-ymin)/M:ymax);

dx=x.*(0.05*(1-x/150000)+0.1*y./(x+y)); % x1-component

dy=y.*(0.08*(1-y/400000)-alpha*0.1*x./(x+y)); % x2-component

quiver(x,y,dx,dy); % matlab routine

axis([xmin xmax ymin ymax]);

xlabel(’Predator’); ylabel(’Prey’);

hold on

X=[100000; 400000];

N = 1000;

F= @(x1,x2) [x1*(0.05*(1-x1/150000)+0.1*x2/(x1+x2));

x2*(0.08*(1-x2/400000)-alpha*0.1*x1/(x1+x2))];

for n=1:N

Xnew = X + F(X(1),X(2));

plot([X(1),Xnew(1)], [X(2),Xnew(2)],’--ro’,...

’MarkerFaceColor’,’k’,’MarkerSize’,2)

axis([0 400000 0 500000])

X = Xnew;

end

title(strcat(’Dynamics for alpha =’,num2str(alpha)))

hold off

end

0 0.5 1 1.5 2 2.5 3 3.5 4

x 10

5

0

0.5

1

1.5

2

2.5

3

3.5

4

4.5

5

x 10

5

Predator

P

r

e

y

Dynamics for alpha =0.1

0 0.5 1 1.5 2 2.5 3 3.5 4

x 10

5

0

0.5

1

1.5

2

2.5

3

3.5

4

4.5

5

x 10

5

Predator

P

r

e

y

Dynamics for alpha =0.3

0 0.5 1 1.5 2 2.5 3 3.5 4

x 10

5

0

0.5

1

1.5

2

2.5

3

3.5

4

4.5

5

x 10

5

Predator

P

r

e

y

Dynamics for alpha =0.5

0 0.5 1 1.5 2 2.5 3 3.5 4

x 10

5

0

0.5

1

1.5

2

2.5

3

3.5

4

4.5

5

x 10

5

Predator

P

r

e

y

Dynamics for alpha =0.7

0 0.5 1 1.5 2 2.5 3 3.5 4

x 10

5

0

0.5

1

1.5

2

2.5

3

3.5

4

4.5

5

x 10

5

Predator

P

r

e

y

Dynamics for alpha =0.9

Conclusion: for values of α between 0 and 0.87... we have a stable coexistence equilibrium and the initial population

of 100,000 predators and 400,000 prey will converge to that equilibrium. For values of α above the critical value

0.868... , there are no stable equilibria and population of prey eventually gets extinct.

3. Logistic Model with Harvesting

Consider the one-species population model, where P = P(t) governed by the diﬀerential equation

dP

dt

= rP

1 −

P

M

−hP

where r > 0, M > 0 are the intrinsic growth rate and maximum sustainable population in absence of harvesting and h > 0 is

the rate of harvesting. Assume that the initial population is P(0) = P0

(a) Find the general solution P = P(t);

(b) For T > 0, compute the total yield

YT (h) =

T

0

hP(t) dt

as a function of h, then ﬁnd the optimal hT for which the total yield YT (h) is maximized.

(c) What is the limit lim

T→+∞

hT ?

Solution:

The solution of the logistic equation

dP

dt

= rP

_

1 −

P

M

_

, P(0) = P

0

is given by (see lecture 10)

P(t) =

MP

0

P

0

+ (M −P

0

)e

−rt

In presence of harvesting, the dynamical system remains a logistic equation, but with diﬀerent parameters:

dP

dt

= rP

_

1 −

P

M

_

−hP = (r −h)P −

r

M

P

2

= (r −h)P

_

1 −

P

M(r −h)/r

_

or

dP

dt

= ˜ rP

_

1 −

P

˜

M

_

, P(0) = P

0

where ˜ r = r −h and

˜

M = M(r −h)/r. Hence the solution is

P

h

(t) =

˜

MP

0

P

0

+ (

˜

M −P

0

)e

−˜ rt

=

M(r −h)/rP

0

P

0

+ (M(r −h)/r −P

0

)e

−(r−h)t

Part(b)

The total yield is

Y

T

(h) =

_

T

0

hP

h

(t) dt = h

_

T

0

˜

MP

0

P

0

+ (

˜

M −P

0

)e

−˜ rt

dt = h

_

T

0

˜

MP

0

e

˜ rt

P

0

e

˜ rt

+ (

˜

M −P

0

)

dt

After making a substitution , one gets

Y

T

(h) =

h

˜ r

˜

M

_

ln

_

P

0

e

˜ rT

+ (

˜

M −P

0

)

_

−ln(

˜

M)

_

=

h

˜ r

˜

M ln

_

P

0

˜

M

_

e

˜ rT

−1

_

+ 1

_

Replacing ˜ r = r −h and

˜

M = M(r −h)/r we get

Y

T

(h) = M

h

r

ln

_

P

0

M(r −h)/r

_

e

(r−h)T

−1

_

+ 1

_

To ﬁnd the optimal harvesting rate h

T

, we use MATLAB to maximize total yield. Since symbolically one cannot

ﬁnd an explicit solution, we plug in values for M, r, P0 and T:

syms h

M=1000;

r=0.5;

P0=500;

T=50;

Y=h*M/r*log(P0/(M*(r-h)/r)*(exp((r-h)*T)-1)+1);

ezplot(Y,[0 2*r])

dYdh=diff(Y,h);

solve(dYdh, h)

ans =

0.25532530521461221271496007209301

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

0

500

1000

1500

2000

2500

h

2000 h log(1 (500 (exp(10 20 h) 1))/(2000 h 1000))

If we repeat this with increasingly larger values of T, we see that h

T

approaches r/2.

hT=zeros(1,10);

for j=1:10

T=20*j;

Y=h*M/r*log(P0/(M*(r-h)/r)*(exp((r-h)*T)-1)+1)

dYdh=diff(Y,h);

hT(j)=solve(dYdh, h);

end

plot(hT)

0 20 40 60 80 100 120 140 160 180 200

0

0.05

0.1

0.15

0.2

0.25

0.3

0.35

0.4

0.45

0.5

T

h

T

4. Newton’s Method in 2D as a Discrete Time Dynamical System

Consider the Newton’s Method for approximating zeros of a vector function F(X): say X = [x1, x2]

T

has two variables and

F = [f1, f2]

T

:

To approximate X

∗

such that, F(X

∗

) = 0, start with an initial guess X

(0)

, then iterate

X

(n+1)

= G(X

(n)

) := X

(n)

−[DF(X

(n)

)]

−1

F(X

(n)

)]

(a) Determine the steady states X

∗

of this discrete dynamical system.

(b) Determine whether X

∗

is asymptotically stable or not.

(c) Apply Newton’s method for the system

x

2

1

+x

2

2

= 1

x1 +x2 = 1

by choosing the initial guess X

(0)

= [2; 0]. Plot the trajectory of the solution. Redo this with 3 other initial guesses. What can

go wrong in the Newton’s Method?

(d) The method of steepest descent for minimizing a function of 2 variables h(x1, x2) is given by the discrete time dynamical

system

X

(n+1)

= X

(n)

−t∇h(X

(n)

)

where t > 0 is chosen such that h(X

(n+1)

) is the smallest possible. Use this method for minimizing the function

h(x1, x2) = (x

2

1

+x

2

2

−1)

2

+ (x1 +x2 −1)

2

and compare it with the Newton’s method in part (c). Which method gives a better approximation to the solution when using

the same number of iterations?

Solutions:

(a) X

∗

is a steady state means

X

∗

= G(X

∗

) = X

∗

−[DF(X

∗

)]

−1

F(X

∗

)

which is equivalent to

F(X

∗

) = 0 and DF(X

∗

) invertible

So the steady states of this discrete time dynamical system are precisely the zeros of F(X) = 0 where the Jacobian

matrix DF(X) is nonsingular.

(b) We need to compute the eigenvalues of the Jacobian matrix DG(X

∗

): Using the product rule,

DG(X) = I −D

_

[DF(X)]

−1

_

F(X) −[DF(X)]

−1

DF(X) = I −D

_

[DF(X)]

−1

_

F(X) −I = −D

_

[DF(X)]

−1

_

F(X)

so, at X = X

∗

,

DG(X

∗

) = −D

_

[DF(X

∗

)]

−1

_

F(X

∗

) = 0

since F(X

∗

) = 0. so all the eigenvalues of DG(X

∗

) are zero, hence |λ| < 1, which shows that the steady state is

asymptotically stable!

(c), (d) coming soon

5. Fixed Interest Reinvestment Problem (discrete model)

Bank ”X” oﬀers you to open fee-free savings and checking accounts for a period of T = 10 years. The savings account has

r = 5% annual interest rate, while the checking account has zero (nada!) interest rate. Money in the savings account cannot

be withdrawn (as a bulk sum) during the entire period T = 10 years, but the account rules allow for a fraction of the interest

accrued at any given time to be moved to the checking account. Money in the checking account can be accessed at any time, so

you can spend it as you wish, or leave it to accumulate. You decide to deposit an initial amount x0 = $10, 000 in the savings

account, but want to maximize the return, measured by the total amount moved into the checking account throughout the entire

period (and available for spending)

Assume that the interest is compounded n times a year (say, quarterly n = 4) and that you decide on a ﬁxed fraction u of

the interest accrued during each quarter to be reinvested (left in the savings account) ( 0 ≤ u ≤ 1.)

Let x

k

be the amount of money in the savings account at the end of the k

th

quarter. The discrete dynamical system that

describes how money grows in the savings account is

x

k+1

= x

k

+

r

n

ux

k

, k = 0, . . . , N −1 (1)

(N is the number of times interest is computed during the entire period, N = nT).

(a) Express x

k

as a function of the initial deposit x0.

(b) Find an expression (as a function of u) for the total amount accumulated in the checking account throughout the entire

period (assuming none was spent). [Use the identity 1 +α +α

2

+. . . +α

N−1

=

α

N

−1

α−1

, if α = 1.]

(c) What value of the ﬁxed fraction u ∈ [0, 1] maximizes the total amount of money accumulated in the checking account

throughout the period (found in part (b)).

Solution

(a) For a ﬁxed u ∈ [0, 1] we have

x

1

= x

0

(1 +

r

n

u), x

2

= x

1

(1 +

r

n

u) = x + 0(1 +

r

n

u)

2

Inductively,

x

k

= x

0

(1 +

r

n

u)

k

, for k = 1, 2, . . .

(b) The accumulated amount (available int he checking account at the end of the year) is

A = a

1

+a

2

+. . . +a

N

, where a

k

=

r

n

(1 −u)x

k−1

a

k

is the fraction of interest moved to checking. So,

A =

r

n

(1 −u)[x

0

+x

1

+. . . x

N−1

]

=

r

n

(1 −u)x

0

[1 + (1 +

r

n

u) +. . . + (1 +

r

n

u)

N−1

]

=

r

n

(1 −u)x

0

(1 +

r

n

u)

N

−1

(1 +

r

n

u) −1

=

1 −u

u

x

0

_

((1 +

r

n

u)

N

−1

_

(c) Since the amount found in (b) A = A(u) is a function of (u), highly nonlinear, we use MATLAB to maximize

A(u) on the set u ∈ [0, 1] to get u

∗

= 0.

In conclusion, to maximize the total amount of money accumulated in the checking account one should not reinvest

any portion of the interest.

- 18_MARI4398_07_C18
- 17_MARI4398_07_C17
- 16_MARI4398_07_C16
- 15_MARI4398_07_C15
- 14_MARI4398_07_C14
- 13_MARI4398_07_C13
- 12_MARI4398_07_C12
- 11_MARI4398_07_C11
- 10_MARI4398_07_C10
- 09_MARI4398_07_C09
- 08_MARI4398_07_C08
- 07_MARI4398_07_C07
- 06_MARI4398_07_C06
- 05_MARI4398_07_C05
- 04_MARI4398_07_C04
- 03_MARI4398_07_C03
- 02_MARI4398_07_C02
- 01_MARI4398_07_C01
- 00_MARI4398_07_FM
- FM Instructor Manual
- LN14_Keown_856526_PF_07_LN14
- LN15_Keown_856526_PF_07_LN15
- LN17_Keown_856526_PF_07_LN17
- 0133866688_PDF_TB
- LN09_Keown_856526_PF_07_LN09

Sign up to vote on this title

UsefulNot usefulqe

qe

- 530_343lecture03
- ADL Dottorato2011 Part1 Slides
- tmp6B2D.tmp
- 5000-Exam34
- 2.Maths - Ijms - Nonlinear - Sundaram r
- dynamic instability
- classical mechanics
- Stability of structures
- 1309.0177
- Lecture Module 2 - Nonlinear Equations
- Dsa 310 Userguide
- MITDyn Van Gelder
- adikcomey
- Isp+Codex 27feb2010 v2
- 1992_Stiner y Kuhn_American Anthropology Pararo
- Patter Generation in Diffusive Networks
- Correspondence Principle
- Rodica Curtu and Bard Ermentrout- Oscillations in a refractory neural net
- African Serval in Australia
- Articulated Pipes Conveying Fluid Pulsating With High Frequency
- Specialist Maths Polynomials DI Part BS
- Sales Et Al 2011 - Cannibalism in T. Hispidus
- A Guide to the Generation of Lyapunov Functions
- De Silva, Mann, Gosine - 2014 - Relative Localization With Symmetry Preserving Observers
- CL7103-System Theory QB
- ME2142C6_162r
- Naval Perils
- GAMSMPSGE
- Structural Dynamics Lecture
- EconomicTheory111720060[1]
- SolEXM