Help me understand using ode45

I have a system
x1' = x2
x2' = (1/ml^2)(mglsinx1-bx2)
With x1=theta and x2 = theta' where theta is the angular position of the pendulum. With g = 9.8m/s^2, l = 1.0m, m = 1.0kg, and b = 0.5 N times m times s. With the time interval [0, 20] and the initial condition x1(0) = 30 deg and x2(0) = 0.
How to use MATLAB Function ode45 to compute this numerical solutions of dynamical systems in state space? And how to plot the numerical solution?

4 件のコメント

Walter Roberson
Walter Roberson 2018 年 9 月 12 日
Is (1/ml^2)(mglsinx1-bx2) intended to be (1/(m*l^2))*(m*g*l*sin(x1)-b*x2) ?
Jonathan Diaz
Jonathan Diaz 2018 年 9 月 12 日
No, it's supposed to look like this:
David Goodmanson
David Goodmanson 2018 年 9 月 12 日
which means that the code should look like the expression that Walter wrote down.
Walter Roberson
Walter Roberson 2018 年 9 月 12 日
Ambiguous. Perhaps it is
(1/(m*l^2))*(m*g*l*sin(x1-b*x2))

サインインしてコメントする。

回答 (0 件)

カテゴリ

質問済み:

2018 年 9 月 12 日

コメント済み:

2018 年 9 月 12 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by