Session 5: Matrices & Transformations – Linear Algebra for Structures
Discuss
Wings/forces as matrices (e.g., stress analysis). "Math for building unbreakable designs."
Code
import numpy as np
import matplotlib.pyplot as plt
matrix = np.array([[0.5, -0.5], [0.5, 0.5]]) # Rotation matrix
vector = np.array([1, 0])
transformed = matrix @ vector
plt.quiver(0, 0, vector[0], vector[1], color='b', label='Original')
plt.quiver(0, 0, transformed[0], transformed[1], color='r', label='Transformed')
plt.xlim(-1, 1)
plt.ylim(-1, 1)
plt.legend()
plt.grid(True)
plt.title('Linear Algebra: Force Transformation')
plt.show()
Use numpy.linalg for simple transformations (e.g., rotate a force vector). Integrate into flight model.
Excite
Visualize 2D "wing stress" plot—color-code safe/unsafe zones.
Homework
Apply to a multi-force scenario.