I'm trying to plot a shear force graph in Google Colabratory using numpy and matplotlib.pyplot, and it's not showing up in the output section. My code is as follows:
import matplotlib.pyplot as plt
import numpy as np
# Create the graphu
x = np.linspace(0, d_OA + d_AB + d_BC, 1000)
V_xy = np.zeros_like(x)
for idx, loc in enumerate(x):
if loc < d_OA:
V_xy[idx] = R_oy
elif ((loc >= d_OA) and (loc < d_OA + d_AB)):
V_xy[idx] = R_oy - T_A*np.sin(theta_A)
elif ((loc >= d_OA + d_AB) and (loc < d_OA + d_AB + d_BC)):
V_xy[idx] = R_oy - T_A*np.sin(theta_A) - W*np.sin(theta_B)
else:
V_xy[idx] = R_oy - T_A*np.sin(theta_A) - W*np.sin(theta_B) + R_cy
V_xy[0] = 0
# Plot the graph
plt.plot(x, V_xy, '-')
plt.grid(True)
plt.xlabel('x / m')
plt.ylabel('Vxy / N')
If anyone can help out, I'd really appreciate it.