• 【数学建模】基于matlab SIR模型新冠病毒COVID-19估计【含Matlab源码 2042期】


    ✅博主简介:热爱科研的Matlab仿真开发者,修心和技术同步精进,Matlab项目合作可私信。
    🍎个人主页:海神之光
    🏆代码获取方式:
    海神之光Matlab王者学习之路—代码获取方式
    ⛳️座右铭:行百里者,半于九十。

    更多Matlab仿真内容点击👇
    Matlab图像处理(进阶版)
    路径规划(Matlab)
    神经网络预测与分类(Matlab)
    优化求解(Matlab)
    语音处理(Matlab)
    信号处理(Matlab)
    车间调度(Matlab)

    ⛄一、SEIR模型简介

    1 SEIR模型简介
    在这里插入图片描述
    如果所研究的传染病有一定的潜伏期,与病人接触过的健康人并不马上患病,而是成为病原体的携带者,归入 E 类。此时有:
    在这里插入图片描述
    仍有守恒关系 S(t) + E(t) + I(t) + R(t) = 常数,病死者可归入 R 类。潜伏期康复率 γ1 和患者康复率 γ2 一般不同。潜伏期发展为患者的速率为 α。与 SIR 模型相比,SEIR 模型进一步考虑了与患者接触过的人中仅一部分具有传染性的因素,使疾病的传播周期更长。疾病最终的未影响人数 S∞ 和影响人数 R∞ 可通过数值模拟得到。

    2 SEIR模型中的S\E\I\R分别表示什么

    在这里插入图片描述
    SEIR模型是传染病模型的一种,一般将传染病流行范围内的人群分为以下几类:
    (1)S 类,易感者 (Susceptible),指未得病者,但缺乏免疫能力,与感染者接触后容易受到感染;
    (2)E 类,暴露者 (Exposed),指接触过感染者,但暂无能力传染给其他人的人,对潜伏期长的传染病适用;
    (3)I 类,感病者 (Infectious),指染上传染病的人,可以传播给 S 类成员,将其变为 E 类或 I 类成员;
    (4)R 类,康复者 (Recovered),指被隔离或因病愈而具有免疫力的人。如免疫期有限,R 类成员可以重新变为 S 类。

    ⛄二、部分源代码

    close all
    addpath(‘CV19’)
    addpath(‘data’)
    %w1 - weigth for values, w2 - weight for derivatives, prn - print results
    res = fitVirusCV19(@getDataAustria,‘prn’,‘on’,‘jpg’,‘on’,‘jpres’,‘-r300’);

    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    %%% STEP 1: download the data and convert the file format %%%
    %%% added by Igor Podlubny, (igor.podlubny@tuke.sk) %%%
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

    % get the current date in YYYYMMDD format
    currentDateYYYYMMDD = strrep(datestr(date, 26), ‘/’, ‘’);
    % set the filenames
    fileCSV = [‘totalcases’, currentDateYYYYMMDD, ‘.csv’];
    fileXLSX = [‘totalcases’, currentDateYYYYMMDD, ‘.xlsx’];

    % import data from https://ourworldindata.org/coronavirus-source-data
    % download the ‘totalcase.csv’ file
    tcFileCSV = websave(fileCSV,‘https://covid.ourworldindata.org/data/ecdc/total_cases.csv’);

    % read the CSV file, and then save it to XLSX format
    TMPFILE = readtable(fileCSV);
    writetable(TMPFILE,fileXLSX);

    % we will write the results of parsing into the appropriate folder;
    % in order to use the original Milan Batista’s code, we put:
    path = pwd;

    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    %%% STEP 2: Split the data for individual countries %%%
    %%% Milan Batista’s original code for parsing %%%
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

    Amin = 5; % data les than Amin will be deleted from file begining

    % get table
    T = readtable(fileXLSX);

    % get data
    A = T{:,2:end};
    [nrow,ncol] = size(A);

    % table column names
    name = string(T.Properties.VariableNames);
    name = name(2:end)';

    % start date
    date0 = datenum(T{1,1}); %datenum(txt{2,1},‘dd.mm.yyyy’); %datenum(‘2019/12/31’);

    % end date
    %date1 = date0 + nrow - 1;

    %functions names
    ffname = strings(ncol,1);
    nn = 0;
    for n = 1:ncol
    nname = name{n};
    if strcmp(“”,nname)
    continue
    end
    nn = nn + 1;
    nname = strrep(nname,’ ‘,’‘);
    nname = strrep(nname,’-‘,’
    ‘);
    nname = strrep(nname,’‘’‘,’‘);
    nname = strrep(nname,’(‘,’
    ‘);
    nname = strrep(nname,’)‘,’‘);
    fname = sprintf(‘getData%s.m’,nname);
    fid = fopen(fullfile(path,fname),‘w’);
    if fid < 0
    fprintf(’***Fail to open %s\n’,fname);
    continue
    end
    fprintf(‘%d/%d country %s …\n’,ncol,n,nname);
    ffname(nn) = nname;
    fprintf(fid,‘function [country,C,date0] = getData%s()\n’,nname);
    fprintf(fid,‘%%GETDATA%s Coronavirus data for %s\n’,upper(nname),nname);
    fprintf(fid,‘%% as reported by One World in Data\n’);
    fprintf(fid,‘%% https://ourworldindata.org/coronavirus-source-data\n’);
    fprintf(fid,‘country = ‘’%s’‘;\n’,strrep(name(n),’ ‘,’
    ‘));
    fprintf(fid,‘C = [\n’);
    found = false;
    nday = 0;
    for m = 1:nrow
    if ~found && (isnan(A(m,n)) || A(m,n) == 0 || A(m,n) < Amin)
    nday = nday + 1;
    continue
    else
    found = true;
    end
    fprintf(fid,’ %9d %% %s\n’,A(m,n),datestr(date0 + m - 1));
    end
    fprintf(fid,‘%%<-------------- add new data here\n’);
    fprintf(fid,‘]’‘;\n’);
    % start date
    fprintf(fid,‘date0=datenum(’‘%s’‘);\n’,datestr(date0 + nday));
    fprintf(fid,‘end\n’);
    fclose(fid);

    %generete driver rutine
    fname = 'runAll.m';
    fid = fopen(fullfile(path,fname),'w'); 
    if fid < 0
        fprintf('***Fail to open %s\n',fname);
        continue
    end
    fprintf(fid,'prn = ''off'';\n');
    fprintf(fid,'plt = ''on'';\n');
    for n = 1:nn
        fprintf(fid,'try\n');
        fprintf(fid,'  fitVirusCV19(@getData%s,''prn'',prn,''jpg'',plt)\n',...
            ffname(n));
        fprintf(fid,'end\n');
    end
    fclose(fid);
    
    cd(oldFolder)
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18

    end

    ⛄三、运行结果

    在这里插入图片描述

    ⛄四、matlab版本及参考文献

    1 matlab版本
    2014a

    2 参考文献
    [1]李昕.MATLAB数学建模[M].清华大学出版社.2017
    [2]王健,赵国生.MATLAB数学建模与仿真[M].清华大学出版社.2016
    [3]余胜威.MATLAB数学建模经典案例实战[M].清华大学出版社.2015

    3 备注
    简介此部分摘自互联网,仅供参考,若侵权,联系删除

    🍅 仿真咨询
    1 各类智能优化算法改进及应用

    生产调度、经济调度、装配线调度、充电优化、车间调度、发车优化、水库调度、三维装箱、物流选址、货位优化、公交排班优化、充电桩布局优化、车间布局优化、集装箱船配载优化、水泵组合优化、解医疗资源分配优化、设施布局优化、可视域基站和无人机选址优化

    2 机器学习和深度学习方面
    卷积神经网络(CNN)、LSTM、支持向量机(SVM)、最小二乘支持向量机(LSSVM)、极限学习机(ELM)、核极限学习机(KELM)、BP、RBF、宽度学习、DBN、RF、RBF、DELM、XGBOOST、TCN实现风电预测、光伏预测、电池寿命预测、辐射源识别、交通流预测、负荷预测、股价预测、PM2.5浓度预测、电池健康状态预测、水体光学参数反演、NLOS信号识别、地铁停车精准预测、变压器故障诊断

    3 图像处理方面
    图像识别、图像分割、图像检测、图像隐藏、图像配准、图像拼接、图像融合、图像增强、图像压缩感知

    4 路径规划方面
    旅行商问题(TSP)、车辆路径问题(VRP、MVRP、CVRP、VRPTW等)、无人机三维路径规划、无人机协同、无人机编队、机器人路径规划、栅格地图路径规划、多式联运运输问题、车辆协同无人机路径规划、天线线性阵列分布优化、车间布局优化

    5 无人机应用方面
    无人机路径规划、无人机控制、无人机编队、无人机协同、无人机任务分配

    6 无线传感器定位及布局方面
    传感器部署优化、通信协议优化、路由优化、目标定位优化、Dv-Hop定位优化、Leach协议优化、WSN覆盖优化、组播优化、RSSI定位优化

    7 信号处理方面
    信号识别、信号加密、信号去噪、信号增强、雷达信号处理、信号水印嵌入提取、肌电信号、脑电信号、信号配时优化

    8 电力系统方面
    微电网优化、无功优化、配电网重构、储能配置

    9 元胞自动机方面
    交通流 人群疏散 病毒扩散 晶体生长

    10 雷达方面
    卡尔曼滤波跟踪、航迹关联、航迹融合

  • 相关阅读:
    shiro安全框架的学习笔记
    Repoptimizer论文理解与代码分析
    MySQL数据库基本操作2
    JSP实现小区物业管理系统
    3分钟认识Vue3的v-model
    软件测试/测试开发/人工智能丨视觉与图像识别自动化测试
    C++ 文件和流
    [计算机系统]:理解指针
    【面试题 - mysql】进阶篇 - MVCC多版本并发控制原理
    求二叉树节点的个数——后序遍历
  • 原文地址:https://blog.csdn.net/TIQCmatlab/article/details/126561117