FrequencyResponse¶
Frequency Response Calculator.
Computes the frequency response of a built linear system. The frequency will be calculated for the systems specified in the
target_systemlist. The desiredfrequency_unitwill be eitherwfor radians/s orkfor reduced frequency (if the system is scaled). Thefrequency_boundssetting will set the lower and upper bounds of the response, whilenum_freqswill specify the number of evaluations. The optionfrequency_spacingallows you to space the evaluations point following alogorlinearspacing.If
compute_hinfis set, the H-infinity norm of the system is calculated.This will be saved to a binary
.h5file as detailed insave_freq_resp().Finally, the
quick_plotoption will plot some quick and dirty bode plots of the response. This requires access tomatplotlib.The settings that this solver accepts are given by a dictionary, with the following key-value pairs:
Name Type Description Default Options folderstrOutput folder. ./outputprint_infoboolWrite output to screen. Falsetarget_systemlist(str)System or systems for which to find frequency response. ['aeroelastic']aeroelastic,aerodynamic,structuralfrequency_unitstrUnits of frequency, wfor rad/s,kreduced.kw,kfrequency_boundslist(float)Lower and upper frequency bounds in the corresponding unit. [0.001, 1]frequency_spacingstrCompute the frequency response in a linearorloggrid.linearlinear,lognum_freqsintNumber of frequencies to evaluate. 50compute_hinfboolCompute Hinfinity norm of the system. Falsequick_plotboolProduce array of .pngplots showing response. Requires matplotlib.FalseComputes the frequency response of the linear state-space.
Parameters: ss (sharpy.linear.src.libss.ss (Optional)) – State-space object for which to compute the frequency response. If not given, the response for the previously assembled systems and specified in target_systemwill be performed.
Saves the frequency response to a binary
.h5file.If the system has not been scaled, the units of frequency are
rad/sand the response is given in complex form. The response is saved in a[p, m, n_freq_eval]format, wherepcorresponds to the system’s outputs,nto the number of inputs andn_freq_evalto the number of frequency evaluations.Parameters: - wv (np.ndarray) – Frequency array.
- Y_freq (np.ndarray) – Frequency response data
[p, m, n_freq_eval]matrix. - system_name (str (optional)) – State-space system name.
- hinf (float (optional)) – H-infinity norm of the system.