27. Modal superposition - free vibration

Questions and discussion for this lecture live here. Fire away by hitting Reply below :fire:

Hello Sean,

I am trying to fully understand the following lines of code:

Y0_mode_1 = Phi[:,0].transpose() * M * u0
Y0_mode_2 = Phi[:,1].transpose() * M * u0
Y0_mode_3 = Phi[:,2].transpose() * M * u0

I noticed that Phi[:,0] is a 1D NumPy array, and from what I’ve learned, applying .transpose() to a 1D array does not change its shape.

To make sure I fully understand the logic behind this code, could you confirm that the transpose() function is working correctly in this context? Can we be certain that the Y0_mode expressions are correct?

Thank you

Hey @mrgurer,

Well spotted…the .transpose() method is indeed redundant in this case. You likely understand things quite well :+1:

If I’m honest, I can’t quite recall why I had .transpose in there. I’d like to say it was necessary at the time of writing and that Numpy has since streamlined the operation of .matrix and .array, behind the scenes, but that may be being overly charitable to myself!

Seán

1 Like