当前位置:网站首页>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
边栏推荐
- Skywalking distributed system application performance monitoring tool - upper
- [super complete sorting] Cisco and Huawei order comparison memo, take it away without thanks! Anytime, anywhere
- Interviewer: if the order is not paid within 30 minutes after it is generated, it will be automatically cancelled. How to realize it?
- C自定义类型详解
- Paper reading: the perfect match: 3D point cloud matching with smoothed densities
- dynamixel舵机在ros下的workbnech使用
- How to write selenium's testng.xml
- Arduino interrupt realizes rising edge detection and executes other functions
- Batch visual target detection callout box -- Yolo format dataset
- Lagrange polynomial
猜你喜欢

1. Learn to understand web pages

Summary of Zhang Yu's 30 lectures on Advanced Mathematics

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

An in-depth explanation of CAS is necessary for interview practice

Simulink code generation: variable subsystem and its code

Okaleido tiger NFT is about to log in to the binance NFT platform. Are you looking forward to it?

4. Hezhou air32f103_ LCD

Technical dry goods | how difficult is data processing? Take a look at the solution provided by mindspire!

What is IMU?

数据湖:开源数据湖方案DeltaLake、Hudi、Iceberg对比分析
随机推荐
4.合宙Air32F103_LCD
Binary search
【云原生】快速了解Kubernetes
[interpolation expression of applet, rendering judgment, binding events and sharing]
Leetcode-382. random nodes of linked list
Secondary development of ArcGIS JS API -- loading national sky map
RTOS内功修炼记(十) | 深度解析RTOS内核上下文切换机制
The local picture cannot be displayed after the uniapp H5 is packaged
Leetcode Hot 100 (Brush Topic 8) (232 / 88 / 451 / offer10 / offer22 / 344 /)
数据湖:Apache Hudi简介
JS 數組 isAarray() typeof
STL multimap
Basic syntax of MySQL DDL and DML and DQL
It's solved with a cry
Summary of Zhang Yu's 30 lectures on Advanced Mathematics
4. Hezhou air32f103_ LCD
Do you know how to do interface testing well?
QT custom class uses custom parametric signals and slots
leetcode hot 100(刷题篇8)(232/88/451/offer10/offer22/344/)
Tetris, 1