Tech Articles
Plotting Modal Participation: Reading HDF5 using Python Script
Tech Articles ID | KB8023931 | |
Status: | Published | |
Published date: | 12/17/2019 | |
Updated: | 12/17/2019 | |
Reported In: | MSC Nastran | |
Created with Version: | MSC Nastran |
Abstract (Question)
Plotting Modal Participation: Reading HDF5 using Python Script
Description (Answer)
In the attachment you will find sample python script which do the all thing.
Ensure to import the following libraries:
1. Pandas
2. Matplotlib
Keep the h5 file generated from sol 103 in the same directory as the python script.
Change the name of file at the below location in the script(as highligted):
datafr = pd.read_hdf("sol_103_with_bc.h5", key ="/NASTRAN/RESULT/MODAL/MODAL_MASS_FRACTION")
summary = pd.read_hdf("sol_103_with_bc.h5", key ="/NASTRAN/RESULT/MODAL/TOTAL_MASS_FRACTION")
Save it and run, for the sample Nastran job and h5 file you can expect below plot:
You can find the picture "Modal_participation.png" in your working directory