Advertisement
martinius96

plotode.m

Jun 28th, 2020
1,511
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 1.05 KB | None | 0 0
  1. global beta delta gamma N omega q;
  2.  
  3. %str=['beta=', num2str(beta); 'delta=',  num2str(delta) ; 'gamma=', num2str(gamma)];
  4. %newstr=join(str);
  5.  
  6. load 'Covid19infecAUT.mat'
  7. covid19infection= table2array(covid19(:,2));
  8. covid19recovered= table2array(covid19(:,4));
  9. covid19deceased= table2array(covid19(:,3));
  10. covid19active= table2array(covid19(:,5));
  11. y=[1:size(covid19infection)]';
  12.  
  13.  
  14. options = odeset('RelTol', 1e-4, 'NonNegative', [1 2]);
  15. [t,x] = ode45('SEIRmodel', [0:1:size(covid19infection)], [17300 1 1 0 0]);
  16.  
  17. figure(1)
  18. clf
  19. plot(t,x,'-');
  20. hold on
  21. plot(y,covid19infection,'o');
  22. hold on
  23. plot(y,covid19recovered,'o');
  24. hold on
  25. plot(y,covid19deceased,'o');
  26. hold on
  27. plot(y,covid19active,'o');
  28. legend('[S]', '[E]', '[I]', '[R]','[D]','Total Infections','Recovered','Deceased','Active','FontSize');
  29. title('Covid-19 SEIR model Austria 26.02-now')
  30. dim = [.2 .5 .5 .3];
  31. %annotation('textbox',dim,'String',newstr ,'FitBoxToText','on');
  32.  
  33. xlabel('Days since 26.02.2020, t','FontSize', 18);
  34. ylabel('Number of people','FontSize', 18);
  35. ylim([0.0 20000]);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement