How to Plot Ramsey Phase Plane

12 Ansichten (letzte 30 Tage)
econogist
econogist am 18 Mai 2022
Kommentiert: econogist am 18 Mai 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 Kommentare
Mathieu NOE
Mathieu NOE am 18 Mai 2022
see what you get with
quiver(k,c,kdot,cdot,0)
does it makes sense ?
econogist
econogist am 18 Mai 2022
Attached is what it spits out. It doesn't make sense. Just a blank plot.

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

David Goodmanson
David Goodmanson am 18 Mai 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 Kommentar
econogist
econogist am 18 Mai 2022
Ah, thank you!!! I should have caught that.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Vector Fields finden Sie in Help Center und File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by