Question: Can someone help me to write a code where beta is constant 2 and k takes value 1 2 and 3 using for loop from equation 3 till end


 

In this code k=2 and Beta=2 has been cconsidered

Loading Optimization

Loading Student:-MultivariateCalculus

ISO ELASTIC DEM ADD ERROR

y := proc (p, e) options operator, arrow; alpha-beta*p+k*e end proc:

G := g(p):

NULL

g := proc (e) options operator, arrow; (1/2)*mu*e^2 end proc:

 

Lambda := proc (z) options operator, arrow; int((z-u)*phi(u), u = 0 .. z) end proc: 

``

``

NULL

Step 1  Integrated supply chain

THE EXPECTED total PROFIT FUNCTION w r t LINEAR DEMAND

 

PI := proc (p, e, z) options operator, arrow; (p-c)*(y(p, e)-z)-(p-v)*Lambda(z)-g(e) end proc

proc (p, e, z) options operator, arrow; (p-c)*(y(p, e)-z)-(p-v)*Lambda(z)-g(e) end proc

(1)

PI(p, e, z)

(p-c)*(-beta*p+e*k+alpha-z)-(p-v)*(int((z-u)*phi(u), u = 0 .. z))-(1/2)*mu*e^2

(2)

FIRST PUT ALL PARAMETER VALUES AND THEN GO FOR THE DIFFERENTIATION

RUN THE OPTIMALITY AND THE SUBROUTINES FOR DIFFERENT Beta and K values

CASE 1:   Put k = 2 and beta =2

beta

(3)

`` 
Int_Profit := simplify(eval(PI(p, e, z), [k = 2, beta = 2, alpha = 50, mu = 10, c = 5, v = 1, phi(u) = 1/2]))

-2*p^2+(1/4)*(-z^2+8*e-4*z+240)*p-5*e^2+(1/4)*z^2-10*e+5*z-250

(4)

Int_Profit[1][1]

(-2*p^2+(1/4)*(-z^2+8*e-4*z+240)*p-5*e^2+(1/4)*z^2-10*e+5*z-250)[1][1]

(5)

 

Optimization:-NLPSolve(Int_Profit, p = 0 .. 60, e = -1000 .. 30, z = -10000 .. 25, initialpoint = {e = 0, p = 10, z = 0}, maximize)

[230.512568949745969, [e = HFloat(2.274015113534025), p = HFloat(16.370075567375324), z = HFloat(-1.4795080892429795)]]

(6)

NULL

Int_Profit

-2*p^2+(1/4)*(-z^2+8*e-4*z+240)*p-5*e^2+(1/4)*z^2-10*e+5*z-250

(7)

Calculate the Value of q

``

q := z+y(p, e)

-beta*p+e*k+alpha+z

(8)

qopt := simplify(eval(q, [e = 2.27401511353403, p = 16.3700755673753, z = 1.47950808924298, k = 2, beta = 2, alpha = 50, mu = 10, c = 5, v = 1, phi(u) = 1/2]))

23.28738718

(9)

Step 2  Decentralized supply chain

Retailer's profit

 

`#msubsup(mi("Π",fontstyle = "normal"),mi("R"),mi("d"))` := proc (p, e, q, w) options operator, arrow; (p-w)*(y(p, e)-z)-(p-v)*Lambda(z)-g(e) end proc

proc (p, e, q, w) options operator, arrow; (p-w)*(y(p, e)-z)-(p-v)*Lambda(z)-g(e) end proc

(10)

Re_Profit := simplify(eval(`#msubsup(mi("Π",fontstyle = "normal"),mi("R"),mi("d"))`(p, e, q, w), [alpha = 50, beta = 2, k = 2, mu = 10, c = 5, v = 1, phi(u) = 1/2, w = 10]))

-2*p^2+(1/4)*(-z^2+8*e-4*z+280)*p-5*e^2+(1/4)*z^2-20*e+10*z-500

(11)

Optimization:-NLPSolve(Re_Profit, p = 0 .. 60, e = -1000 .. 30, z = -10000 .. 25, initialpoint = {e = 0, p = 10, z = 0}, maximize)

[129.081143396165999, [e = HFloat(1.7075918734530873), p = HFloat(18.537959441958364), z = HFloat(-0.9736548233351249)]]

(12)

 

``

``

Optimal q value for decentralized supply chain

 

qd_opt := simplify(eval(q, [e = 1.70759187345309, p = 18.5379594419584, z = .973654823335125, k = 2, beta = 2, alpha = 50, mu = 10, c = 5, v = 1, phi(u) = 1/2]))

17.31291969

(13)

Manufacture's Profit

 

`#msubsup(mi("Π",fontstyle = "normal"),mi("M"),mi("d"))` := proc (p, e, q) options operator, arrow; (w-c)*qd_opt end proc

proc (p, e, q) options operator, arrow; (w-c)*qd_opt end proc

(14)

M_Profit := simplify(eval(`#msubsup(mi("Π",fontstyle = "normal"),mi("M"),mi("d"))`(p, e, q), [qd_opt = 17.31291969, alpha = 50, beta = 2, k = 2, mu = 10, c = 5, v = 1, phi(u) = 1/2, w = 10]))

86.56459845

(15)

Total Wholesale Profit

`#msup(mi("Π",fontstyle = "normal"),mi("d"))` := proc (p, e, q) options operator, arrow; M_Profit+R_Profit end proc

proc (p, e, q) options operator, arrow; M_Profit+R_Profit end proc

(16)

Whole_Profit := eval(`#msup(mi("Π",fontstyle = "normal"),mi("d"))`(p, e, q), [M_Profit = 86.56459845, R_Profit = 129.08114339616599])

215.6457418

(17)

step 3 find the t value

t := (In_Profit-R_Profit)/(w-c)

(In_Profit-R_Profit)/(w-c)

(18)

 

topt := eval(t, [w = 10, c = 5, In_Profit = 230.512568949745969, R_Profit = 129.08114339616599])

20.28628510

(19)

 

Hence range of t is 17.31 to 20.28

 

 

 


 

Download Code_1.mw

Please Wait...