Skip to content

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:

Example Definition

Since we are opening the loop at r (the reference speed input to the controller), we need to provide an initial condition for controller.u_s — otherwise, the linearization cannot determine its operating point value. We do this by extending the test model and adding initial controller.u_s = 0:

dyad
component DCMotorForLinearization
  extends DyadExampleComponents.TestDCMotorLoadControlled(w_motor = 0)
relations
  initial controller.u_s = 0
end

analysis DCMotorLinearAnalysis
  extends DyadControlSystems.LinearAnalysis(
    outputs       = ["y"],
    inputs        = ["r"],
    loop_openings = ["r"],
    duration = 5.0
  )
  model = DCMotorForLinearization()
end

We set w_motor to zero so the controller does not saturate at the linearization point, and provide initial controller.u_s = 0 so the disconnected setpoint input has a defined operating point.

julia
using DyadInterface: artifacts
asol = DCMotorLinearAnalysis()
artifacts(asol, :StepInfoPlot)

julia
artifacts(asol, :BodePlot)

julia
artifacts(asol, :DampReport)
3×5 DataFrame
RowPoleDampingRatioFrequency_rad_sFrequency_HzTimeConstant_s
Complex…Float64Float64Float64Float64
1-0.00010001+0.0im1.00.000100011.59171e-59999.0
2-0.834172+0.0im1.00.8341720.1327631.19879
3-55.3885+173.864im0.303543182.47329.04150.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 points

  • outputs::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

Tables

Further Reading