Open ViniciusTxc3 opened 2 weeks ago
Together with @romero-patrick, we are developing a new way of calculating the FRF, where the time drops considerably ~1s for the same example.
This is the idea of a function:
def FRF(rotor, speed_range, inp, out, num_modes = 10):
M_mod = rotor.M()
K_mod = np.zeros(M_mod.shape)
K0 = rotor.K(0) + K_mod
FRF_resp = np.zeros(len(speed_range))
Lambda, Phi = sp.linalg.eigh(K0, M_mod)
Phi = Phi[:,:num_modes]
M_red = Phi.T@M_mod@Phi
G_red = Phi.T@rotor.G()@Phi
for i in range(len(speed_range)):
w=speed_range[i]
K_red = Phi.T @ (rotor.K(w) + K_mod) @ Phi
C_red = Phi.T @ rotor.C(w) @ Phi
H_red = -w**2*M_red + (1j*w)*(C_red+w*G_red) + K_red
Hinv_red = sp.linalg.inv(H_red)
Hinv = Phi@Hinv_red@Phi.T
#FRF_resp[i] = np.abs(Hinv[int(inp)][int(out)])
FRF_resp[i] = (Hinv[int(inp)][int(out)])
return FRF_resp
@romero-patrick noticed that the execution time when using the ROSS FRF response is high. In one example the time spent was ~5min. To speed up the calculations, here is the code example: