problem_1_8
problem_1_8
November 7, 2024
# Equations of motion
denom = m_b + m - m * np.cos(phi)**2
y_acc = (F_b(t) + m * g * np.sin(phi) * np.cos(phi) + m * l * phi_vel**2 *␣
↪np.sin(phi)) / denom
1
ax.grid(True)
def main():
# Parameters
m_b, m, l, g = 20, 100, 2, 9.81 # mass of bridge [kg], mass of payload␣
↪[kg], rope length [m], gravity [m/s^2]
# Time interval
t_span = (0, t_f)
t_eval = np.linspace(0, t_f, n_t)
plt.tight_layout()
plt.show()
# Extract results
y_pos, y_vel, phi, phi_vel = solution.y
2
x_m = -l * np.cos(phi)
y_m = y_pos + l * np.sin(phi)
dsp_M("### Results")
plt.tight_layout()
plt.show()
plt.tight_layout()
plt.show()
if __name__ == "__main__":
main()
Parameters Mass of the bridge: 𝑚𝑏 = 20 [𝑘𝑔] Mass of the payload: 𝑚 = 100 [𝑘𝑔] Length of the
hoisting rope: 𝑙 = 2 [𝑚] Acceleration due to gravity: 𝑔 = 9.81 [𝑚/𝑠2 ] Final time: 𝑡𝑓 = 8 [𝑠] Number
3
of time points: 𝑛𝑡 = 100
Initial Conditions Position of the bridge: 𝑦(0) = 0 [𝑚] Velocity of the bridge: 𝑦(0)
̇ = 0 [𝑚/𝑠]
̇
Sway angle: 𝜙(0) = 0 [𝑟𝑎𝑑] Angular velocity: 𝜙(0) = 0 [1/𝑠]
0.0.1 Results
4
[2]:
<IPython.core.display.Markdown object>
<IPython.core.display.Markdown object>
---------------------------------------------------------------------------
NameError Traceback (most recent call last)
Cell In[2], line 123
120 plt.show()
122 if __name__ == "__main__":
--> 123 main()
93 dsp_M("### Results")
5
95 # Plot bridge position and velocity
[ ]: