time=[0:0.01:20]; %suppose in days
k = 20;
ke = 0.8; % average degree of educated individuals (using social media to communication)
% suppose it's number of people may see the rumor through social media in a day
ku = 0.7; % average degree of uneducated individuals (person-to-person communication
% suppose it's number of people may hear the rumor through direct communication
lambda = 0.6; %probability of people in educated group disseminates rumor and change into spreader
%probability of people in uneducated group disseminates rumor and change into spreader
%probability of people in educated group that may doubt the creadibility of rumor
gamma = 0.1; %probability of people in uneducated group that may doubt the creadibility of rumor
%probability of people in educated group that change into stifler when contact a stifler
eta = 0.5; %probability of people in educated group that change into stifler when contact a stifler
delta = 0.9; %probability of people that lose interest or forget about rumor
beita = 0.3;
beita2 = 0.1;
N = 37289406; %Sudan population: http://en.wikipedia.org/wiki/List_of_countries_by_population
pe = 0.21; %Sudan Internet users:http://en.wikipedia.org/wiki/List_of_countries_by_number_of_Internet_users
pu = 0.79;
YInit=[(pe*N-1)/N (pu*N-1)/N 0 1/N 0];
options=[ ];
[t,PredY]=ode45(@SEIRR, time,YInit, options,k,ke, ku, lambda, delta , gamma, eta,beita,beita2);
%digits(15)
%vpa(N*PredY)
PredIr = PredY(:,1);
PredIs = PredY(:,2);
PredE = PredY(:,3);
%PredSu = PredY(:,4);
PredS = PredY(:,4);
PredR = PredY(:,5);
figure;
plot(t, PredIr, t, PredIs, t,PredE,t,PredS,t,PredR)
%plot(t, PredIe, t, PredIu)
%plot(t,PredSe, t, PredSu)
%plot(t, PredR)
ylabel('Probability')
xlabel('Time')
legend('Ir ', 'Is' , 'E', 'S ','R')
%legend('Educated Ignorant ', 'Uneducated Ignorant')
%legend('Educated Spreaders ', 'Uneducated Spreaders ')
%legend('Stiflers')
title('SEIR model')
axis([0 20 -0.15 1.15])
%changing delta 相关性
%{
delta1 = 0.02;
delta2 = 0.08;
delta3 = 0.15;
delta4 = 0.45;
delta5 = 0.80;
[t,PredY1]=ode45(@SEIRR, time,YInit, options, k,ke, ku, lambda, delta1, gamma, eta,beita,beita2);
[t,PredY2]=ode45(@SEIRR, time,YInit, options, k,ke, ku, lambda, delta2, gamma, eta,beita,beita2);
[t,PredY3]=ode45(@SEIRR, time,YInit, options, k,ke, ku, lambda, delta3, gamma, eta,beita,beita2);
[t,PredY4]=ode45(@SEIRR, time,YInit, options, k,ke, ku, lambda, delta4, gamma, eta,beita,beita2);
[t,PredY5]=ode45(@SEIRR, time,YInit, options, k,ke, ku, lambda, delta5, gamma, eta,beita,beita2);
PredIr1 = PredY1(:,1); PredIs1 = PredY1(:,2); PredE1 = PredY1(:,3); PredS1 = PredY1(:,4); PredR1 = PredY1(:,5);
PredIr2 = PredY2(:,1); PredIs2 = PredY2(:,2); PredE2 = PredY2(:,3); PredS2 = PredY2(:,4); PredR2 = PredY2(:,5);
PredIr3 = PredY3(:,1); PredIs3 = PredY3(:,2); PredE3 = PredY3(:,3); PredS3 = PredY3(:,4); PredR3 = PredY3(:,5);
PredIr4 = PredY4(:,1); PredIs4 = PredY4(:,2); PredE4 = PredY4(:,3); PredS4 = PredY4(:,4); PredR4 = PredY4(:,5);
PredIr5 = PredY5(:,1); PredIs5 = PredY5(:,2); PredE5 = PredY5(:,3); PredS5 = PredY5(:,4); PredR5 = PredY5(:,5);
figure;
plot(t, PredIr1, t, PredIr2, t, PredIr3, t, PredIr4, t, PredIr5)
ylabel('Probability')
xlabel('Time')
legend('\mu = 0.02', '\mu = 0.08', '\mu = 0.15', '\mu = 0.45', '\mu = 0.80')
title('Ir - Changing \mu')
axis([0 20 0 0.25])
figure;
plot(t, PredIs1, t, PredIs2, t, PredIs3, t, PredIs4, t, PredIs5)
ylabel('Probability')
xlabel('Time')
legend('\mu = 0.02', '\mu = 0.08', '\mu = 0.15', '\mu = 0.45', '\mu = 0.80')
title('Is - \mu')
axis([0 20 -0.15 1])
figure;
plot(t, PredE1, t, PredE2, t, PredE3, t, PredE4, t, PredE5)
ylabel('Probability')
xlabel('Time')
legend('\mu = 0.02', '\mu = 0.08', '\mu = 0.15', '\mu = 0.45', '\mu = 0.80')
title('e - \mu')
axis([0 20 -0.01 0.9])
figure;
plot(t, PredS1, t, PredS2, t, PredS3, t, PredS4, t, PredS5)
ylabel('Probability')
xlabel('Time')
legend('\mu = 0.02', '\mu = 0.08', '\mu = 0.15', '\mu = 0.45', '\mu = 0.80')
title('S - \mu')
axis([0 20 -0.01 1])
figure;
plot(t, PredR1, t, PredR2, t, PredR3, t, PredR4, t, PredR5)
ylabel('Probability')
xlabel('Time')
legend('\mu = 0.02', '\mu = 0.08', '\mu = 0.15', '\mu = 0.45', '\mu = 0.80')
title('R - \mu')
axis([0 20 -0.05 1])
%{
figure;
plot(t, PredR1, t, PredR2, t, PredR3, t, PredR4, t, PredR5)
ylabel('Probability')
xlabel('Time')
legend('\delta = 0.02', '\delta = 0.08', '\delta = 0.15', '\delta = 0.45', '\delta = 0.80')
title('Stiflers - Changing probability of people that lose interest or forget about rumor')
axis([0 10 -0.15 1.15])
%}
%}
lamda1 = 0.1;
lamda2 = 0.5;
lamda3 = 0.7;
[t,PredY1]=ode45(@SEIRR, time,YInit, options, k,ke, ku, lamda1, delta, gamma, eta,beita,beita2);
[t,PredY2]=ode45(@SEIRR, time,YInit, options, k,ke, ku, lamda2, delta, gamma, eta,beita,beita2);
[t,PredY3]=ode45(@SEIRR, time,YInit, options, k,ke, ku, lamda3, delta, gamma, eta,beita,beita2);
PredIr1 = PredY1(:,1); PredIs1 = PredY1(:,2); PredE1 = PredY1(:,3); PredS1 = PredY1(:,4); PredR1 = PredY1(:,5);
PredIr2 = PredY2(:,1); PredIs2 = PredY2(:,2); PredE2 = PredY2(:,3); PredS2 = PredY2(:,4); PredR2 = PredY2(:,5);
PredIr3 = PredY3(:,1); PredIs3 = PredY3(:,2); PredE3 = PredY3(:,3); PredS3 = PredY3(:,4); PredR3 = PredY3(:,5);
figure;
plot(t, PredIr1, t, PredIr2, t, PredIr3)
ylabel('Probability')
xlabel('Time')
legend('\lambda = 0.1', '\lambda = 0.5', '\lambda = 0.7')
title('Ir - Changing \lambda')
axis([0 20 0 0.25])
figure;
plot(t, PredIs1, t, PredIs2, t, PredIs3)
ylabel('Probability')
xlabel('Time')
legend('\lambda = 0.1', '\lambda = 0.5', '\lambda = 0.7')
title('Is - \lambda')
axis([0 20 -0.15 1])
figure;
plot(t, PredE1, t, PredE2, t, PredE3)
ylabel('Probability')
xlabel('Time')
legend('\lambda = 0.1', '\lambda = 0.5', '\lambda = 0.7')
title('e - \lambda')
axis([0 20 -0.01 0.9])
figure;
plot(t, PredS1, t, PredS2, t, PredS3)
ylabel('Probability')
xlabel('Time')
legend('\lambda = 0.1', '\lambda = 0.5', '\lambda = 0.7')
title('S - \lambda')
axis([0 20 -0.01 1])
figure;
plot(t, PredR1, t, PredR2, t, PredR3)
ylabel('Probability')
xlabel('Time')
legend('\lambda = 0.1', '\lambda = 0.5', '\lambda = 0.7')
title('R - \lambda')
axis([0 20 -0.05 1])
评论1