How to Plot Ramsey Phase Plane

7 vues (au cours des 30 derniers jours)
econogist
econogist le 18 Mai 2022
Commenté : econogist le 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 commentaires
Mathieu NOE
Mathieu NOE le 18 Mai 2022
see what you get with
quiver(k,c,kdot,cdot,0)
does it makes sense ?
econogist
econogist le 18 Mai 2022
Attached is what it spits out. It doesn't make sense. Just a blank plot.

Connectez-vous pour commenter.

Réponse acceptée

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

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Vector Fields dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by