Skip to content

help!!! Sinusoidal vibration analysis use in ezyrb #258

Open
@YuDe95

Description

@YuDe95

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 [303
2]
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

Image
when i predit the frequece is 4 the picture is as follow

Image

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)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions