@Anying
2016-06-20T07:16:50.000000Z
字数 1061
阅读 651
计算物理 第五次作业
2013301020156 安莹
The velocity of a freely falling object near Earth’s surface is described by the
equation
where v is the velocity and g = 9.8 m/s^2 is the acceleration due to gravity.Write a program that employs the Euler method to compute the solution to (1.8); that is, calculate v as a function of t. For simplicity, assume that the initial velocity is zero—that is, the object starts from rest—and calculate the solution for times t = 0 to t = 10 s. Repeat the calculation for several different values of the time step, and compare the results with the exact solution to (1.8). It turns out that for this case the Euler method gives the exact result. Verify this with your numerical results and prove it analytically(习题:1.1).
只保留一阶项有:
因为:
带入上式得:
代码
运行并画出图像
解析:
带入初始值 t=0,v0=0
得到 v=-gt
将上图中的图像求出函数方程
得到 v=-gt
得到相同的解
用欧拉方程得到的数值解为一次函数,等于此常微分方程的解析解