Continuous problem, differential equations or partial differential equations must be able to express. Such as the spread of disease, and other news media.
Discrete problem, you can use differential equations or algorithms similar difference.
equation
$ Y '= cos t $
Code
1 |
clear,clc; |
@
He represents the handle, when the function as a parameter to another function, this time must be used handle. Here is the function f
to the function ode23
.
result
Solving higher order differential equations
equation
$begin{equation}
left{
begin{array}{r1}
y’’=-sin y+sin 5t\
y(0)=1\
y’(0)=0\
end{array}
right.
end{equation}$
可以将该高阶微分方程转化为两个一阶的微分方程:$begin{equation}
left{
begin{array}{r1}
y_1=y\
y_2=y’\
y’_1=y_2\
y’_2=-sin y_1+sin 5t\
y_1(0)=1\
y_2(0)=0\
end{array}
right.
end{equation}$
代码
1 |
clear,clc; |
result
Author: @ smelly salted fish
This article original author, please indicate the source: https://chouxianyu.github.io
Welcome to discuss and share!
Original: Big Box Runge-Kutta method to solve differential equations