Apr-12-2020, 06:54 AM
Hi all,
I'm looking at a problem in structural dynamics. I need to do a what I thought would be a fairly simple calculation of a 3x3 array transposed multiplied by a 3x1 array. For this should give a 3x1 array as an answer.
My 3x3 array is written as:
Phi = np.array([[phi11, phi12, phi13],[phi21,phi22, phi23],[phi31, phi32, phi33]])
print (Phi) returns the below.
[[ 1.00000000e+00 -1.42326796e-16 7.80310099e-17]
[-1.65973033e-16 1.00000000e+00 3.72108258e-16]
[ 2.64471834e-17 3.72043002e-16 1.00000000e+00]]
My 3x1 array is written as:
F = np.mat([0,791.7770505,-39.35299453]).reshape([3,1])
print (F) returns the below:
[[ 0. ]
[791.7770505 ]
[-39.35299453]]
However, when I make the multiplication
modalF = np.array(Phi.transpose()*F)
and print (modalF), the result is
[[ 2.82809468 2.67362901 -4.03442266]] which is a 1x3 matrix???
I made a check of
print(Phi.transpose().shape)
print(modalF.shape)
and the output is
(1, 3, 3)
(1, 3)
Therefore I am confused on two counts:
1. Why is there 3 dimensions for Phi.transpose()?
2. Why is a 3x3 multiplied by 3x1 resulting in 1x3?
Thanks in advance!
I'm looking at a problem in structural dynamics. I need to do a what I thought would be a fairly simple calculation of a 3x3 array transposed multiplied by a 3x1 array. For this should give a 3x1 array as an answer.
My 3x3 array is written as:
Phi = np.array([[phi11, phi12, phi13],[phi21,phi22, phi23],[phi31, phi32, phi33]])
print (Phi) returns the below.
[[ 1.00000000e+00 -1.42326796e-16 7.80310099e-17]
[-1.65973033e-16 1.00000000e+00 3.72108258e-16]
[ 2.64471834e-17 3.72043002e-16 1.00000000e+00]]
My 3x1 array is written as:
F = np.mat([0,791.7770505,-39.35299453]).reshape([3,1])
print (F) returns the below:
[[ 0. ]
[791.7770505 ]
[-39.35299453]]
However, when I make the multiplication
modalF = np.array(Phi.transpose()*F)
and print (modalF), the result is
[[ 2.82809468 2.67362901 -4.03442266]] which is a 1x3 matrix???
I made a check of
print(Phi.transpose().shape)
print(modalF.shape)
and the output is
(1, 3, 3)
(1, 3)
Therefore I am confused on two counts:
1. Why is there 3 dimensions for Phi.transpose()?
2. Why is a 3x3 multiplied by 3x1 resulting in 1x3?
Thanks in advance!