help!!! Sinusoidal vibration analysis use in ezyrb
The objective Finite Element Analysis of a Sinusoidal Excitation,i want to use it to predict the result when Frequency changes .
Already tried tests sanpshot has 3 diffrent frequency[2,5,10]node num is 306 time iteration 101 so the snapshot shape is 303306. params shape is [3032] value is [[ 0. 2. ] [ 0.01 2. ] ...... [ 1. 2. ] [ 0. 5. ] [ 0.01 5. ] [ 0.02 5. ] [ 0.03 5. ] ...... [ 1. 5. ] [ 0. 10. ] [ 0.01 10. ] [ 0.02 10. ] [ 0.03 10. ] ...... [ 1. 10. ]] origin data when node id is 7 the picture is as follow
when i predit the frequece is 4 the picture is as follow
code as follow:
#np.save('paramsTest.npy', params_data)
#np.save('x_data.npy', x_data)
params_data = np.load(r'params_data')
x_data = np.load(r'x_data')
times_i = np.load(r'times_i.npy')
db = Database(params_data, x_data)
print("POD")
pod = POD("svd")
# rbf = RBF(kernel="linear")
rbf = RBF(kernel="inverse_multiquadric",epsilon=1)
# rbf = RBF()
rom = ROM(db, pod, rbf)
print("rom.fit()")
rom.fit()
print("predict")
predict_data = []
for i in range(101):
times_i[i]
predict_params=[]
predict_params.append(times_i[i])
predict_params.append(4)
# res = rom.predict(new_param).snapshots_matrix
res = rom.predict(predict_params).snapshots_matrix
predict_data.append(res[0,6])
import matplotlib.pyplot as plt
plt.figure(figsize=(12, 8))
# plt.plot(times_i,x_data[0:101,6], label='X Component')
plt.plot(times_i,predict_data, label='X Component')
plt.title(f' - X Component Acceleration')
plt.xlabel('Time')
plt.ylabel('Acceleration')
plt.legend()
plt.grid(True)
plt.show(block=True)
Dear @YuDe95, I don't have completely understood the problem with your code. Are you obtaining an error, or the model shows a poor accuracy?
the model shows a poor accuracy. Simply put, I want to predict a new vibration sine curve based on frequency and amplitude, but the result I output using this library is not a sine curve but a linear curve
If I understand it right, you are trying to predict a sinus of one frequency, based on sines of different frequencies. That is never going to work well, because sines of different frequencies don’t linearly combine into a new clean sine wave. Mathematically speaking, the result you are trying to get is not in the space of basis functions you have, because sine functions of different frequencies are orthogonal.
you are right.do you know how to solve it?