Skip to content
ANALYSIS

Steady State Analysis ​

The SteadyStateAnalysis is used to give the solution of the model at steady state.

Method Overview ​

The Dyad compiler uses the physical description of the system to generate a system of differential-algebraic equations:

x′=f(x,y,p,t)0=g(x,y,p,t)

where x are the differential variables, y are the algebraic variables, p are the parameters, and t is the independent variable (time). The steady state is defined as the value when the final time is taken to be infinity, i.e. (x(∞),y(∞)). If the system is stable, non-oscillatory, and non-chaotic, then this is equivalent to point where x′=0, or the values (x,y) s.t.

0=f(x,y,p,t)0=g(x,y,p,t)

Example Definition ​

For this example we will run a steady state analysis on the basic Hello World Newton's Law of Cooling Thermal model from the Getting Started tutorial:

We can set a few run-specific parameters as follows:

dyad
analysis ThermalSteadyState
  extends SteadyStateAnalysis()
  model = Hello(T_inf=T_inf, h=h)
  parameter T_inf::Temperature = 300
  parameter h::CoefficientOfHeatTransfer = 0.7
end

Then in the Julia REPL, we can run the generated analysis via:

@example
using Main.var"##build/.dyad/analyses/steadystateDyadHygiene#443".steadystate # hide
result = ThermalSteadyState()

We can get the steady state values by examining the SimulationSolutionTable artifact which gives us a Julia DataFrame of the solution values:

@example
using Main.var"##build/.dyad/analyses/steadystateDyadHygiene#443".steadystate # hide
using DyadInterface: artifacts
artifacts(result, :SimulationSolutionTable)

Analysis Arguments ​

The following arguments define a SteadyStateAnalysis:

Required Arguments ​

  • model: the Dyad model that the analysis is being applied to.

Optional Arguments ​

  • alg::String: chooses the solver algorithm for the solution process. The default is "auto". The choices are:

  • abstol::Real: chooses the absolute tolerance for the solver. Defaults to 1e-8.

  • reltol::Real: chooses the relative tolerance for the solver. Defaults to 1e-8.

Experimental Arguments ​

  • IfLifting::Boolean: sets the iflifting compiler pass in the ModelingToolkit code generation. Currently defaults to false, but will default to true after the feature is made non-experimental.

Artifacts ​

A SteadyStateAnalysis returns the following artifacts:

Customizable Plot ​

No customizable plot is given.

Tables ​

  • :SimulationSolutionTable: Returns a DataFrame of the solution values at the steady state.

  • :ObservablesTable: Returns a DataFrame of all observable values evaluated at the steady state.

Julia-Side Artifacts ​

  • :RawSolution: Returns the NonlinearSolve.jl solution type from the run.

  • :SimplifiedSystem: Returns the ModelingToolkit.jl model after structural simplification was performed.

  • :InitialSystem: Returns the initial ModelingToolkit.jl model that was passed to the analysis.

Further Reading ​