State-Transition Diagram
Quick Links
MultiStateSystems.STDMultiStateSystems.add_state!MultiStateSystems.add_states!MultiStateSystems.add_transition!MultiStateSystems.add_transitions!
Introduction
In its essence, a state-transition diagram (abbr: std) is a collections of states and transitions mapped onto a directed graph through metadata on its vertices and edges, respectively.
Any state-transition diagram has four attributes:
- a directed graph
std.graph::SimpleDiGraph - state-transition diagram properties
std.props::PropDict - state properties
std.sprops::Dict{Int,PropDict} - transition properties
std.tprops::Dict{Edge,PropDict}
Constructors
An empty constructor is implemented:
MultiStateSystems.STD — MethodSTD()An empty state-transition diagram constructor.
Example
julia> stdᵍᵉⁿ = STD()Info
A number of properties are defined for state-transition diagrams, states and transitions, respectively captured by (a) STDInfo, (b) StateInfo and (c) TransInfo.
markovian[(a),(c)]: the Markov property refers to the memoryless property of a stochastic process. It entails that the conditional probability distribution of future states only depends on the present state, including calendar time, however, they are independent of the present state's sojourn time (see: strong Markov property).renewal[(a), (b), (c)]: the renewal property entails that the stochastic process probabilistically start over at each arrival epoch. Consequently, a non-renewal transition entails that its to-state is not necessarily entered with a zero sojourn time.time_homogeneous[(a), (c)]: the time-homogeneous property entails that the transition probability between two given states at any two times depends only on the difference between those times and not on the calendar time at which the transition occured.trapping[(b)]: the trapping property entails that a state is only partially/never exited upon entering.solved[(a)]: the solved property describes whether the state probabilities of a state-transition diagram have been determined.
State
Any state is represented by a PropDict mapped onto the vertices of the directed graph std.graph. The collection of all states is stored in std.sprops which is a dictionary indexed using the vertex ids [Int].
Any property may be added the PropDict representing a state, however certain properties are reserved for specific functionality of the tool, each linked to a specific key [Symbol].
:infois reserved for the StateInfo:initis reserved for the initial state probability $p(0)$ [-]:probis reserved for the state probability $p(t)$ [-]:flowis reserved for the state flow measure [m³/hr]:poweris reserved for the state power measure [MW]
States may either be added to state-transition diagram individually or grouped using, respectively:
MultiStateSystems.add_state! — Methodadd_state!(std::MultiStateSystems.AbstractSTD; kwargs...)Adds a single state to the state-transition diagram std and fills its corresponding PropDict with the named arguments kwargs.
Example
julia> stdᵍᵉⁿ = STD()
julia> add_state!(stdᵍᵉⁿ, name = "normal operation state",
power = 100u"MW",
init = 1.0)MultiStateSystems.add_states! — Methodadd_states!(std::MultiStateSystems.AbstractSTD; kwargs...)Adds multiple states to the state-transition diagram std and fills their corresponding PropDict with the named arguments kwargs. Either an uniform argument is given which holds for all states or an array is given with the specific argument for each state.
Example
julia> stdᵍᵉⁿ = STD()
julia> add_states!(stdᵍᵉⁿ, name = ["normal operation state","failed state"],
power = [100.0u"MW",0.0u"MW"],
init = [1.0,0.0],
markovian = true)Transition
Any transition is represented by a PropDict mapped onto the edges of the directed graph std.graph. The collection of all transitions is stored in std.tprops which is a dictionary indexed using the edge ids [Edge].
Any property may be added to the PropDict representing a transition, however certain properties are reserved for specific functionality of the tool, each linked to a specific key [Symbol].
:statesis reserved for the tuple (fr,to) of the from- and to-state:rateis reserved for the transition rate $\rho(t,φ)$ [1/hr]:distris reserved for the transition distribution
Transitions may either be added to a state-transition diagram individually or grouped using, respectively:
MultiStateSystems.add_transition! — Methodadd_transition!(std::MultiStateSystems.AbstractSTD; kwargs...)Adds a single transitions to the state-transition diagram std and fills its corresponding PropDict with the named arguments kwargs. One obligatory named argument is :states, describing the tuple (fr,to) of the from- and to-state.
Example
julia> stdᵍᵉⁿ = STD()
julia> add_states!(stdᵍᵉⁿ, name = ["normal operation state","failed state"],
power = [100.0u"MW",0.0u"MW"],
init = [1.0,0.0],
markovian = true)
julia> add_transition!(stdᵍᵉⁿ, rate = 0.001u"1/hr",
states = (1,2))MultiStateSystems.add_transitions! — Methodadd_transitions!(std::MultiStateSystems.AbstractSTD; kwargs...)Adds multiple transitions to the state-transition diagram std and fills their corresponding PropDict with the named arguments kwargs. Either an uniform argument is given which holds for all transitions or an array is given with the specific argument for each transition.
Example
julia> stdᵍᵉⁿ = STD()
julia> add_states!(stdᵍᵉⁿ, name = ["normal operation state","failed state"],
power = [100.0u"MW",0.0u"MW"],
init = [1.0,0.0],
markovian = true)
julia> add_transitions!(stdᵍᵉⁿ, rate = [0.001u"1/hr",0.01u"1/hr"],
states = [(1,2),(2,1)])If the :states argument is not provided in the add_transitions! function, the from- and to-states will be determined based on the other arguments.
Example (Alternative)
julia> add_transitions!(stdᵍᵉⁿ, rate = [0.000u"1/hr" 0.010u"1/hr"
0.001u"1/hr" 0.000u"1/hr"])