当前位置:网站首页>Matlab ode45 solving differential equations
Matlab ode45 solving differential equations
2022-07-24 03:36:00 【studyer_ domi】
1、 Content abstract
A little
418- Can communicate 、 consulting 、 Answering question
2、 Content description
A little
3、 Simulation analysis
function dy = odefun(t,y)
lameda = 0.2;
alpha = 0.35;
beta = 15;
miu = 0.3;
theta = 0.05;
phi = 0.4;
dy = zeros(4,1); %
S = y(1);
E = y(2);
I = y(3);
R = y(4);
dy(1) = -lameda*beta*I*S-theta*beta*I*S;
dy(2) = lameda*beta*I*S-(alpha+phi)*E;
dy(3) = alpha*E-miu*I;
dy(4) = theta*beta*I*S+phi*E+miu*I;
end%-----------------------------------------------------
% Clear all variables
clear
% Clear the screen
clc
close all
% Time span 0-120, Can be separated by spaces , You can also use commas to separate
tspan = [0,40];
% Initial value
S_0 = 0.9998;E_0 = 0; I_0 = 0.0002; R_0 = 0;
y0 = [S_0 E_0 I_0 R_0];
% Call statement
[T1,Y1] = ode45( @odefun, tspan, y0);
% mapping
figure
plot(T1,Y1(:,1))
xlabel Time
ylabel S
title '\Lambda=0.2'
figure
plot(T1,Y1(:,2))
xlabel Time
ylabel E
title '\Lambda=0.2'
figure
plot(T1,Y1(:,3))
xlabel Time
ylabel I
title '\Lambda=0.2'
figure
plot(T1,Y1(:,4))
xlabel Time
ylabel R
title '\Lambda=0.2'
4、 Reference paper
A little
边栏推荐
- Test interview questions
- Keras deep learning practice (15) -- realize Yolo target detection from scratch
- leetcode hot 100(刷题篇8)(232/88/451/offer10/offer22/344/)
- buu web
- What is the experience of writing concurrent tool classes (semaphore, cyclicbarrier, countdownlatch) by yourself in line 30?
- MySQL学习——MySQL软件的安装及环境配置(Windows)详细!
- Emqx v4.4.5 Publishing: new exclusive subscriptions and mqtt 5.0 publishing attribute support
- 什么是IMU?
- Express built-in Middleware
- Industrial controller, do you really know your five insurances and one fund?
猜你喜欢
![Embedded system transplantation [5] - Cross compilation tool chain](/img/2a/eadaaafe794aa9b3106441fa50ffc7.png)
Embedded system transplantation [5] - Cross compilation tool chain

Huawei then responded to the rumor of "cleaning up employees over the age of 34". How can programmers cope with the "35 year old crisis"?

数据湖:Apache Hudi简介

Technical dry goods | evaluation index based on mindspire detailed perflexity language model

idea写web项目时报错Failed to load resource: the server responded with a status of 404 (Not Found)

Keras deep learning practice (15) -- realize Yolo target detection from scratch

Interviewer: if the order is not paid within 30 minutes after it is generated, it will be automatically cancelled. How to realize it?

MySQL learning - MySQL software installation and environment configuration (Windows) details!

JS Array isaarray () Type of

C动态内存管理详解
随机推荐
Simulink code generation: variable subsystem and its code
08 reptile project
Android Development - lambda expression of kotlin syntax
如何在 pyqt 中实现桌面歌词
Exttestngireporterlistener all codes
4. Hezhou air32f103_ LCD
Industrial controller, do you really know your five insurances and one fund?
How emqx 5.0 under the new architecture of mria + rlog realizes 100million mqtt connections
All codes of selenium
Standard C language 10
STL set container
Water topic: connect rainwater
C語言經典練習題(2)——“冒泡排序(Bubble Sort)“
Genesis public chain: Tamp the foundation of Web 3.0 development
Gpushare. COM | how to use tensorboardx visualization tool?
Programmers may still be programmers, and coders may only be coders
【无标题】
STL set容器
Why do some people write code so complicated?
STL set容器