Undefined function or variable 'FDE12'. Error in odefunc (line 40) [~,y] = FDE12(@(t,y) ode23(t,y,​eta,p1,rho​,alpha,bet​a,mu,c1,c2​,mu1,p2,mu​_v,a,b,tau​,omega,q), t, y0);

5 views (last 30 days)
% Parameters
eta = 0.9;
p1 = 0.1;
rho = 0.05;
alpha = 0.5;
beta = 0.2;
mu = 0.02;
c1 = 0.1;
c2 = 0.05;
mu1 = 0.1;
m = 0.4;
p2 = 0.05;
mu_v = 0.05;
a = 0.1;
b = 0.05;
tau = 0.05;
omega = 0.01;
% Fractional order
q = 1.2;
% Time vector
tspan = [0 100];
dt = 0.1;
t = tspan(1):dt:tspan(2);
% Initial conditions
S0 = 0.9;
E0 = 0.1;
I0 = 0.05;
R0 = 0.01;
Sv0 = 0.01;
Iv0 = 0.01;
Pa0 = 0.01;
y0 = [S0 E0 I0 R0 Sv0 Iv0 Pa0];
% FDE12 method
[~,y] = FDE12(@(t,y) odefunc(t,y,eta,p1,rho,alpha,beta,mu,c1,c2,mu1,p2,mu_v,a,b,tau,omega,q), t, y0);
% Plot results
figure
plot(t, y(:,1), t, y(:,2), t, y(:,3), t, y(:,4), t, y(:,5), t, y(:,6), t, y(:,7))
legend('S', 'E', 'I', 'R', 'Sv', 'Iv', 'Pa')
xlabel('Time')
ylabel('Population')

Answers (1)

Torsten
Torsten on 21 Mar 2023
Moved: Torsten on 21 Mar 2023

Categories

Find more on 2-D and 3-D Plots in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!