Linear Analysis ​
The Linear Analysis computes the linearized dynamics of a model and provides a suite of frequency- and time-domain analysis tools. This is useful for understanding the small-signal behavior of a system, including stability, resonance, and transient response.
Method Overview ​
Linear analysis is performed by linearizing the provided model around an operating point. The resulting linear system can be analyzed using classical control theory tools, including:
Frequency response (Bode, Nyquist, root locus, and RGA plots)
Time response (step response, rise time, settling time, overshoot, etc.)
Modal analysis (damping report, pole-zero map)
Example Definition ​
analysis DCMotorLinearAnalysis
extends DyadControlSystems.LinearAnalysis(
outputs = ["y"],
inputs = ["r"],
loop_openings = ["r"],
duration = 5.0
)
model = DyadExampleComponents.TestDCMotorLoadControlled(w_motor = 0)
endHere, we set the motor reference velocity w_motor to zero in order for the controller not to saturate at the linearization point.
using DyadInterface: artifacts
asol = DCMotorLinearAnalysis()
artifacts(asol, :StepInfoPlot)artifacts(asol, :BodePlot)artifacts(asol, :DampReport)| Row | Pole | DampingRatio | Frequency_rad_s | Frequency_Hz | TimeConstant_s |
|---|---|---|---|---|---|
| Complex… | Float64 | Float64 | Float64 | Float64 | |
| 1 | -0.00010001+0.0im | 1.0 | 0.00010001 | 1.59171e-5 | 9999.0 |
| 2 | -0.834172+0.0im | 1.0 | 0.834172 | 0.132763 | 1.19879 |
| 3 | -55.3885+173.864im | 0.303543 | 182.473 | 29.0415 | 0.0180543 |
Analysis Arguments ​
The following arguments define a LinearAnalysis:
Required Arguments ​
model: The model to be analyzed.inputs::Vector{String}: Names of the input analysis pointsoutputs::Vector{String}: Names of the output analysis points
Optional Arguments ​
wl::Real = -1: Lower frequency bound for Bode plot (set to -1 for automatic selection).wu::Real = -1: Upper frequency bound for Bode plot (set to -1 for automatic selection).num_frequencies::Int = 3000: Number of frequency points.duration::Real = -1: Duration for the step response plot (set to -1 for automatic selection).
Artifacts ​
A LinearAnalysis returns the following artifacts:
Standard Plots ​
BodePlot: Bode plot of the system.MarginPlot: Bode plot with gain margin and phase margin.StepResponse: Step response of the system.StepInfoPlot: Plot of step response characteristics.RootLocusPlot: Root locus plot of the system.PoleZeroMap: Pole-zero map of the system.NyquistPlot: Nyquist plot of the system.RGAPlot: Relative Gain Array (RGA) plot of the system.
Tables ​
DampReport: DataFrame with modal analysis (damping, frequency, time constant, etc.).StepInfo: DataFrame with step response characteristics.ObservabilityReport: DataFrame with observability information.