├── plots ├── At.fig ├── At.png ├── Bt.fig ├── Bt.png ├── Ct.fig ├── Ct.png ├── Dt.fig ├── Dt.png ├── Et.fig ├── Et.png ├── Ft.fig └── Ft.png ├── docs ├── problem.pdf ├── report.pdf └── reference.pdf ├── README.md ├── LICENSE └── main.m /plots/At.fig: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saagar-parikh/numerical-simulations/HEAD/plots/At.fig -------------------------------------------------------------------------------- /plots/At.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saagar-parikh/numerical-simulations/HEAD/plots/At.png -------------------------------------------------------------------------------- /plots/Bt.fig: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saagar-parikh/numerical-simulations/HEAD/plots/Bt.fig -------------------------------------------------------------------------------- /plots/Bt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saagar-parikh/numerical-simulations/HEAD/plots/Bt.png -------------------------------------------------------------------------------- /plots/Ct.fig: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saagar-parikh/numerical-simulations/HEAD/plots/Ct.fig -------------------------------------------------------------------------------- /plots/Ct.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saagar-parikh/numerical-simulations/HEAD/plots/Ct.png -------------------------------------------------------------------------------- /plots/Dt.fig: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saagar-parikh/numerical-simulations/HEAD/plots/Dt.fig -------------------------------------------------------------------------------- /plots/Dt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saagar-parikh/numerical-simulations/HEAD/plots/Dt.png -------------------------------------------------------------------------------- /plots/Et.fig: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saagar-parikh/numerical-simulations/HEAD/plots/Et.fig -------------------------------------------------------------------------------- /plots/Et.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saagar-parikh/numerical-simulations/HEAD/plots/Et.png -------------------------------------------------------------------------------- /plots/Ft.fig: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saagar-parikh/numerical-simulations/HEAD/plots/Ft.fig -------------------------------------------------------------------------------- /plots/Ft.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saagar-parikh/numerical-simulations/HEAD/plots/Ft.png -------------------------------------------------------------------------------- /docs/problem.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saagar-parikh/numerical-simulations/HEAD/docs/problem.pdf -------------------------------------------------------------------------------- /docs/report.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saagar-parikh/numerical-simulations/HEAD/docs/report.pdf -------------------------------------------------------------------------------- /docs/reference.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saagar-parikh/numerical-simulations/HEAD/docs/reference.pdf -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Numerical simulations and stability analysis of a COVID-19 model using fractional derivatives 2 | 3 | This project numerically simulates a fractional-order COVID-19 model based on the Khan-Atangana model. The numerical method used to solve the equations is called the Grunwald-Letnikov derivative. The simulation predicts the behaviour of different subgroups of the population like susceptible, exposed, infected, asymptomatic and recovered people. The project also performs the stability analysis of this model at various equilibrium points. 4 | 5 | ## Acknowledgement 6 | 7 | The MATLAB codes and documentation were done by all four team members Ashwani Rai, Juhi Parikh, Rushik Desai, and Saagar Parikh. We would like to thank Prof. Dilip Srinivas Sundaram (Assistant Professor, IIT Gandhinagar), Prof. Satyajit Pramanik (Assistant Professor, IIT Gandhinagar), and Prof. Sanjay Bora for helping us with the course and providing us with all the assistance needed. 8 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 saagar-parikh 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /main.m: -------------------------------------------------------------------------------- 1 | %% Numerical simulations and stability analysis of a COVID-19 model using fractional derivatives 2 | % Indian Institute of Technology, Gandhinagar 3 | 4 | % Date: 08/05/2021 5 | 6 | % Authors: 7 | % 8 | % Ashwani Rai 19110043 9 | % Juhi Parikh 19110152 10 | % Rushik Desai 19110146 11 | % Saagar Parikh 19110199 12 | 13 | % Instructors: 14 | % 15 | % Prof. Chetan Pahlajani 16 | % Prof. Dilip Sundaram 17 | % Prof. Satyajit Pramanik 18 | 19 | 20 | %% Initalize variables 21 | clear; 22 | 23 | tic % Start the clock to calculate the execution time 24 | 25 | size_k = 121; % Size of the vectors 26 | 27 | % A = Number of susceptible people 28 | % B = Number of exposed people 29 | % C = Number of infected people 30 | % D = Number of asymptotically people (people showing no symptoms) 31 | % E = Number of recovered people 32 | % F = Number of people affected by outbreak at reservoir like market place 33 | 34 | % Initializing vectors for the subgroups used for the fractional order derivatives 35 | A = zeros(size_k,1); 36 | B = zeros(size_k,1); 37 | C = zeros(size_k,1); 38 | D = zeros(size_k,1); 39 | E = zeros(size_k,1); 40 | F = zeros(size_k,1); 41 | 42 | % Initializing vectors for integer-order derivative 43 | global Avec Bvec Cvec Dvec Evec Fvec 44 | 45 | Avec = zeros(size_k,1); 46 | Bvec = zeros(size_k,1); 47 | Cvec = zeros(size_k,1); 48 | Dvec = zeros(size_k,1); 49 | Evec = zeros(size_k,1); 50 | Fvec = zeros(size_k,1); 51 | 52 | % Initializing the parameters 53 | global h mu1 mu2 a1 b1 b2 sigma d f1 f2 e1 e2 g1 g2 N 54 | 55 | % Initialize the values of these parameters 56 | h = 0.01; % Step size 57 | mu1 = 107644.22451; % Natural birth rate 58 | mu2 = 0.01; % Removing rate of the virus from the seafood market 59 | a1 = 1/76.79; % Natural Death Rate 60 | b1 = 0.05; % A and D are related by sigma b1 A D 61 | b2 = 0.000001231; % Disease spread coefficient 62 | sigma = 0.02; % Transmissibility multiple of D to C 63 | d = 0.1243; % Proportion of the asymptomatic infection 64 | f1 = 0.00047876; % Spread rate after completing the incubation period and becomes infected 65 | f2 = 0.001; % Rate at which D contributes the virus to the seafood market 66 | e1 = 0.005; % Spread rate joining the classes C and D 67 | e2 = 0.000398; % Rate at which C contributes the virus to the seafood market 68 | g1 = 0.09871; % Recovery rate 69 | g2 = 0.854302; % Removal rate 70 | L = 1e5; % Memory length 71 | 72 | % Given Initial values 73 | A(1) = 8065518; 74 | B(1) = 200000; 75 | C(1) = 282; 76 | D(1) = 200; 77 | E(1) = 0; 78 | F(1) = 50000; 79 | Avec(1) = 8065518; 80 | Bvec(1) = 200000; 81 | Cvec(1) = 282; 82 | Dvec(1) = 200; 83 | Evec(1) = 0; 84 | Fvec(1) = 50000; 85 | 86 | % Different fractional values of the time derivative 87 | p1 = 0.9; 88 | p2 = 0.9; 89 | p3 = 0.9; 90 | p4 = 0.9; 91 | p5 = 0.9; 92 | p6 = 0.9; 93 | 94 | % p1 = [0.6 0.7 0.8 0.9 0.99]; 95 | % p2 = [0.6 0.7 0.8 0.9 0.99]; 96 | % p3 = [0.6 0.7 0.8 0.9 0.99]; 97 | % p4 = [0.6 0.7 0.8 0.9 0.99]; 98 | % p5 = [0.6 0.7 0.8 0.9 0.99]; 99 | % p6 = [0.6 0.7 0.8 0.9 0.99]; 100 | 101 | 102 | N = A(1) + B(1) + C(1) + D(1) + E(1); % Total Number of people in the case study 103 | 104 | 105 | % Storing the values in the defined functions 106 | for k2 = 0:h:(size_k*h)-h 107 | k2; 108 | funcA(k2); 109 | funcB(k2); 110 | funcC(k2); 111 | funcD(k2); 112 | funcE(k2); 113 | funcF(k2); 114 | end 115 | 116 | %% Solving the fractional-order Grünwald–Letnikov derivative 117 | 118 | for k = 2:(size_k)-1 119 | 120 | % GL derivative for A(k) 121 | sum1_A = 0; % temp variable to store the summation 122 | j1 = 0; % summation variable 123 | while (k-j1)>0 124 | if j1==0 125 | frac = 1; % cannot divide by zero, so set the value = 1 126 | else 127 | frac = p1/j1; % fraction value used in the equation 128 | end 129 | sum1_A = sum1_A + (1/(h^p1))*((1)^j1)*frac*(Avec(k-j1)); % GL derivative eqn summation 130 | j1 = j1+1; % increase counter 131 | end 132 | sum_A = 0; % temp variable to store the summation 133 | for j = v(L,k,h):k 134 | sum_A = sum_A + c(p1,j)*A(k-j+1); % Second summation part of the GL derivative solution 135 | end 136 | A(k) = sum1_A*(h^p1) - sum_A; % Final solution of A(k) 137 | 138 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 139 | % Repeat these steps for B(k),C(k),D(k),E(k),F(k) 140 | 141 | % GL derivative for B(k) 142 | sum_B = 0; 143 | for j = v(L,k,h):k 144 | sum_B = sum_B + c(p2,j)* B(k-j+1); 145 | end 146 | sum1_B = 0; 147 | j1 = 0; 148 | beta = 2.0195e5 + B(1); % correction constant 149 | while (k-j1)>0 150 | if j1==0 151 | frac = 1; 152 | else 153 | frac = p2/j1; 154 | end 155 | sum1_B = sum1_B + (1/(h^p2))*((-1))*(frac)*(Bvec(k-j1)); 156 | j1 = j1+1; 157 | end 158 | B(k) = sum1_B*(h^p2) - sum_B + beta; 159 | 160 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 161 | % GL derivative for C(k) 162 | sum_C = 0; 163 | for j = v(L,k,h):k 164 | sum_C = sum_C + c(p3,j)*C(k-j+1); 165 | end 166 | sum1_C = 0; 167 | j1 = 0; 168 | alpha = 100; 169 | beta = 2.7969e4 + C(1); % correction constant 170 | while (k-j1)>0 171 | if j1==0 172 | frac = 1; 173 | else 174 | frac = p3/j1; 175 | end 176 | sum1_C = sum1_C + (1/(h^p3))*((-1))*(frac)*(Cvec(k-j1))*alpha; 177 | j1 = j1+1; 178 | end 179 | C(k) = sum1_C*(h^p3) - sum_C + beta; 180 | 181 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 182 | % GL derivative for D(k) 183 | sum_D = 0; 184 | for j = v(L,k,h):k 185 | sum_D = sum_D + c(p4,j)*D(k-j+1); 186 | end 187 | sum1_D = 0; 188 | j1 = 0; 189 | alpha = 10; 190 | beta = 1.9741e3 + D(1); % coreection constant 191 | while (k-j1)>0 192 | if j1==0 193 | frac = 1; 194 | else 195 | frac = p4/j1; 196 | end 197 | sum1_D = sum1_D + (1/(h^p4))*((-1))*(frac)*(Dvec(k-j1))*alpha; 198 | j1 = j1+1; 199 | end 200 | D(k) = sum1_D*(h^p4) - sum_D + beta; 201 | 202 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 203 | % GL derivative for E(k) 204 | sum_E = 0; 205 | for j = v(L,k,h):k 206 | sum_E = sum_E + c(p5,j)*E(k-j+1); 207 | end 208 | sum1_E = 0; 209 | j1 = 0; 210 | alpha = 2e3; 211 | while (k-j1)>0 212 | if j1==0 213 | frac = 1; 214 | else 215 | frac = p5/j1; 216 | end 217 | sum1_E = sum1_E + (1/(h^p5))*((1)^j1)*(frac)*(Evec(k-j1))*alpha; 218 | j1 = j1+1; 219 | end 220 | E(k) = sum1_E*(h^p5) - sum_E; 221 | 222 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 223 | % GL derivative for F(k) 224 | sum_F = 0; 225 | for j = v(L,k,h):k 226 | sum_F = sum_F + c(p6,j)*F(k-j+1); 227 | end 228 | sum1_F = 0; 229 | j1 = 0; 230 | while (k-j1)>0 231 | if j1==0 232 | frac = 1; 233 | else 234 | frac = p6/j1; 235 | end 236 | sum1_F = sum1_F + (1/(h^p6))*((1)^j1)*(frac)*(Fvec(k-j1)); 237 | j1 = j1+1; 238 | end 239 | F(k) = sum1_F*(h^p6) - sum_F; 240 | 241 | 242 | end 243 | 244 | 245 | %% Plotting A, B, C, D, E, F with respect to time 246 | 247 | t = 0:(size_k)-1; % Time vector 248 | 249 | 250 | figure; 251 | plot(t, A(t+1), 'Color', 'r'); 252 | axis([0 120 0 9e6]); 253 | xlabel('t'); 254 | ylabel("A(t)"); 255 | 256 | figure; 257 | plot(t, B(t+1), 'Color', 'r'); 258 | axis([0 120 0 5e5]); 259 | xlabel('t'); 260 | ylabel("B(t)") 261 | 262 | figure; 263 | plot(t, C(t+1), 'Color', 'r'); 264 | axis([0 120 0 4e4]); 265 | xlabel('t'); 266 | ylabel("C(t)") 267 | 268 | figure; 269 | plot(t, D(t+1), 'Color', 'r'); 270 | axis([0 120 0 5500]); 271 | xlabel('t'); 272 | ylabel("D(t)") 273 | 274 | figure; 275 | plot(t, E(t+1), 'Color', 'r'); 276 | axis([0 120 0 2e4]); 277 | xlabel('t'); 278 | ylabel("E(t)") 279 | 280 | figure; 281 | plot(t, F(t+1), 'Color', 'r'); 282 | axis([0 120 0 5e4]); 283 | xlabel('t'); 284 | ylabel("F(t)") 285 | 286 | 287 | %% Stability analysis 288 | % Define 2 equilibrium points: disease-free and endemic-equilibrium point 289 | % Define the 2 Jacobian matrices at the two equilibrium points 290 | % Obtain the 6 degree polynomial equations in eigenvalues(lambda) 291 | % Find roots using the Newton-Raphson method 292 | % Check the stability of the model based on the eigenvalues obtained 293 | 294 | 295 | syms J1 J2 lambda 296 | syms func1(lambda) func2(lambda) 297 | 298 | global func1 func2 299 | 300 | % Identity matrix 301 | I = [1, 0, 0, 0, 0, 0; 302 | 0, 1, 0, 0, 0, 0; 303 | 0, 0, 1, 0, 0, 0; 304 | 0, 0, 0, 1, 0, 0; 305 | 0, 0, 0, 0, 1, 0; 306 | 0, 0, 0, 0, 0, 1]; 307 | 308 | % Jacobian matrix at the disease-free equilibrium point 309 | J1 = [ -0.0130 0 -0.0500 -0.0010 0 -10.1754 ; 310 | 0 -0.0141 0.0500 0.0010 0 10.1754 ; 311 | 0 0.0004 -0.1117 0 0 0 ; 312 | 0 0.0006 0 -0.8673 0 0 ; 313 | 0 0 0.0987 0.8543 -0.0130 0 ; 314 | 0 0 0.0003 0.0010 0 -0.0100 ]; 315 | 316 | % Jacobian matrix at the endemic-equilibrium point 317 | J2 = [ -0.0023 0 -0.2885 -0.0058 0 -58.7180 ; 318 | -0.0108 -0.0141 0.2885 0.0058 0 58.7180 ; 319 | 0 0.0004 -0.1117 0 0 0 ; 320 | 0 0.0006 0 -0.8673 0 0 ; 321 | 0 0 0.0987 0.8543 -0.0130 0 ; 322 | 0 0 0.0003 0.0010 0 -0.0100 ]; 323 | 324 | % Functions for the characteistic equations to find the eigenvalues 325 | func1 = @(lambda) mat_det(J1 - lambda*I); 326 | func2 = @(lambda) mat_det(J2 - lambda*I); 327 | 328 | % We will use the Newton Raphson method to find the roots of the above two 329 | % 6 degree polynomial equations for lambda 330 | 331 | % For func1, we use the following 6 initial estimates to find the roots 332 | estimates1 = [-0.0140 -0.0120 -0.1110 -0.0060 -0.0170 -0.8670]; 333 | 334 | for i = 1:6 335 | % Eigenvalues corresponding to matrix J1 336 | root1(i) = newtonraphson1(estimates1(i)); 337 | end 338 | 339 | % For func2, we use the following 6 initial estimates to find the roots 340 | estimates2 = [-0.0140 -0.8670 -0.1110 -0.0200 -0.0125 -0.0061]; 341 | 342 | for i = 1:6 343 | % Eigenvalues corresponding to matrix J1 344 | root2(i) = newtonraphson2(estimates2(i)); 345 | end 346 | 347 | root1 348 | root2 349 | 350 | % We see that the obtained eigenvalues corresponding to both the Jacobian 351 | % matrices are all negative, which shows that the chosen equilibrium points 352 | % are stable 353 | 354 | % Plots of func1 and func2 355 | % 356 | % fplot(lambda, func1) 357 | % line(xlim, [0,0], 'Color', 'Black', 'LineWidth', 0.5); 358 | % fplot(lambda, func2) 359 | % line(xlim, [0,0], 'Color', 'Black', 'LineWidth', 0.5); 360 | 361 | 362 | % Time taken for computation 363 | timetaken = toc 364 | %% Function definitions 365 | 366 | % Solving integral function of the integer-order derivative using Trapezoidal method 367 | % Difference between two data points (t2 - t1) = dt 368 | 369 | function answer = funcA(t) 370 | global h mu1 a1 b1 sigma N 371 | global Avec 372 | 373 | if Avec(floor((t/h)+1)) ~= 0 % If value at particular t is already stored, no need to calculate again (Memoization) 374 | answer = Avec(floor((t/h)+1)); 375 | elseif t == 0 376 | answer = 8065518; % Initial condition 377 | Avec(floor((t/h)+1)) = answer; 378 | else 379 | dt = h; 380 | answer = 0; 381 | it = 0; 382 | % Trapezoidal method for calculating the integral from 0 to t 383 | while (it+dt)