# How to Plot Ramsey Phase Plane

5 views (last 30 days)
econogist on 18 May 2022
Commented: econogist on 18 May 2022
I am trying to plot the phase plane from the famous Ramsey macroeconomic model with Matlab's quiver. The system of equations are and . Most plots of the function look like the attachment. But what I want is to plot a bunch of arrows as is typically seen when you just google images of phase planes. This seems like it should be simple enough, but I'm stuck. How do I do this? What am I missing? Below is what I've done so far.
clc
clear all
alpha=0.5;
rho=0.8;
delta=0.3;
n=1;
g=1;
theta=1;
[k, c] = meshgrid(0:1:30, 0:1:30);
kdot = k.^alpha-c-(n+g+delta).*k;
cdot = (1/theta).*(alpha.*(k^(alpha-1))-delta-rho-theta.*g).*c;
quiver(k,c, kdot, cdot, 1), axis tight
xlabel 'x', ylabel 'y'
title 'Ramsey Model'
##### 2 CommentsShowHide 1 older comment
econogist on 18 May 2022
Attached is what it spits out. It doesn't make sense. Just a blank plot.

David Goodmanson on 18 May 2022
HI ec,
There are a couple of issues here. First, the cdot expression lacks a dot, should be
k.^(alpha-1).
Second, the grid for k begins at zero, so
0^(alpha-1) = inf
which you don't want. Then you have to adjust the grid to find the fixed point for the given parameters. In the code below, quiver also multiplies the arrows by 3 to make them more visible.
clc
clear all
alpha=0.5;
rho=0.8;
delta=0.3;
n=1;
g=1;
theta=1;
[k, c] = meshgrid(.01:.01:.15, .01:.01:.25);
kdot = k.^alpha-c-(n+g+delta)*k;
cdot = (1/theta)*(alpha*(k.^(alpha-1))-delta-rho-theta*g).*c;
quiver(k,c, kdot, cdot,3), axis tight
xlabel 'x', ylabel 'y'
title 'Ramsey Model'
##### 1 CommentShowHide None
econogist on 18 May 2022
Ah, thank you!!! I should have caught that.