This repository provides a lightweight, interactive Julia implementation of Richard M. Goodwin’s “growth cycle” model (1967): a two-dimensional predator–prey dynamic system in which the employment rate (𝑣) and the wage-share (𝑢) orbit an interior steady state, generating endogenous cycles without exogenous shocks. The formulation adapts the Lotka–Volterra mechanics from biology —originally developed by Lotka (1925) and Volterra (1928)—to macroeconomics, assuming that wage dynamics respond to labor-market tightness while capital accumulation and GDP growth are profit-led.
- Backend: Julia HTTP server with JSON API
- Frontend: Static HTML with Plotly.js
- Solver: Custom Runge-Kutta 4th order integrator
- Memory footprint: ~50-100 MB (vs 500-700 MB with full stack)
- Parameter adjustment: Real-time through sliders
- Plots: Time series and phase diagram
- Additional output: Equilibrium point calculation for main endogenous variables
Try it now: https://goodwin-growth-cycle.onrender.com
Note: First load may take 30-60 seconds as the free-tier server wakes up from sleep mode.
The animation shows:
- Initial state - Default parameters loaded
- First simulation - Running with default parameters (σ=4.0, α=β=0.02, γ=0.03, ρ=0.07)
- Parameter adjustment - Changing σ to 4.5 and v₀ to 0.80 using interactive sliders
- Second simulation - Observing how different parameters affect the cycle dynamics
The Goodwin model describes economic cycles through a predator-prey system:
dv/dt = v * [(1/σ - (α + β)) - u/σ]
du/dt = u * [ρ*v - (α + γ)]
Where:
- v = employment rate
- u = workers' share of output
- σ = capital-output ratio
- α = labor productivity growth rate
- β = labor force growth rate
- γ = constant in wage adjustment function
- ρ = sensitivity of wages to employment level
- σ (0.5-2.0): Capital-output ratio
- α (0.001-0.1): Labor productivity growth rate
- β (0.001-0.1): Labor force growth rate
- γ (0.001-0.1): Wage adjustment constant
- ρ (0.001-0.2): Wage sensitivity to employment
Prerequisites:
- Install Julia 1.10 or newer from julialang.org/downloads
Steps:
-
Download the code from GitHub (green "Code" button → Download ZIP, then extract)
-
Open terminal/command prompt and navigate to the project folder (where you unzip the repo):
cd path/to/GoodwinAppExample (Windows):
cd C:\Users\YourName\Downloads\GoodwinAppExample (Mac/Linux):
cd ~/Downloads/GoodwinApp -
Install required Julia packages (only needed first time):
julia -e "using Pkg; Pkg.add([\"HTTP\", \"JSON3\"])"This will download and install the necessary packages (~2-3 minutes).
-
Start the server:
julia server.jl
You should see:
🚀 Starting Goodwin Model Server... 🌐 Server listening on: http://0.0.0.0:7860 ✅ Access in browser: http://localhost:7860 -
Open your browser and go to:
http://localhost:7860Note: The server binds to
0.0.0.0but you must access it vialocalhostin your browser. -
Stop the server when done: Press
Ctrl+Cin the terminal
Prerequisites:
- Install Docker Desktop from docker.com
Steps:
-
Download the code (same as Option 1)
-
Open terminal/command prompt and navigate to the project folder:
cd path/to/GoodwinApp -
Build the Docker image (only needed first time or after updates):
docker build -t goodwin-app .This will take ~2-3 minutes to build.
-
Run the container:
docker run -p 7860:7860 goodwin-app
You should see the server starting message.
-
Open your browser and go to:
http://localhost:7860 -
Stop the container: Press
Ctrl+Cin the terminal
Troubleshooting:
- If port 7860 is already in use, try:
docker run -p 8080:7860 goodwin-appand openhttp://localhost:8080 - Make sure Docker Desktop is running before executing docker commands
Goodwin, R. M. (1967). "A Growth Cycle". In C. H. Feinstein (Ed.), Socialism, Capitalism and Economic Growth. Cambridge University Press.
MIT License
Demian Panigo (UNLP) - Educational use in macroeconomics courses
