matlab中的微分
我需要找到物体的加速度,文本中给出的公式是 a = d^2(L)/d(T)^2 ,其中 L= 长度,T= 时间 我通过使用这个方程在matlab中计算了这个
a = (1/(T3-T1))*(((L3-L2)/(T3-T2))-((L2-L1)/(T2-T1)))
,或者
a = (v2-v1)/(T2-T1)
但我没有得到正确的答案,任何人都可以告诉我如何通过matlab中的任何其他方法找到(a)。
i need to find acceleration of an object the formula for that given in text is a = d^2(L)/d(T)^2 , where L= length and T= time
i calculated this in matlab by using this equation
a = (1/(T3-T1))*(((L3-L2)/(T3-T2))-((L2-L1)/(T2-T1)))
or
a = (v2-v1)/(T2-T1)
but im not getting the right answers ,can any body tell me how to find (a) by any other method in matlab.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这与matlab无关,你只是试图对一个函数进行两次数值微分。根据函数的高阶(三阶、四阶)导数的行为,这将或不会产生合理的结果。假设 L 是四次可微分,您还必须预期使用类似于您正在使用的公式会出现
|T3 - T1|^2
阶错误。您可以尝试使用对称近似,而不是使用不同大小的间隔,就像我在数值数学讲座中回忆的那样,这更适合高阶导数的数值计算。您仍然会遇到顺序错误,
||.||
表示函数的最高范数(即 L 的四阶导数需要有界)。如果这是真的,您可以使用该公式来计算必须选择多小的 h 才能产生您愿意接受的结果。但请注意,这只是理论错误,是对 L 的泰勒近似进行分析的结果,请参阅 [1] 或 [2] - 这是我刚才得到的地方 - 或任何其他数值数学入门书。根据 L 评估的质量,您可能会得到额外的错误;另外,如果|L(xh) - L(x)|
非常小,则数值减法可能会出现病态。[1] 安格曼·纳布纳; NumerikpartiellerDifferentialgleichungen;施普林格
[2] http://math.fullerton.edu/mathews/n2003/numericaldiffmod.html
This has nothing to do with matlab, you are just trying to numerically differentiate a function twice. Depending on the behaviour of the higher (3rd, 4th) derivatives of the function this will or will not yield reasonable results. You will also have to expect an error of order
|T3 - T1|^2
with a formula like the one you are using, assuming L is four times differentiable. Instead of using intervals of different size you may try to use symmetric approximations likeFrom what I recall from my numerical math lectures this is better suited for numerical calculation of higher order derivatives. You will still get an error of order
with
||.||
denoting the supremum norm of a function (that is, the fourth derivative of L needs to be bounded). In case that's true you can use that formula to calculate how small h has to be chosen in order to produce a result you are willing to accept. Note, though, that this is just the theoretical error which is a consequence of an analysis of the Taylor approximation of L, see [1] or [2] -- this is where I got it from a moment ago -- or any other introductory book on numerical mathematics. You may get additional errors depending on the quality of the evaluation of L; also, if|L(x-h) - L(x)|
is very small numerical substraction may be ill conditioned.[1] Knabner, Angermann; Numerik partieller Differentialgleichungen; Springer
[2] http://math.fullerton.edu/mathews/n2003/numericaldiffmod.html