State-Transition Diagram

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:

  1. a directed graph std.graph::SimpleDiGraph
  2. state-transition diagram properties std.props::PropDict
  3. state properties std.sprops::Dict{Int,PropDict}
  4. transition properties std.tprops::Dict{Edge,PropDict}

Constructors

An empty constructor is implemented:

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].

  • :info is reserved for the StateInfo
  • :init is reserved for the initial state probability $p(0)$ [-]
  • :prob is reserved for the state probability $p(t)$ [-]
  • :flow is reserved for the state flow measure [m³/hr]
  • :power is reserved for the state power measure [MW]

States may either be added to state-transition diagram individually or grouped using, respectively:

MultiStateSystems.add_state!Method
add_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)
source
MultiStateSystems.add_states!Method
add_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)
source

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].

  • :states is reserved for the tuple (fr,to) of the from- and to-state
  • :rate is reserved for the transition rate $\rho(t,φ)$ [1/hr]
  • :distr is reserved for the transition distribution

Transitions may either be added to a state-transition diagram individually or grouped using, respectively:

MultiStateSystems.add_transition!Method
add_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))
source
MultiStateSystems.add_transitions!Method
add_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)])
Note

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"])
source