flow "Microgrid" v1.0
# ---------- IDENTITY ----------
id: "power-system.microgrid"
entity_type: "Microgrid"
category: "Engineering Entities / Power-System Entities"
locale: "en-GB"
# ---------- AUTHORS ----------
authors:
- "Mark Anthony Higgins"
- "Sky — Recursive AI"
licence: "Kireth Open Research Licence; citation required"
# ---------- SOURCE ----------
source.url: "https://kirethresearch.org/booksai-core/entity-graph/engineering-entities/power-system-entities/microgrid-ontology.html"
source.title: "Microgrid Ontology"
source.revised: "2026-08-04"
source.note: "New Flow Algebra interpretation of the named ontology; not a verbatim extraction of hidden page specifications."
# ---------- PURPOSE ----------
purpose: "Model a bounded electrical network that can coordinate distributed energy resources, loads, storage and protection in grid-connected or islanded operation."
# ---------- STATE_MODEL ----------
state S(t) = (I(t), R, B, K)
I(t): observations {grid_voltage, grid_frequency, bus_voltage, bus_frequency, generator_output, storage_soc, load_demand, breaker_status, protection_events, forecasts}
R: rules {power_balance, voltage_limits, frequency_limits, protection_coordination, dispatch_constraints, synchronisation_requirements}
B: boundaries {point_of_common_coupling, electrical_isolation, device_ratings, operating_limits, authorised_controls}
K: knowledge {topology, asset_capabilities, historical_measurements, uncertainty, maintenance_status}
states: [OFFLINE, GRID_CONNECTED, ISLANDING, ISLANDED, RESYNCHRONISING, FAULTED, RESTORING]
transition GRID_CONNECTED -> ISLANDING when authorised_islanding and islanding_conditions_satisfied
transition ISLANDING -> ISLANDED when point_of_common_coupling_open and island_stable
transition ISLANDED -> RESYNCHRONISING when utility_available and synchronisation_permitted
transition RESYNCHRONISING -> GRID_CONNECTED when phase_voltage_frequency_matched and closure_authorised
transition any -> FAULTED when protective_trip or unsafe_operating_condition
transition FAULTED -> RESTORING when fault_cleared and authorised_reset
# ---------- ENTITIES ----------
entity Microgrid: electrical_system
entity PointOfCommonCoupling: electrical_interface
entity DistributedGenerator: electrical_source
entity RenewableGenerator: distributed_generator
entity EnergyStorageSystem: bidirectional_resource
entity Inverter: power_conversion_entity
entity MicrogridController: control_entity
entity ProtectionRelay: protection_entity
entity CircuitBreaker: switching_entity
entity ElectricalBus: network_node
entity Feeder: distribution_line
entity ElectricalLoad: demand_entity
entity CriticalLoad: prioritised_load
entity Meter: measurement_entity
entity UtilityGrid: external_electrical_network
relations:
Microgrid contains ElectricalBus, Feeder, ElectricalLoad
Microgrid coordinates DistributedGenerator, EnergyStorageSystem
Microgrid connects_to UtilityGrid via PointOfCommonCoupling
MicrogridController observes Meter, ProtectionRelay
ProtectionRelay commands CircuitBreaker subject_to authorised_protection_logic
EnergyStorageSystem supports power_balance and frequency_response
# ---------- PATHWAYS ----------
pathway "ObserveNetwork":
read I(t)
validate measurement_quality and timestamps
identify topology and active operating_state
output validated_network_state
pathway "EvaluateBalance":
require validated_network_state
compute P_generation = sum(active_generation_power)
compute P_storage = sum(storage_discharge_power - storage_charge_power)
compute P_import = utility_import_power - utility_export_power
compute P_required = sum(load_active_power) + estimated_active_losses
compute P_residual = P_generation + P_storage + P_import - P_required
output power_balance_residual
pathway "CoordinateResources":
require valid_device_limits and authorised_dispatch
prioritise critical_load_continuity and protection_constraints
select feasible generation_storage_and_load_actions
reject actions violating equipment_limits or operating_boundaries
output dispatch_recommendation
pathway "IslandingAssessment":
require islanding_authorised and protection_coordination_verified
check grid_forming_capability and available_reserves
check island_load_balance and expected_frequency_response
permit transition only when all required checks pass
output islanding_readiness
pathway "GridReconnectionAssessment":
require stable_island and authorised_reconnection
verify utility_grid_health and synchronising_controls
verify voltage_frequency_phase_matching within approved_limits
deny closure if any interlock fails
output reconnection_readiness
pathway "FaultResponse":
detect protective_event or abnormal_network_state
classify fault using corroborated_measurements
preserve protective_trip_priority over economic_dispatch
isolate affected_section through approved_protection_system
output fault_record and restoration_constraints
# ---------- MINI_RECURSION_ENGINE ----------
engine "MicrogridReasoning":
input: I(t), R, B, K
expand: candidates = infer_operating_state_and_feasible_actions(I(t), R, K)
filter: valid = candidates satisfying B and protection_rules
rank: choose action maximising safety, stability, critical_load_supply, efficiency
update: I(t+1) = observe_after_authorised_action()
recurse: until stable_state or iteration_limit or safety_stop
output: decision, supporting_evidence, uncertainty, rejected_actions
# ---------- INFERENCE_RULES ----------
rule "GenerationDeficit":
if P_residual < -balance_tolerance
then infer supply_deficit and assess_reserves_or_load_reduction
rule "GenerationSurplus":
if P_residual > balance_tolerance
then infer supply_surplus and assess_storage_charge_or_curtailment
rule "StorageConstraint":
if storage_soc <= minimum_permitted_soc
then prohibit further_nonessential_discharge
rule "FrequencyDeviation":
if bus_frequency outside approved_frequency_band
then infer frequency_instability and invoke authorised_stability_response
rule "VoltageDeviation":
if bus_voltage outside approved_voltage_band
then infer voltage_violation and assess approved_voltage_controls
rule "GridLoss":
if utility_grid_unavailable and pcc_is_open
then infer islanded_or_deenergised_state based_on local_bus_measurements
rule "UnsafeReconnection":
if synchronisation_checks_fail or reconnection_not_authorised
then prohibit point_of_common_coupling_closure
rule "ProtectionPriority":
if protective_trip_active
then block automatic_reenergisation unless authorised_restoration_checks_pass
# ---------- CONFIDENCE ----------
confidence.measurement: based_on sensor_quality, calibration, freshness, redundancy
confidence.topology: based_on breaker_telemetry and verified_network_configuration
confidence.inference: lower_when data_missing or model_uncertain
confidence.policy: never_override_protection_or_interlocks_due_to_high_model_confidence
# ---------- SEMANTIC_EQUIVALENCE ----------
equivalent "microgrid" ~ "local controllable electrical network" within defined_operating_boundary
equivalent "PCC" ~ "point of common coupling"
equivalent "islanded mode" ~ "electrically separated operation with local supply"
distinguish "microgrid" from "uncontrolled distributed generation cluster"
distinguish "grid-forming inverter" from "grid-following inverter"
# ---------- FLOW_HASH ----------
flow_hash.algorithm: "SHA-256"
flow_hash.scope: "canonical UTF-8 flow content excluding any populated hash field"
flow_hash.value: "COMPUTE_ON_PUBLICATION"
# ---------- UPDATE_MODEL ----------
update.trigger: [topology_change, protection_setting_change, asset_change, operating_policy_change, validated_new_evidence]
update.require: source_traceability and human_review_for_safety_critical_changes
update.versioning: semantic_version
update.preserve: previous_version and change_log
# ---------- SAFETY ----------
constraint: "This ontology is a conceptual reasoning model, not a certified protection scheme or operational switching procedure."
constraint: "All switching, islanding and reconnection actions require approved engineering controls, interlocks and authorised personnel."
constraint: "Never bypass electrical protection, isolation procedures or statutory requirements."
Download Code
Copy to Clipboard