Application Center - Maplesoft

App Preview:

Intertemporal Consumption Dynamics

You can switch back to the summary page by clicking here.

Learn about Maple
Download Application


 

Image 

> # Intertemporal Consumption dynamics
 

>
 

> ###################### Slope Indifference Curve ###################
 

> restart:
 

>
 

> # Our General intertemporal utility function is given by
 

> U:=F(c1(t),c2(t));
 

F(c1(t), c2(t)) (1)
 

> # where c1 is consumtion in period 1 amd c2 is consumption in period 2                                        
 

>
 

> # The derivative with respect to time (multivariable chain rule) for the above function is given by
 

> dU=diff(F(c1,c2),c1)*diff(c1(t),t)+diff(F(c1,c2),c2)*diff(c2(t),t);
 

dU = `+`(`*`(diff(F(c1, c2), c1), `*`(diff(c1(t), t))), `*`(diff(F(c1, c2), c2), `*`(diff(c2(t), t)))) (2)
 

> # We now note that any movement along the same indifference curve (also called a isoquant or contour line)
 

> # means that the change in U is equal to zero, dQ=0. The increase in U due to an increase in c1 is
 

> # completly offset by the decrease in U due to an decrease in c2
 

>
 

> subs(dU=0,%);
 

0 = `+`(`*`(diff(F(c1, c2), c1), `*`(diff(c1(t), t))), `*`(diff(F(c1, c2), c2), `*`(diff(c2(t), t)))) (3)
 

> isolate(%,diff(c2(t),t));
 

diff(c2(t), t) = `+`(`-`(`/`(`*`(diff(F(c1, c2), c1), `*`(diff(c1(t), t))), `*`(diff(F(c1, c2), c2))))) (4)
 

> %/diff(c1(t),t);
 

`/`(`*`(diff(c2(t), t)), `*`(diff(c1(t), t))) = `+`(`-`(`/`(`*`(diff(F(c1, c2), c1)), `*`(diff(F(c1, c2), c2))))) (5)
 

> # We note that
 

> # diff(F(c1, c2), c1)= Marginal Utility with respect to c1 (MU_c1) and
 

> # diff(F(c1, c2), c2)= Marginal Utility with respect to c2 (MU_c2)
 

>
 

> # Note that MU_c1 is the extra utility we get from one extra unit of c1 and
 

> # MU_c2 is the extra utility we get from one extra unit of c2
 

>
 

> subs({diff(F(c1, c2), c1)= MU_c1, diff(F(c1, c2), c2)= MU_c2},%);
 

`/`(`*`(diff(c2(t), t)), `*`(diff(c1(t), t))) = `+`(`-`(`/`(`*`(MU_c1), `*`(MU_c2)))) (6)
 

> ######################################################################
 

>
 

> # We now note that diff(c2(t),t)=c2(t+1)-c2(t) and diff(c1(t),t)=c1(t+1)-c1(t)
 

>
 

> # Which means that
 

> diff(c2(t),t)/diff(c1(t),t)=(c2(t+1)-c2(t))/(c1(t+1)-c1(t));
 

`/`(`*`(diff(c2(t), t)), `*`(diff(c1(t), t))) = `/`(`*`(`+`(c2(`+`(t, 1)), `-`(c2(t)))), `*`(`+`(c1(`+`(t, 1)), `-`(c1(t))))) (7)
 

> # Since the slope of a function is defined as
 

> slope=(y(t+1)-y(t))/(x(t+1)-x(t));
 

slope = `/`(`*`(`+`(y(`+`(t, 1)), `-`(y(t)))), `*`(`+`(x(`+`(t, 1)), `-`(x(t))))) (8)
 

> # we can write
 

> diff(c2(t),t)/diff(c1(t),t)=slope;
 

`/`(`*`(diff(c2(t), t)), `*`(diff(c1(t), t))) = slope (9)
 

> ########################################################################
 

>
 

> # If we substitute that into the previous equation we get
 

> slope_indifference_curve:=-MU_c1/MU_c2;
 

`+`(`-`(`/`(`*`(MU_c1), `*`(MU_c2)))) (10)
 

>
 

> ###################### Slope Budget Constraint ###################
 

>
 

> # Our budget constraint is given by
 

> I=P_c1*c1+P_c2*c2;
 

I = `+`(`*`(P_c1, `*`(c1)), `*`(P_c2, `*`(c2))) (11)
 

