Mathematica 9 is now available
Student Support Forum
-----
Student Support Forum: 'Problem with code for List' topicStudent Support Forum > General > "Problem with code for List"

Next Comment >Help | Reply To Topic
Author Comment/Response
May
12/19/12 8:05pm

Hello,

I'm new to Mathematica and am trying to plot a time path for output in the Solow model with exogenous technology and population, given a list of K values over 1000 periods.

What I have so far is as follows (which was given to me):

L[n_, L0_] := L0 f[n]
A[n_, A0_] := A0 g[n]
Fd[K_, L_, a_, A_] := A K^a L^(1 - a)

Klist[n_, K0_, a_, s_, \[Gamma]_, L0_, A0_] :=
For[i = 0; K = K0, i < n + 1, i++,
K = (1 - \[Gamma]) K + s Fd[K, L[i, L0], a, A[i, A0]]; L1[i] = K]

f[n_] := 1
g[n_] := 1

Klist[1000, 5, 0.5, 0.05, 0.01, 5, 2]; List1 =
Table[L1[j], {j, 1, 1000}];

ListPlot[List1, Joined -> True, Frame -> True,
PlotLabel -> "Discrete Solow model over 1000 periods"]

And what I've tried to do to get a time path of output is:

Fdlist[n_, a_, A_, K_, L_] :=
For[i = 0, i < n + 1, i++, Fd = A K^a L^(1 - a)]

ListPlot[{Fdlist}, Joined -> True, Frame -> True,
PlotLabel -> "Test"]

But the graph that comes out is empty, which means that I haven't really produced a list of output values over the 1000 periods. Can someone please tell me how I should write a code that gives me a list of output values over 1000 periods, given Klist and that labour and technology is exogeneous (and constant)?

Thanks.

URL: ,

Subject (listing for 'Problem with code for List')
Author Date Posted
Problem with code for List May 12/19/12 8:05pm
Re: Problem with code for List Bill Simpson 12/20/12 10:02pm
Next Comment >Help | Reply To Topic