Numerically integrating Acceleration to get displacement?
2 ビュー (過去 30 日間)
古いコメントを表示
I want to rephrase my last question, as i was not very clear there.
What i am trying to do is integrate the following second order, nonlinear ode, which is an expression for angular acceleration,
twice, to get the displacement, and compare it with the actual expression for displacement:
BOTH ω and A are specified initially. They are constants.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/414568/image.png)
(corrected from
)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/414368/image.png)
if initial conditions are required, then x(0)=pi/4 and dx/dt (t=0) =0
this has to be integrated w.r.t time, t, twice, between the limits t=0 and t=50 (it can be any time interval)
im not sure if the interval for x has to be defined as well.
the equation for displacement is
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/414573/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/414373/image.png)
Any help would be appreciated!
0 件のコメント
採用された回答
Ameer Hamza
2020 年 11 月 15 日
Are you sure that the equations are correct? The solution you posted does not satisfy the initial conditions.
Generally, such a problem can be solved using the Symbolic toolbox
syms x(t) w A
dxdt = diff(x);
dx2dt2 = diff(x,2);
ode = dx2dt2 == -A*w*sin(dxdt);
cond = [x(0)==pi/4 dxdt(0)==0];
sol = dsolve(ode, cond)
or ode45() can be used for a numerical solution.
4 件のコメント
Ameer Hamza
2020 年 11 月 15 日
Yes, in that case, initial conditions will be zero and you can use cumtrapz().
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Ordinary Differential Equations についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!