Why am I getting a blank graph
Show older comments
I have the comands below and am getting a blank graph, can someone help me please.
function SISeTR(~)
clear all
clc
set(0,'defaultaxesfontsize',30,'defaulttextinterpreter','latex');
Lambda = 0.4;
sigma = 0.7;
kappa = 0.02;
theta = 0.2;
Omega = 0.5;
tau = 0.2;
lambda = 0.1;
omega =0.01;
eta = 0.02;
mu = 0.025;
pi = 0.02;
delta = 0.035;
S0 = 999;
I0 = 1;
Se0 = 0;
T0 = 0;
R0 = 0;
x0 = [S0 I0 Se0 T0 R0];
Timepsan = [0 300];
[t,x] = ode45(@SISeTR,Timepsan,x0);
S = x(:,1);
I = x(:,2);
Se = x(:,3);
T = x(:,4);
R = x(:,5);
N = S +I + Se + T + R;
plot(t,S,'b',t,I,'m',t,Se,'r',t,I,'g',t,R,'k',t,N,'q','Linewidth',5)
xlabel('Time in days')
ylabel('Populations')
g=legend('Susceptibe,$S$','Infected,$I$','Sensitized,$Se$','Treated,$T$','Recovered,$R$','Total Population,$N$');
set(g,'Interpreter','latex');
function xdot = SISeTR(~,x)
S = x (1);
I = x (2);
Se = x (3);
T = x (4);
R = x(5);
N = S+I+Se+T+R;
Sdot = Lambda + omega*R - (mu + sigma*I + kappa)*S;
Idot = sigma*S*I + eta*Se + theta*T - (Omega + delta + mu + tau)*I;
Sedot = kappa*S + pi*R - (eta + mu)*Se;
Tdot = Omega*I - (theta + lambda + delta + mu)*T;
Rdot = tau*I + lambda*T - (pi + omega)*R;
xdot = [Sdot;Idot;Sedot;Tdot;Rdot];
end
end
Accepted Answer
More Answers (0)
Categories
Find more on 2-D and 3-D Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!