> isolate(%,c1);
 

c1 = `+`(`-`(`/`(`*`(`+`(`-`(I), `*`(P_c2, `*`(c2)))), `*`(P_c1)))) (12)
 

> collect(%,c2);
 

c1 = `+`(`/`(`*`(I), `*`(P_c1)), `-`(`/`(`*`(P_c2, `*`(c2)), `*`(P_c1)))) (13)
 

> sort(%,I);
 

c1 = `+`(`/`(`*`(I), `*`(P_c1)), `-`(`/`(`*`(P_c2, `*`(c2)), `*`(P_c1)))) (14)
 

> # The slope of the budget constraint is therefore given by - P_c2/P_c1
 

> slope_budget_constraint:=- P_c2/P_c1;
 

`+`(`-`(`/`(`*`(P_c2), `*`(P_c1)))) (15)
 

>
 

> ####################### Optimality ###################
 

>
 

> # For optimality the slope of the indifference curve has to
 

> # be equal to the slope of the budget constraint
 

> slope_indifference_curve=slope_budget_constraint;
 

`+`(`-`(`/`(`*`(MU_c1), `*`(MU_c2)))) = `+`(`-`(`/`(`*`(P_c2), `*`(P_c1)))) (16)
 

>
 

> ##############################################################
 

>
 

> ################ Utility Example-1: Basic  ##############
 

>
 

> ########### Slope Utility Function
 

>
 

> restart;
 

> # Our Utility function is given by the equation below
 

> U:=u(c1)+B*u(c2);
 

`+`(u(c1), `*`(B, `*`(u(c2)))) (17)
 

> # where c1 is consumption period 1 and c2 is consumption period 2
 

> # note that consumption in period 2 c2 is discounted. We therefor have
 

> # Bu(c2) where B=1/(1+p) where p is a time preference parameter
 

>
 

> # Our marginal utility with respect to c1 is given by
 

> MU_c1=diff(U,c1);
 

MU_c1 = diff(u(c1), c1) (18)
 

> # Our marginal utility with respect to c2 is given by
 

> MU_c2=diff(U,c2);
 

MU_c2 = `*`(B, `*`(diff(u(c2), c2))) (19)
 

> # The indifference curve slope is therefore given by
 

> MRS:=-rhs(%%)/rhs(%);
 

`+`(`-`(`/`(`*`(diff(u(c1), c1)), `*`(B, `*`(diff(u(c2), c2)))))) (20)
 

> # Which can be written as
 

> slope_ind:= - u?(c1)/ (B*u?(c2));
 

`+`(`-`(`/`(`*`(`u?`(c1)), `*`(B, `*`(`u?`(c2)))))) (21)
 

>
 

> ########### Slope Budget Constraint
 

>
 

> restart;
 

> # Our budget constraint is given by
 

> c1+c2/(1+r)=w1+ w2/(1+r);
 

`+`(c1, `/`(`*`(c2), `*`(`+`(1, r)))) = `+`(w1, `/`(`*`(w2), `*`(`+`(1, r)))) (22)
 

> %-c1;
 

`/`(`*`(c2), `*`(`+`(1, r))) = `+`(w1, `/`(`*`(w2), `*`(`+`(1, r))), `-`(c1)) (23)
 

> %*(1+r);
 

c2 = `*`(`+`(1, r), `*`(`+`(w1, `/`(`*`(w2), `*`(`+`(1, r))), `-`(c1)))) (24)
 

> # Which can be written as
 

> c2 = (1+r)*w1+(1+r)*w2/(1+r)-(1+r)*c1;
 

c2 = `+`(`*`(`+`(1, r), `*`(w1)), w2, `-`(`*`(`+`(1, r), `*`(c1)))) (25)
 

> # We define the intercept alpha=(1+r)*w1+w2 so we get
 

> c2=alpha-(1+r)*c1;
 

c2 = `+`(alpha, `-`(`*`(`+`(1, r), `*`(c1)))) (26)
 

> # Which means that the slope of the budget constraint  
 

> # is given by - P_c2/P_c1 = -(1+r)
 

>
 

>
 

> ########### Optimality
 

>
 

> # Again for optimality the slope of the indifference curve has to
 

> # be equal to the slope of the budget constraint
 

>
 

> # Slope indifference curve is given by
 

> slope_ind:= - u?(c1)/ (B*u?(c2));
 

