DIY Macroeconomic Model Simulation (using Mathematica)

https://macrosimulation.org/how_to_use
Monetary Economics (Wynne Godley, et al) SIM model:
Using Recurrence functions
C
s
=
C
d
⇒C
​
G
s
=
G
d
⇒G
​
T
s
=
T
d
⇒T
​
N
s
=
N
d
⇒N
​
YD =
W*
N
s
-
T
s
⇒YD = WN - T
​
T
d
= θ W
N
s
⇒ T = θ W N
​
C
d
=
α
1
YD +
α
2
H
h-1
⇒ C =
α
1
YD +
α
2
H
h-1
​
​
ΔH
s
=
H
s
-
H
s-1
=
G
d
-
T
d
⇒ Δ
H
s
= G - T
​
ΔH
h
=
H
h
-
H
h-1
= YD -
C
d
⇒ Δ
H
h
= YD - C
Y =
C
s
+
G
s
, and Y = W
N
d
, ⇒
N
d
= Y÷W ⇒ N = Y ÷ W ⇒ W = Y ÷ N
In[]:=
Manipulate[​​Module[{params,sim},​​ClearAll[y,yd,td,
c
s
,
c
d
,
g
s
,
g
d,
h
s
,
h
d
,
Δh
s
,
Δh
h
,c1,c2];​​params={
g
s
->g,θ->taxRate,c1->consumeRate,c2->overspend};​​​​sim=RecurrenceTable[​​{​​y[t]==
c
s
[t]+
g
s
[t],​​
Δh
s
[t]==
h
s
[t]-
h
s
[t-1],​​
Δh
h
[t]==
h
h
[t]-
h
h
[t-1],​​
c
s
[t]==
c
d
[t],​​
g
s
[t]==
g
d
[t],​​
c
d
[t]==c1yd[t]+c2
h
h
[t-1],​​td[t]==θy[t-1],​​yd[t]==y[t]-θy[t-1],​​y[0]==0,
c
s
[0]==0,​​yd[0]==0,
h
h
[0]==0,​​
h
s
[0]==0,td[0]==0​​}/.params,​​{y,yd,td,
c
d
,
h
d
},​​{t,1,50}​​];​​ListLinePlot[sim//Transpose,AxesLabel->{"Time","Value"},PlotLegends->{"y","yd","td","c","h"}]],​​{{g,20,"gov"},1,30},{{taxRate,.2},0.1,1.0,.1},{{consumeRate,.6},0.1,1.0,.1},{{overspend,.4},0.1,1.0,.1}]​​
Syntax
:"d, is incomplete; more input is needed.