GRASP Python (19)
GRASP Python (19)
reactions = K_global @ U
# Display results
print("\nAnalysis Results:")
print("Node Displacements:")
for node_id in self.nodes:
ux = U[2*(node_id-1)]
uy = U[2*(node_id-1)+1]
print(f"Node {node_id}: ux = {ux:.6f} m, uy = {uy:.6f} m")
print("\nReactions:")
for node_id in self.supports:
rx = reactions[2*(node_id-1)]
ry = reactions[2*(node_id-1)+1]
print(f"Node {node_id}: Rx = {rx:.2f} N, Ry = {ry:.2f} N")
self.fig.canvas.draw()
node_id = len(self.nodes) + 1
self.add_node(node_id, event.xdata, event.ydata)
self.fig.canvas.mpl_disconnect(self.fig.canvas.button_press_event)
print(f"Added Node {node_id} at ({event.xdata:.2f},
{event.ydata:.2f})")
P a g e 5 | 62