`+`(`-`(`/`(`*`(`u?`(c1)), `*`(B, `*`(`u?`(c2)))))) (27)
 

> # Slope budget constraint is given by
 

> slope_bud:= -(1+r);
 

`+`(`-`(1), `-`(r)) (28)
 

> %=%%;
 

`+`(`-`(1), `-`(r)) = `+`(`-`(`/`(`*`(`u?`(c1)), `*`(B, `*`(`u?`(c2)))))) (29)
 

> %*(-1);
 

`+`(1, r) = `/`(`*`(`u?`(c1)), `*`(B, `*`(`u?`(c2)))) (30)
 

> %*B;
 

`*`(B, `*`(`+`(1, r))) = `/`(`*`(`u?`(c1)), `*`(`u?`(c2))) (31)
 

> # we note that B=1/(1+p) so we get
 

> subs(B=1/(1+p),%);
 

>
 

(32)
 

>
 

>
 

> ################ Utility Example-2: Two Period Lagrangian  ##############
 

>
 

> restart;
 

> # The Lagrangian is given by
 

> L:=u(c1)+B*u(c2)+lambda*(w1+ w2/(1+r)-c1- c2/(1+r)) ;
 

`+`(u(c1), `*`(B, `*`(u(c2))), `*`(lambda, `*`(`+`(w1, `/`(`*`(w2), `*`(`+`(1, r))), `-`(c1), `-`(`/`(`*`(c2), `*`(`+`(1, r)))))))) (33)
 

> # where B=1/(1+p) where p is a time preference parameter and r is the interest rate
 

> ## foc_1
 

> diff(L,c1)=0;
 

`+`(diff(u(c1), c1), `-`(lambda)) = 0 (34)
 

> isolate(%, lambda );
 

lambda = diff(u(c1), c1) (35)
 

> A_:=subs(diff(u(c1),c1)=u?(c1),%);
 

lambda = `u?`(c1) (36)
 

> ## foc_2
 

> diff(L,c2)=0;
 

`+`(`*`(B, `*`(diff(u(c2), c2))), `-`(`/`(`*`(lambda), `*`(`+`(1, r))))) = 0 (37)
 

> isolate(%, lambda );
 

lambda = `*`(B, `*`(diff(u(c2), c2), `*`(`+`(1, r)))) (38)
 

> B_:=subs(diff(u(c2),c2)=u?(c2),%);
 

lambda = `*`(B, `*`(`u?`(c2), `*`(`+`(1, r)))) (39)
 

> # Combining A and B
 

>
 

> A_;
 

lambda = `u?`(c1) (40)
 

> B_;
 

lambda = `*`(B, `*`(`u?`(c2), `*`(`+`(1, r)))) (41)
 

> rhs(%%)=rhs(%);
 

`u?`(c1) = `*`(B, `*`(`u?`(c2), `*`(`+`(1, r)))) (42)
 

> # divide both sides by u?(c2)
 

> %/`u?`(c2);
 

`/`(`*`(`u?`(c1)), `*`(`u?`(c2))) = `*`(B, `*`(`+`(1, r))) (43)
 

> # we note that B=1/(1+p) so we get
 

> subs(B=1/(1+p),%);
 

`/`(`*`(`u?`(c1)), `*`(`u?`(c2))) = `/`(`*`(`+`(1, r)), `*`(`+`(1, p))) (44)
 

> # Which is the same expression we had previously
 

>
 

>
 

>
 

> ########## Utility Example-3: Four Period Lagrangian with CIES Utility  ##############
 

>
 

> restart;
 

> # The Lagrangian is given by
 

> L:=U(c1,c2,c3,c4)+lambda*(w1+ w2/(1+r)+w3/(1+r)^2+w3/(1+r)^3-c1- c2/(1+r) -c3/(1+r)^2 - c4/(1+r)^3  ) ;
 

`+`(U(c1, c2, c3, c4), `*`(lambda, `*`(`+`(w1, `/`(`*`(w2), `*`(`+`(1, r))), `/`(`*`(w3), `*`(`^`(`+`(1, r), 2))), `/`(`*`(w3), `*`(`^`(`+`(1, r), 3))), `-`(c1), `-`(`/`(`*`(c2), `*`(`+`(1, r)))), `-`... (45)
 

>
 

> ## foc_1
 

>
 

> diff(L,c1)=0;
 

`+`(diff(U(c1, c2, c3, c4), c1), `-`(lambda)) = 0 (46)
 

> isolate(%, lambda );
 

lambda = diff(U(c1, c2, c3, c4), c1) (47)
 

> subs(diff(U(c1,c2,c3,c4),c1)=U?(c1),%);
 

lambda = `U?`(c1) (48)
 

> # Our utility function is given by
 

> U(c1,c2,c3,c4)=(c1^(1-σ)-1)/(1-σ)+B^1*(c2^(1-σ)-1)/(1-σ)+B^2*(c3^(1-σ)-1)/(1-σ)+B^3*(c4^(1-σ)-1)/(1-σ);
 

U(c1, c2, c3, c4) = `+`(`/`(`*`(`+`(`^`(c1, `+`(1, `-`(`σ`))), `-`(1))), `*`(`+`(1, `-`(`σ`)))), `/`(`*`(B, `*`(`+`(`^`(c2, `+`(1, `-`(`σ`))), `-`(1)))), `*`(`+`(1, `-`(`σ`))))... (49)
 

> U?(c1)=simplify(diff(rhs(%),c1));
 

`U?`(c1) = `^`(c1, `+`(`-`(`σ`))) (50)
 

> # which gives us
 

> A_:=lambda=rhs(%);
 

lambda = `^`(c1, `+`(`-`(`σ`))) (51)
 

>
 

> ## foc_2
 

>
 

> diff(L,c2)=0;
 

`+`(diff(U(c1, c2, c3, c4), c2), `-`(`/`(`*`(lambda), `*`(`+`(1, r))))) = 0 (52)
 

> isolate(%, lambda );
 

lambda = `*`(diff(U(c1, c2, c3, c4), c2), `*`(`+`(1, r))) (53)
 

> subs(diff(U(c1,c2,c3,c4),c2)=U?(c2),%);
 

lambda = `*`(`U?`(c2), `*`(`+`(1, r))) (54)
 

> # Again our utility function is given by
 

> U(c1,c2,c3,c4)=(c1^(1-σ)-1)/(1-σ)+B^1*(c2^(1-σ)-1)/(1-σ)+B^2*(c3^(1-σ)-1)/(1-σ)+B^3*(c4^(1-σ)-1)/(1-σ);
 

U(c1, c2, c3, c4) = `+`(`/`(`*`(`+`(`^`(c1, `+`(1, `-`(`σ`))), `-`(1))), `*`(`+`(1, `-`(`σ`)))), `/`(`*`(B, `*`(`+`(`^`(c2, `+`(1, `-`(`σ`))), `-`(1)))), `*`(`+`(1, `-`(`σ`))))... (55)
 

> U?(c2):=simplify(diff(rhs(%),c2));
 

`*`(B, `*`(`^`(c2, `+`(`-`(`σ`))))) (56)
 

> # which gives us
 

> B_:=lambda=B*c2^(-sigma)*(1+r);
 

lambda = `*`(B, `*`(`^`(c2, `+`(`-`(sigma))), `*`(`+`(1, r)))) (57)
 

>
 

> # Combining foc_1 and foc_2
 

>
 

> A_;
 

lambda = `^`(c1, `+`(`-`(`σ`))) (58)
 

> B_;
 

lambda = `*`(B, `*`(`^`(c2, `+`(`-`(sigma))), `*`(`+`(1, r)))) (59)
 

> rhs(%%)=rhs(%);
 

`^`(c1, `+`(`-`(`σ`))) = `*`(B, `*`(`^`(c2, `+`(`-`(sigma))), `*`(`+`(1, r)))) (60)
 

> # divide both sides by c2^(-sigma)
 

> %/c2^(-sigma) ;
 

`/`(`*`(`^`(c1, `+`(`-`(`σ`)))), `*`(`^`(c2, `+`(`-`(sigma))))) = `*`(B, `*`(`+`(1, r))) (61)
 

> simplify(%);
 

`*`(`^`(c2, sigma), `*`(`^`(c1, `+`(`-`(`σ`))))) = `*`(B, `*`(`+`(1, r))) (62)
 

> # which can be written as
 

> (c2/c1)^sigma=rhs(%);
 

`^`(`/`(`*`(c2), `*`(c1)), sigma) = `*`(B, `*`(`+`(1, r))) (63)
 

> # raise both sides by 1/sigma
 

> lhs(%)^(1/sigma)=rhs(%)^(1/sigma);
 

`^`(`^`(`/`(`*`(c2), `*`(c1)), sigma), `/`(1, `*`(sigma))) = `^`(`*`(B, `*`(`+`(1, r))), `/`(1, `*`(sigma))) (64)
 

> simplify( lhs(%), 'symbolic' )=rhs(%);
 

`/`(`*`(c2), `*`(c1)) = `^`(`*`(B, `*`(`+`(1, r))), `/`(1, `*`(sigma))) (65)
 

> A_2:=%*c1;
 

c2 = `*`(c1, `*`(`^`(`*`(B, `*`(`+`(1, r))), `/`(1, `*`(sigma))))) (66)
 

>
 

> ## foc_3
 

>
 

> diff(L,c3)=0;
 

`+`(diff(U(c1, c2, c3, c4), c3), `-`(`/`(`*`(lambda), `*`(`^`(`+`(1, r), 2))))) = 0 (67)
 

> isolate(%, lambda );
 

lambda = `*`(diff(U(c1, c2, c3, c4), c3), `*`(`^`(`+`(1, r), 2))) (68)
 

> subs(diff(U(c1,c2,c3,c4),c3)=U?(c3),%);
 

lambda = `*`(`U?`(c3), `*`(`^`(`+`(1, r), 2))) (69)
 

> # Our utility function is given by
 

> U(c1,c2,c3,c4)=(c1^(1-σ)-1)/(1-σ)+B^1*(c2^(1-σ)-1)/(1-σ)+B^2*(c3^(1-σ)-1)/(1-σ)+B^3*(c4^(1-σ)-1)/(1-σ);
 

U(c1, c2, c3, c4) = `+`(`/`(`*`(`+`(`^`(c1, `+`(1, `-`(`σ`))), `-`(1))), `*`(`+`(1, `-`(`σ`)))), `/`(`*`(B, `*`(`+`(`^`(c2, `+`(1, `-`(`σ`))), `-`(1)))), `*`(`+`(1, `-`(`σ`))))... (70)
 

> U?(c3)=simplify(diff(rhs(%),c3));
 

`U?`(c3) = `*`(`^`(B, 2), `*`(`^`(c3, `+`(`-`(`σ`))))) (71)
 

> # which gives us
 

> C_:=lambda=rhs(%)*(1+r)^2;
 

lambda = `*`(`^`(B, 2), `*`(`^`(c3, `+`(`-`(`σ`))), `*`(`^`(`+`(1, r), 2)))) (72)
 

>
 

>
 

> # Combining foc_2 and foc_3
 

>
 

> B_;
 

lambda = `*`(B, `*`(`^`(c2, `+`(`-`(sigma))), `*`(`+`(1, r)))) (73)
 

> C_;
 

lambda = `*`(`^`(B, 2), `*`(`^`(c3, `+`(`-`(`σ`))), `*`(`^`(`+`(1, r), 2)))) (74)
 

> rhs(%%)=rhs(%);
 

`*`(B, `*`(`^`(c2, `+`(`-`(sigma))), `*`(`+`(1, r)))) = `*`(`^`(B, 2), `*`(`^`(c3, `+`(`-`(`σ`))), `*`(`^`(`+`(1, r), 2)))) (75)
 

> %/(B*(1+r));
 

`^`(c2, `+`(`-`(sigma))) = `*`(B, `*`(`+`(1, r), `*`(`^`(c3, `+`(`-`(`σ`)))))) (76)
 

> # divide both sides by c3^(-sigma)
 

> lhs(%)/c3^(-sigma)=rhs(%)/c3^(-sigma) ;
 

`/`(`*`(`^`(c2, `+`(`-`(sigma)))), `*`(`^`(c3, `+`(`-`(sigma))))) = `/`(`*`(B, `*`(`+`(1, r), `*`(`^`(c3, `+`(`-`(`σ`)))))), `*`(`^`(c3, `+`(`-`(sigma))))) (77)
 

> simplify(%);
 

`*`(`^`(c2, `+`(`-`(sigma))), `*`(`^`(c3, sigma))) = `*`(B, `*`(`+`(1, r), `*`(`^`(c3, `+`(`-`(`σ`), sigma))))) (78)
 

> # which can be written as
 

> (c3/c2)^sigma=B*(1+r);
 

`^`(`/`(`*`(c3), `*`(c2)), sigma) = `*`(B, `*`(`+`(1, r))) (79)
 

> # raise both sides by 1/theta
 

> lhs(%)^(1/sigma)=rhs(%)^(1/sigma);
 

`^`(`^`(`/`(`*`(c3), `*`(c2)), sigma), `/`(1, `*`(sigma))) = `^`(`*`(B, `*`(`+`(1, r))), `/`(1, `*`(sigma))) (80)
 

> simplify( lhs(%), 'symbolic' )=rhs(%);
 

`/`(`*`(c3), `*`(c2)) = `^`(`*`(B, `*`(`+`(1, r))), `/`(1, `*`(sigma))) (81)
 

> A_3:=%*c2;
 

c3 = `*`(c2, `*`(`^`(`*`(B, `*`(`+`(1, r))), `/`(1, `*`(sigma))))) (82)
 

>
 

> ## foc_4
 

>
 

> diff(L,c4)=0;
 

`+`(diff(U(c1, c2, c3, c4), c4), `-`(`/`(`*`(lambda), `*`(`^`(`+`(1, r), 3))))) = 0 (83)
 

> isolate(%, lambda );
 

lambda = `*`(diff(U(c1, c2, c3, c4), c4), `*`(`^`(`+`(1, r), 3))) (84)
 

> subs(diff(U(c1,c2,c3,c4),c4)=U?(c4),%);
 

lambda = `*`(`U?`(c4), `*`(`^`(`+`(1, r), 3))) (85)
 

> # Our utility function is given by
 

> U(c1,c2,c3,c4)=(c1^(1-σ)-1)/(1-σ)+B^1*(c2^(1-σ)-1)/(1-σ)+B^2*(c3^(1-σ)-1)/(1-σ)+B^3*(c4^(1-σ)-1)/(1-σ);
 

U(c1, c2, c3, c4) = `+`(`/`(`*`(`+`(`^`(c1, `+`(1, `-`(`σ`))), `-`(1))), `*`(`+`(1, `-`(`σ`)))), `/`(`*`(B, `*`(`+`(`^`(c2, `+`(1, `-`(`σ`))), `-`(1)))), `*`(`+`(1, `-`(`σ`))))... (86)
 

> U?(c3)=simplify(diff(rhs(%),c4));
 

`U?`(c3) = `*`(`^`(B, 3), `*`(`^`(c4, `+`(`-`(`σ`))))) (87)
 

> # which gives us
 

> D_:=lambda=rhs(%)*(1+r)^3;
 

lambda = `*`(`^`(B, 3), `*`(`^`(c4, `+`(`-`(`σ`))), `*`(`^`(`+`(1, r), 3)))) (88)
 

>
 

> # Combining foc_3 and foc_4
 

>
 

> C_;
 

lambda = `*`(`^`(B, 2), `*`(`^`(c3, `+`(`-`(`σ`))), `*`(`^`(`+`(1, r), 2)))) (89)
 

> D_;
 

lambda = `*`(`^`(B, 3), `*`(`^`(c4, `+`(`-`(`σ`))), `*`(`^`(`+`(1, r), 3)))) (90)
 

> rhs(%%)=rhs(%);
 

`*`(`^`(B, 2), `*`(`^`(c3, `+`(`-`(`σ`))), `*`(`^`(`+`(1, r), 2)))) = `*`(`^`(B, 3), `*`(`^`(c4, `+`(`-`(`σ`))), `*`(`^`(`+`(1, r), 3)))) (91)
 

> %/(B^2*(1+r)^2);
 

`^`(c3, `+`(`-`(`σ`))) = `*`(B, `*`(`+`(1, r), `*`(`^`(c4, `+`(`-`(`σ`)))))) (92)
 

> # divide both sides by c4^(-sigma)
 

> lhs(%)/c4^(-sigma)=rhs(%)/c4^(-sigma) ;
 

`/`(`*`(`^`(c3, `+`(`-`(`σ`)))), `*`(`^`(c4, `+`(`-`(sigma))))) = `/`(`*`(B, `*`(`+`(1, r), `*`(`^`(c4, `+`(`-`(`σ`)))))), `*`(`^`(c4, `+`(`-`(sigma))))) (93)
 

> simplify(%);
 

`*`(`^`(c3, `+`(`-`(`σ`))), `*`(`^`(c4, sigma))) = `*`(B, `*`(`+`(1, r), `*`(`^`(c4, `+`(`-`(`σ`), sigma))))) (94)
 

> # which can be written as
 

> (c4/c3)^sigma=B*(1+r);
 

`^`(`/`(`*`(c4), `*`(c3)), sigma) = `*`(B, `*`(`+`(1, r))) (95)
 

> # raise both sides by 1/theta
 

> lhs(%)^(1/sigma)=rhs(%)^(1/sigma);
 

`^`(`^`(`/`(`*`(c4), `*`(c3)), sigma), `/`(1, `*`(sigma))) = `^`(`*`(B, `*`(`+`(1, r))), `/`(1, `*`(sigma))) (96)
 

> simplify( lhs(%), 'symbolic' )=rhs(%);
 

`/`(`*`(c4), `*`(c3)) = `^`(`*`(B, `*`(`+`(1, r))), `/`(1, `*`(sigma))) (97)
 

> A_4:=%*c3;
 

c4 = `*`(c3, `*`(`^`(`*`(B, `*`(`+`(1, r))), `/`(1, `*`(sigma))))) (98)
 

>
 

> # Summary Consumption Period 1-4
 

>
 

> # we assume that the first period consumption is given by
 

> c1:=100;
 

100 (99)
 

> A_2;
 

c2 = `+`(`*`(100, `*`(`^`(`*`(B, `*`(`+`(1, r))), `/`(1, `*`(sigma)))))) (100)
 

> A_3;
 

c3 = `*`(c2, `*`(`^`(`*`(B, `*`(`+`(1, r))), `/`(1, `*`(sigma))))) (101)
 

> A_4;
 

c4 = `*`(c3, `*`(`^`(`*`(B, `*`(`+`(1, r))), `/`(1, `*`(sigma))))) (102)
 

>
 

>
 

> ################ Utility Example-4: General Decay Consumption  ##############
 

>
 

> restart;
 

>
 

> # Our general equation looks like
 

> c_(t+1)=c_(t)*(B(1+r))^(1/sigma);
 

c_(`+`(t, 1)) = `*`(c_(t), `*`(`^`(B(`+`(1, r)), `/`(1, `*`(sigma))))) (103)
 

> # we assume the following parameter values
 

> subs({B=0.85,sigma=2, r=0.4},%);
 

c_(`+`(t, 1)) = `*`(c_(t), `*`(`^`((.85)(1.4), `/`(1, 2)))) (104)
 

> simplify(%);
 

c_(`+`(t, 1)) = `+`(`*`(.9219544457, `*`(c_(t)))) (105)
 

> ########### Stability and Fixed point
 

> # Since the slope is +0.9 we will have a stable equilibrium
 

> %-c_(t);
 

`+`(c_(`+`(t, 1)), `-`(c_(t))) = `+`(`-`(`*`(0.780455543e-1, `*`(c_(t))))) (106)
 

> # fixed point c_(t+1)-c_(t)=0
 

> subs(c_(t+1)-c_(t)=0,%);
 

0 = `+`(`-`(`*`(0.780455543e-1, `*`(c_(t))))) (107)
 

> solve(%,c_(t));
 

0. (108)
 

> # This means that our fixed point is 0
 

> ##########################################
 

>
 

>
 

> Digits := 6:
 

>
 

> # We now assume that the starting value of c(t) is 100
 

> c(1)=100;
 

c(1) = 100 (109)
 

> # c(2) is therefore given by
 

> c(2)=0.92*rhs(%);
 

c(2) = 92.00 (110)
 

> # c(3) is therefore given by
 

> c(3)=0.92*rhs(%);
 

c(3) = 84.6400 (111)
 

> # c(4) is therefore given by
 

> c(4)=0.92*rhs(%);
 

c(4) = 77.8688 (112)
 

> # c(5) is therefore given by
 

> c(5)=0.92*rhs(%);
 

c(5) = 71.6393 (113)
 

>
 

> # We can solve the above recursive equation much  
 

> # easier by using the below procedure
 

>
 

> c[1]:=100:
 

> for n from 2 to 120 do c[n] := 0.92*c[n-1]   end do:
 

> C:=[seq(c[i],i=1..120)];
 

[100, 92.00, 84.6400, 77.8688, 71.6393, 65.9082, 60.6355, 55.7847, 51.3219, 47.2161, 43.4388, 39.9637, 36.7666, 33.8253, 31.1193, 28.6298, 26.3394, 24.2322, 22.2936, 20.5101, 18.8693, 17.3598, 15.9710...
[100, 92.00, 84.6400, 77.8688, 71.6393, 65.9082, 60.6355, 55.7847, 51.3219, 47.2161, 43.4388, 39.9637, 36.7666, 33.8253, 31.1193, 28.6298, 26.3394, 24.2322, 22.2936, 20.5101, 18.8693, 17.3598, 15.9710...
[100, 92.00, 84.6400, 77.8688, 71.6393, 65.9082, 60.6355, 55.7847, 51.3219, 47.2161, 43.4388, 39.9637, 36.7666, 33.8253, 31.1193, 28.6298, 26.3394, 24.2322, 22.2936, 20.5101, 18.8693, 17.3598, 15.9710...
[100, 92.00, 84.6400, 77.8688, 71.6393, 65.9082, 60.6355, 55.7847, 51.3219, 47.2161, 43.4388, 39.9637, 36.7666, 33.8253, 31.1193, 28.6298, 26.3394, 24.2322, 22.2936, 20.5101, 18.8693, 17.3598, 15.9710...
[100, 92.00, 84.6400, 77.8688, 71.6393, 65.9082, 60.6355, 55.7847, 51.3219, 47.2161, 43.4388, 39.9637, 36.7666, 33.8253, 31.1193, 28.6298, 26.3394, 24.2322, 22.2936, 20.5101, 18.8693, 17.3598, 15.9710...
[100, 92.00, 84.6400, 77.8688, 71.6393, 65.9082, 60.6355, 55.7847, 51.3219, 47.2161, 43.4388, 39.9637, 36.7666, 33.8253, 31.1193, 28.6298, 26.3394, 24.2322, 22.2936, 20.5101, 18.8693, 17.3598, 15.9710...
[100, 92.00, 84.6400, 77.8688, 71.6393, 65.9082, 60.6355, 55.7847, 51.3219, 47.2161, 43.4388, 39.9637, 36.7666, 33.8253, 31.1193, 28.6298, 26.3394, 24.2322, 22.2936, 20.5101, 18.8693, 17.3598, 15.9710...
[100, 92.00, 84.6400, 77.8688, 71.6393, 65.9082, 60.6355, 55.7847, 51.3219, 47.2161, 43.4388, 39.9637, 36.7666, 33.8253, 31.1193, 28.6298, 26.3394, 24.2322, 22.2936, 20.5101, 18.8693, 17.3598, 15.9710...
[100, 92.00, 84.6400, 77.8688, 71.6393, 65.9082, 60.6355, 55.7847, 51.3219, 47.2161, 43.4388, 39.9637, 36.7666, 33.8253, 31.1193, 28.6298, 26.3394, 24.2322, 22.2936, 20.5101, 18.8693, 17.3598, 15.9710...
[100, 92.00, 84.6400, 77.8688, 71.6393, 65.9082, 60.6355, 55.7847, 51.3219, 47.2161, 43.4388, 39.9637, 36.7666, 33.8253, 31.1193, 28.6298, 26.3394, 24.2322, 22.2936, 20.5101, 18.8693, 17.3598, 15.9710...
[100, 92.00, 84.6400, 77.8688, 71.6393, 65.9082, 60.6355, 55.7847, 51.3219, 47.2161, 43.4388, 39.9637, 36.7666, 33.8253, 31.1193, 28.6298, 26.3394, 24.2322, 22.2936, 20.5101, 18.8693, 17.3598, 15.9710...
[100, 92.00, 84.6400, 77.8688, 71.6393, 65.9082, 60.6355, 55.7847, 51.3219, 47.2161, 43.4388, 39.9637, 36.7666, 33.8253, 31.1193, 28.6298, 26.3394, 24.2322, 22.2936, 20.5101, 18.8693, 17.3598, 15.9710...
(114)
 

> with(Statistics):
 

> PointPlot(C, color = black, thickness = 3, symbol = soliddiamond, symbolsize = 20,labels=[t, c], view=[0..120, 0..100]);
 

Plot_2d
 

> # We can see that over time c is approach the fixed point 0
 

 

Legal Notice: The copyright for this application is owned by the authors. Neither Maplesoft nor the authors are responsible for any errors contained within and are not liable for any damages resulting from the use of this material.. This application is intended for non-commercial, non-profit use only. Contact the authors for permission if you wish to use this application in for-profit activities.