@Ding-feng
2017-09-26T21:42:05.000000Z
字数 482
阅读 811
作者:丁峰 学号:2015301020029
用Euler法计算常微分方程
The position of an object moving horizontally with a constant velocity,v,is described by the equation
Assuming that the velocity is a constant, say v = 40 m/s, use the Euler method to solve it for x as a function of time. Compare your result with the exact solution.
调用函数库:matplotlib
具体计算方法:欧拉法
所用公式:
时间间隔dt选取得越短,则模拟计算越精确
此处取dt=0.01 循环1000次
所用程序 homework_3
由程序绘制得到图像如下图所示:
当初速度为v=40时: