Operational Deflection Shapes#

The 3D display of the pyFBS can also be used to animate any objects. Animation can either be performed on meshes or on the predefined objects (such as accelerometers). In this example an Operational Deflection Shape (ODS) of an automotive testbench is animated.

Note

Download example showing an application of the ODS: 06_ODS.ipynb

Example Datasets and 3D view#

As already shown in the 3D Display one can load predefined datasets from the available examples and add a structure from STL file to the 3D view. This allows both the sensors and excitation points (impacts) to be visualized.

../../_images/six_one.png

Experimental example#

Load the experimental data, which will be used for the operational deflection shape animation

_file = r"./automotive_testbench/Measurements/ODS.p"
freq, Y_ODS = np.load(_file,allow_pickle = True)

Checkout a single FRF:

select_out = 5
select_in = 1

Y_ODS = pyFBS.plot_frequency_response(freq, Y_ODS[:,select_out:select_out+1,select_in:select_in+1])

Accelerometer animation and GIF export#

The objects placed in the 3D view can be simply animated. In this example an operational deflection shape at a certain impact position is animated. The pyFBS supports also an export to a GIF file. Before running the animation just set the output directory view3D.gif_dir and set the variable view3D.take_gif = True. When the GIF is exporting the animation can lag within the 3D display.

freq_sel = -1
select_in = 6

emp_2 = pyFBS.orient_in_global(Y_ODS[freq_sel,:,select_in],df_chn,df_acc)

mode_dict = pyFBS.dict_animation(emp_2,"object",object_list = view3D.global_acc,r_scale=30)
mode_dict["freq"] = freq[freq_sel]

view3D.take_gif = True
view3D.gif_dir = "..\\pyFBS\\output.gif"

view3D.add_objects_animation(mode_dict,run_animation = True,add_note= True)
../../_images/ods.gif

That’s a wrap!

Want to know more, see a potential application? Contact us at info.pyfbs@gmail.com!