Skip to content

Lifecycle & Faults

Model asset degradation with lifecycle stages and inject faults using condition-based triggers, spike effects, cascading behaviors, and runtime bindings.

Lifecycle stages and faults model long-term degradation and failure modes.

Assets progress through lifecycle stages based on operating hours. Each stage applies effects to member values, simulating real-world wear.

lifecycle:
stages:
- name: healthy
duration_hours: [4000, 7000]
effects: {}
- name: degraded
duration_hours: [1000, 2000]
effects:
vibration_baseline: { multiplier: 1.4 }
bearing_temperature: { offset: 8 }
- name: critical
duration_hours: [300, 700]
effects:
vibration_baseline: { multiplier: 2.0 }
bearing_temperature: { offset: 18 }
flow_rate: { multiplier: 0.85 }
  1. Each instance starts in the first stage with randomized operating hours
  2. The engine tracks operating hours based on simulation time
  3. When hours exceed the stage duration, the asset transitions to the next stage
  4. Stage durations are randomized within the [min, max] range per instance

Effects modify generator output values using: value * multiplier + offset

FieldDefaultDescription
multiplier1.0Multiplicative scaling
offset0Additive shift

Effects apply to any numeric member referenced by name.

Use a binding to expose the current stage as a member:

lifecycle_stage:
kind: variable
data_type: String
access: read
binding:
type: lifecycle-stage

Faults model specific failure modes with triggers, effects, and durations.

faults:
- name: cavitation
trigger:
condition: "discharge_pressure < 2.5"
probability: 0.01
effects:
vibration_radial: { spike: 1.8, duration_ticks: 180 }
flow_rate: { multiplier: 0.75, duration_ticks: 180 }
motor_current: { offset: 3, duration_ticks: 180 }
- name: bearing_wear
trigger:
lifecycle_stage: degraded
probability: 0.004
effects:
vibration_axial: { multiplier: 1.4, duration_ticks: 600 }
bearing_temperature: { offset: 6, duration_ticks: 600 }
FieldDescription
lifecycle_stageOnly evaluate when the asset is in this stage
conditionExpression like "pressure < 2.5" evaluated against member values
probabilityPer-tick probability of firing (0 to 1)

Triggers can combine lifecycle_stage with probability — the fault only rolls the dice when the asset is in the specified stage.

Effects are applied in order: spike, then multiplier, then offset.

FieldDescription
spikeMultiplicative spike (e.g., 1.8 means 1.8x the current value)
multiplierOngoing multiplicative scaling
offsetAdditive shift
duration_ticksHow long the effect lasts before auto-clearing

String-valued effects short-circuit — they replace the member value directly.

Trigger faults manually through the CLI or admin API:

Via the CLI:

Terminal window
miravo inject pump-001 cavitation

Via the admin API:

Terminal window
curl -s http://127.0.0.1:8080/commands \
-H 'content-type: application/json' \
-d '{"type":"triggerFault","instanceId":"pump-001","fault":"cavitation"}'

Clear a fault:

Terminal window
curl -s http://127.0.0.1:8080/commands \
-H 'content-type: application/json' \
-d '{"type":"clearFault","instanceId":"pump-001","fault":"cavitation"}'

Expose fault state as members:

fault_active:
kind: variable
data_type: Boolean
access: read
binding:
type: fault-active # true when any fault is active
fault_count:
kind: variable
data_type: UInt16
access: read
binding:
type: fault-count # Number of active faults
active_fault_code:
kind: variable
data_type: String
access: read
binding:
type: active-fault-code # Name of the active fault
fallback: none
health_state:
kind: variable
data_type: String
access: read
binding:
type: health-state # Combines lifecycle + fault state