Figure 1: Cantilever of length \( L \) with a concentrated force \( P \) at \( x=0 \).

The moment balance of the cantilever in Fig. 1 can be expressed as: $$ \begin{align} EI \frac{d^2y}{dx^2} = -P\,x, \label{eq:moment} \end{align} $$
where \( P \) is the external load at \( x=0 \), \( E \) is the Young's modulus and \( I \) is the second moment area of the cantilever. The displacement \( y(x) \) of the cantilever can be expressed as $$ \begin{align} y = \frac{P}{6EI}\left(-x^3 + 3L^2x -2L^3\right), \label{eq:displacement} \end{align} $$
and at the tip (\( x=0 \)), the displacement is $$ \begin{align} y_{tip} = \frac{-L^3P}{3EI}, \label{eq:displacement_tip} \end{align} $$
a) calculate \( I \) for the rectangular cross section with \( b=0.1 m \) and \( h = 0.2 m \).
b) calculate \( I \) for the circular cross sections with \( r=0.15 m \).
c) calculate \( y_{tip} \) for steel (\( E=200 \) GPa) and aluminium (\( E=69 \) GPa), \( L=1 \) m and \( P = 10^6 \) N, for the rectangular and circular cross-section
d) find the radius, \( r \) such that the circular cross-section have the same area as the rectangular
e) create a list of x values from \( x = 0 \), to \( x = L = 1 m \) with a spacing of \( dx = 0.1 m \)
f) calculate y(x) for all x-values in e for steel with rectangular cross section.
g) plot y(x) vs x.
h) create functions, calcDeflectionSteel, and calcDeflectionAlu that calculates \( y(x) \) (rectangular crosssection)
i) create a function that calcDeflection that takes x, materialType, crossSectionType, b, h, r, L and P as input
j) plot the results using 1) lists and 2) numpy arrays
a) In this subexercise some simple mathematical operations are to be carried out. Define the vectors \( a \) and \( b \) and the matrices \( A \) and \( B \) as numpy arrays as follows, $$ \begin{align*} b&=\left[ \begin{matrix} 12 \\ 5 \\ 2 \end{matrix}\right] & A&=\left[ \begin{matrix} -3 & 2 & -4 \\ 0 & 1 & 2 \\ 2 & 4 & 5 \end{matrix}\right] \end{align*} $$ Carry out the following calculations and print the results to the screen: