cobweb graph for 3 equations

5 ビュー (過去 30 日間)
summyia qamar
summyia qamar 2018 年 1 月 6 日
コメント済み: Star Strider 2018 年 1 月 7 日
can I draw the cobweb graph of following Q and D and P?
clear all;
clc;
N=60;
D=zeros(1,N); %demand
Q=zeros(1,N); %supply
P=zeros(1,N); %Price
d=1000; %constant of demand function
q=100; %constant of supply function
a=10; % sensitivity of demand to price
b=9.9; %sensitivity of supply to price
for t=2:N
P(t)=(P(t-1)-((d-q)/(a+b)))*((-b/a)^t)+((d-q)/(a+b));
D(t)=d-a*P(t);
Q(t)=q+b*P(t-1);
end
%plot
Xvals=1:N;
plot(Xvals,P,'b',Xvals,D,'r',Xvals,Q,'g')
xlabel('time')
legend('Price','Demand','Resource')
title('Demand-Supply Dynamics with Price')

回答 (1 件)

Star Strider
Star Strider 2018 年 1 月 6 日
編集済み: Star Strider 2018 年 1 月 6 日
I have no idea. Before your post, I never heard of a cobweb plot.
If you want some example code for a cobweb plot, Getting Started With MATLAB (link) has it on pages 4-5.
That’s the best I can do.
  2 件のコメント
summyia qamar
summyia qamar 2018 年 1 月 7 日
thankyou for the guidance
Star Strider
Star Strider 2018 年 1 月 7 日
As always, my pleasure.

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

カテゴリ

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

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by