Experimental Modal Analysis (vibration_toolbox.ema
)¶
ema
– Experimental Modal Analysis¶
-
ema.
frf
(x, f, dt)[source]¶ Return the frequency response function.
Calculates \(H(i\\omega)\), and coherance of the sampled data.
- Parameters
- x: array
Array with the displacement data
- f: array
Array with the force data
- dt: float
Time step of the sampled data
- n: int
Number of points in the fft
- Returns
- freq: array
Driving frequencies
- mag: array
Magnitude of the frequency response function
- ang: array
Phase of the frequency response function
- coh: array
Coherence function
Plot with the frf magnitude, phase and coherence.
Examples
>>> # First we need to load the sampled data which in a .mat file >>> import vibration_toolbox as vtb >>> import scipy.io as sio >>> data = sio.loadmat(vtb.__path__[0] + '/data/frf_data1.mat') >>> #print(data) >>> # Data is imported as arrays. Modify then to fit our function >>> x = data['x'] >>> x = x.reshape(len(x)) >>> f = data['f'] >>> f = f.reshape(len(f)) >>> dt = data['dt'] >>> dt = float(dt) >>> # Now we are able to call the function >>> freq, mag, ang, coh = vtb.frf(x, f, dt) >>> mag[10] 1.018394853080...
-
ema.
mdof_cf
(f, TF, Fmin=None, Fmax=None)[source]¶ Curve fit to multiple degree of freedom FRF.
If Fmin and Fmax are not entered, the first and last elements of TF are used.
If the first column of TF is a collocated (input and output location are the same), then the mode shape returned is the mass normalized mode shape. This can then be used to generate an identified mass, damping, and stiffness matrix as shown in the following example.
- Parameters
- f: array
The frequency vector in Hz. Does not have to start at 0 Hz.
- TF: array
The complex transfer function
- Fmin: int
The minimum frequency to be used for curve fitting in the FRF
- Fmax: int
The maximum frequency to be used for curve fitting in the FRF
- Returns
- z: double
The damping ratio
- nf: double
Natural frequency (Hz)
- u: array
The mode shape
Notes
FRF are columns comprised of the FRFs presuming single input, multiple output z and nf are the damping ratio and natural frequency (Hz) u is the mode shape. Only one peak may exist in the segment of the FRF passed to sdofcf. No zeros may exist within this segment. If so, curve fitting becomes unreliable.
Examples
>>> # First we need to load the sampled data which is in a .mat file >>> import vibration_toolbox as vtb >>> import scipy.io as sio >>> data = sio.loadmat(vtb.__path__[0] + '/data/case2.mat') >>> #print(data) >>> # Data is imported as arrays. Modify then to fit our function >>> TF = data['Hf_chan_2'] >>> f = data['Freq_domain'] >>> # Now we are able to call the function >>> z, nf, a = vtb.mdof_cf(f,TF,500,1000) >>> nf 192.59382330...
-
ema.
plot_fft
(t, time_response, ax=None, **kwargs)[source]¶ Plot fft ot time response.
- Parameters
- tarray
Time array.
- time_responsearray
Array with the system’s time response.
- axmatplotlib.axes, optional
Matplotlib axes where the amplitude will be plotted. If None creates a new.
- Returns
- axarray with matplotlib.axes, optional
Matplotlib axes array created with plt.subplots. Plot has frequency in rad/s and magnitude in meters peak to peak.
Examples
>>> import vibration_toolbox as vtb >>> t = np.linspace(0, 10, 1000) >>> time_response = 2 * np.sin(40*t) >>> vtb.plot_fft(t, time_response) <matplotlib.axes...
-
ema.
sdof_cf
(f, TF, Fmin=None, Fmax=None)[source]¶ Curve fit to a single degree of freedom FRF.
Only one peak may exist in the segment of the FRF passed to sdofcf. No zeros may exist within this segment. If so, curve fitting becomes unreliable.
If Fmin and Fmax are not entered, the first and last elements of TF are used.
- Parameters
- f: array
The frequency vector in Hz. Does not have to start at 0 Hz.
- TF: array
The complex transfer function
- Fmin: int
The minimum frequency to be used for curve fitting in the FRF
- Fmax: int
The maximum frequency to be used for curve fitting in the FRF
- Returns
- z: double
The damping ratio
- nf: double
Natural frequency (Hz)
- a: double
The numerator of the identified transfer functions
Plot of the FRF magnitude and phase.
Examples
>>> # First we need to load the sampled data which is in a .mat file >>> import vibration_toolbox as vtb >>> import scipy.io as sio >>> data = sio.loadmat(vtb.__path__[0] + '/data/case1.mat') >>> #print(data) >>> # Data is imported as arrays. Modify then to fit our function. >>> TF = data['Hf_chan_2'] >>> f = data['Freq_domain'] >>> # Now we are able to call the function >>> z, nf, a = vtb.sdof_cf(f,TF,500,1000) >>> nf 212.092530551...