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

English Attachment

Sol_103_with_bc.bdf
6K • < 1 minute @ 56k, < 1 minute @ broadband


sol_103_with_bc.h5
951K • 3 minute(s) @ 56k, < 1 minute @ broadband


meffmass.py
2K • < 1 minute @ 56k, < 1 minute @ broadband



Rate this Page
Rate the quality of this article from 5 (high) to 1 (low):
1
2
3
4
5
 
How can we improve this?