Created
August 10, 2019 06:43
Jackson
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%パラメタ設定 | |
N = 3; | |
P = [0 0 1; 0 0 0.6; 0.5 0 0] | |
lambda = [2; 1; 0] | |
mu = [5; 4; 6] | |
%[p^t-E]α = -λ | |
A = P.' - eye(N) | |
alpha = linsolve(A, -lambda) | |
rho = alpha ./ mu | |
%平均系内人数 | |
L = rho ./ (1 - rho) | |
fplot(@(x) x/(1-x), [0 0.97]) | |
%人数分布 | |
n = [6, 1, 2] | |
%nとした場合の定常分布(周辺)を求める | |
for i = 1:N | |
i | |
rho(i) | |
n(i) | |
pi(i) = (1-rho(i))*rho(i)^n(i); | |
end | |
pi | |
%rho(i)を使い、人数を変化させた時の定常分布のグラフ | |
figure | |
hold on | |
for i = 1:N | |
fplot(@(x) (1-rho(i))*rho(i)^x, [0 30]) | |
end | |
legend | |
hold off | |
%Jackson定常分布 | |
jpi = 1; | |
for i = 1:N | |
jpi = jpi * pi(i); | |
end | |
jpi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment