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:
where
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:
analysis ThermalSteadyState
extends SteadyStateAnalysis()
model = Hello(T_inf=T_inf, h=h)
parameter T_inf::Temperature = 300
parameter h::CoefficientOfHeatTransfer = 0.7
endThen in the Julia REPL, we can run the generated analysis via:
result = ThermalSteadyState()Steady State Analysis Solution for SteadyStateAnalysis
retcode: Success
u: 1-element Vector{Float64}:
299.99999999999994We can get the steady state values by examining the SimulationSolutionTable artifact which gives us a Julia DataFrame of the solution values:
using DyadInterface: artifacts
artifacts(result, :SimulationSolutionTable)| Row | T(t) |
|---|---|
| Float64 | |
| 1 | 300.0 |
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:"auto"- uses the NonlinearSolve.jl automated polyalgorithm."TrustRegion"- Trust region method from NonlinearSolve.jl."LevenbergMarquardt"- Levenberg-Marquardt method from NonlinearSolve.jl."NewtonRaphson"- Newton-Raphson method from NonlinearSolve.jl.
abstol::Real: chooses the absolute tolerance for the solver. Defaults to1e-8.reltol::Real: chooses the relative tolerance for the solver. Defaults to1e-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.