文件名称:RK4
介绍说明--下载内容均来自于网络,请自行研究使用
1.用四阶 Runge-Kutta 法求数值积分的函数为 RK4
2.此函数的入口参数为:系统维数 dimension,仿真时间 tspan 。
3.tspan 的格式为 [a:h:b] . 其中 a 表示起始时间,h 表示步长,b 表示终止时间。
4.仿真模型的状态方程、输出方程的系数矩阵以及系统初值均存放于文件 input information.txt 中。
5.仿真结果存放于文件 result.txt 中。
6.运行举例:
将 M 文件 RK4.m 和 input information.txt 均存放于 Matlab 的当前工作目录下,然后在 Command Window 中输入以下命令:
dimension=3
tspan=[0:0.01:2]
RK4(dimension,tspan)
回车后,打开 Matlab 的当前工作目录文件夹,找到文件 result.txt ,即可看到仿真结果。-1. Numerical Integration function with fourth-order Runge-Kutta method RK4 2. Inlet parameters of this function: the system dimension dimension, the simulation time tspan. 3.tspan Formats for [a: h: b], wherein A represents a start time, h is the step length, b indicates the termination time. The equation of state of the simulation model, the coefficient matrix of the equation as well as the system initial value of the output is stored in the file input information.txt. The 5. Simulation results are stored in a file result.txt. Running example: the the M file RK4.m and input information.txt of are placed in Matlab current working directory, then enter the following command in the Command Window: dimension = 3 tspan = [0:0.01:2] RK4 (dimension, tspan) Enter, open Matlab' s current working directory folder find the file result.txt, you can see the simulation results.
2.此函数的入口参数为:系统维数 dimension,仿真时间 tspan 。
3.tspan 的格式为 [a:h:b] . 其中 a 表示起始时间,h 表示步长,b 表示终止时间。
4.仿真模型的状态方程、输出方程的系数矩阵以及系统初值均存放于文件 input information.txt 中。
5.仿真结果存放于文件 result.txt 中。
6.运行举例:
将 M 文件 RK4.m 和 input information.txt 均存放于 Matlab 的当前工作目录下,然后在 Command Window 中输入以下命令:
dimension=3
tspan=[0:0.01:2]
RK4(dimension,tspan)
回车后,打开 Matlab 的当前工作目录文件夹,找到文件 result.txt ,即可看到仿真结果。-1. Numerical Integration function with fourth-order Runge-Kutta method RK4 2. Inlet parameters of this function: the system dimension dimension, the simulation time tspan. 3.tspan Formats for [a: h: b], wherein A represents a start time, h is the step length, b indicates the termination time. The equation of state of the simulation model, the coefficient matrix of the equation as well as the system initial value of the output is stored in the file input information.txt. The 5. Simulation results are stored in a file result.txt. Running example: the the M file RK4.m and input information.txt of are placed in Matlab current working directory, then enter the following command in the Command Window: dimension = 3 tspan = [0:0.01:2] RK4 (dimension, tspan) Enter, open Matlab' s current working directory folder find the file result.txt, you can see the simulation results.
(系统自动生成,下载前可以参看下载内容)
下载文件列表
RK4.m