How to Plot Ramsey Phase Plane

11 ビュー (過去 30 日間)
econogist
econogist 2022 年 5 月 18 日
コメント済み: econogist 2022 年 5 月 18 日
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 件のコメント
Mathieu NOE
Mathieu NOE 2022 年 5 月 18 日
see what you get with
quiver(k,c,kdot,cdot,0)
does it makes sense ?
econogist
econogist 2022 年 5 月 18 日
Attached is what it spits out. It doesn't make sense. Just a blank plot.

サインインしてコメントする。

採用された回答

David Goodmanson
David Goodmanson 2022 年 5 月 18 日
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 件のコメント
econogist
econogist 2022 年 5 月 18 日
Ah, thank you!!! I should have caught that.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeVector Fields についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by