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_system
list. The desiredfrequency_unit
will be eitherw
for radians/s ork
for reduced frequency (if the system is scaled). Thefrequency_bounds
setting will set the lower and upper bounds of the response, whilenum_freqs
will specify the number of evaluations. The optionfrequency_spacing
allows you to space the evaluations point following alog
orlinear
spacing.If
compute_hinf
is set, the H-infinity norm of the system is calculated.This will be saved to a binary
.h5
file as detailed insave_freq_resp()
.Finally, the
quick_plot
option 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 folder
str
Output folder. ./output
print_info
bool
Write output to screen. False
target_system
list(str)
System or systems for which to find frequency response. ['aeroelastic']
aeroelastic
,aerodynamic
,structural
frequency_unit
str
Units of frequency, w
for rad/s,k
reduced.k
w
,k
frequency_bounds
list(float)
Lower and upper frequency bounds in the corresponding unit. [0.001, 1]
frequency_spacing
str
Compute the frequency response in a linear
orlog
grid.linear
linear
,log
num_freqs
int
Number of frequencies to evaluate. 50
compute_hinf
bool
Compute Hinfinity norm of the system. False
quick_plot
bool
Produce array of .png
plots showing response. Requires matplotlib.False
Computes 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_system
will be performed.
Saves the frequency response to a binary
.h5
file.If the system has not been scaled, the units of frequency are
rad/s
and the response is given in complex form. The response is saved in a[p, m, n_freq_eval]
format, wherep
corresponds to the system’s outputs,n
to the number of inputs andn_freq_eval
to 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.