@tellegen/engine 0.4.1 → 0.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +33 -0
- package/dist/acopf-protocol.d.ts +20 -0
- package/dist/acopf-protocol.d.ts.map +1 -0
- package/dist/acopf-protocol.js +2 -0
- package/dist/acopf-protocol.js.map +1 -0
- package/dist/acopf-wasi.d.ts +29 -0
- package/dist/acopf-wasi.d.ts.map +1 -0
- package/dist/acopf-wasi.js +91 -0
- package/dist/acopf-wasi.js.map +1 -0
- package/dist/acopf-worker.d.ts +2 -0
- package/dist/acopf-worker.d.ts.map +1 -0
- package/dist/acopf-worker.js +86 -0
- package/dist/acopf-worker.js.map +1 -0
- package/dist/acopf.d.ts +19 -0
- package/dist/acopf.d.ts.map +1 -0
- package/dist/acopf.js +84 -0
- package/dist/acopf.js.map +1 -0
- package/dist/acopf.test.d.ts +2 -0
- package/dist/acopf.test.d.ts.map +1 -0
- package/dist/acopf.test.js +91 -0
- package/dist/acopf.test.js.map +1 -0
- package/dist/generated/api-types.d.ts +110 -4
- package/dist/generated/api-types.d.ts.map +1 -1
- package/dist/generated/api-types.js +3 -3
- package/dist/generated/study-schema.d.ts.map +1 -1
- package/dist/generated/study-schema.js +1 -1
- package/dist/generated/study-schema.js.map +1 -1
- package/dist/generated/study-types.d.ts +54 -1
- package/dist/generated/study-types.d.ts.map +1 -1
- package/dist/generated/study-types.js +1 -1
- package/dist/generated/synth-schema.d.ts.map +1 -1
- package/dist/generated/synth-schema.js +1 -1
- package/dist/generated/synth-schema.js.map +1 -1
- package/dist/generated/synth-types.d.ts +1 -0
- package/dist/generated/synth-types.d.ts.map +1 -1
- package/dist/generated/synth-types.js +1 -1
- package/dist/index.d.ts +129 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +21 -5
- package/dist/index.js.map +1 -1
- package/dist/protocol.d.ts +4 -0
- package/dist/protocol.d.ts.map +1 -1
- package/dist/protocol.js +2 -0
- package/dist/protocol.js.map +1 -1
- package/dist/wasm-pkg/tellegen.d.ts +8 -0
- package/dist/wasm-pkg/tellegen.js +32 -1
- package/dist/wasm-pkg/tellegen_bg.wasm +0 -0
- package/dist/wasm-pkg/tellegen_bg.wasm.d.ts +1 -0
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export declare const ENGINE_VERSION: "0.4.
|
|
2
|
-
export declare const API_SOURCE_SHA256: "
|
|
1
|
+
export declare const ENGINE_VERSION: "0.4.3";
|
|
2
|
+
export declare const API_SOURCE_SHA256: "70037546522df410fbb9fc4eee279c72bf46c968e52bdbc77f74705175e73e04";
|
|
3
3
|
export declare const FORMULATION_IDS: readonly ["dcpf", "dcopf", "acpf", "socwr", "acopf"];
|
|
4
4
|
export type FormulationId = (typeof FORMULATION_IDS)[number];
|
|
5
5
|
export declare const SOLVE_STATUSES: readonly ["optimal", "feasible"];
|
|
@@ -42,13 +42,15 @@ export type Parameter = {
|
|
|
42
42
|
};
|
|
43
43
|
} | {
|
|
44
44
|
Transformer: TapKind;
|
|
45
|
-
} | 'Switching';
|
|
45
|
+
} | 'Switching' | 'ConstraintLimit';
|
|
46
46
|
export type ElementId = {
|
|
47
47
|
Bus: number;
|
|
48
48
|
} | {
|
|
49
49
|
Branch: number;
|
|
50
50
|
} | {
|
|
51
51
|
Generator: number;
|
|
52
|
+
} | {
|
|
53
|
+
Constraint: number;
|
|
52
54
|
};
|
|
53
55
|
export interface SensRequest {
|
|
54
56
|
operand: Operand;
|
|
@@ -60,9 +62,48 @@ export interface Edits {
|
|
|
60
62
|
deltas?: DemandDeltas;
|
|
61
63
|
rates?: BranchRatingDeltas;
|
|
62
64
|
}
|
|
65
|
+
/** Where the AC power flow starts: the setpoint flat start, or the case's stored bus voltages. */
|
|
66
|
+
export type PowerFlowStart = 'flat' | 'case';
|
|
67
|
+
export type ConstraintTermKind = 'branch_flow' | 'bus_injection' | 'generator';
|
|
68
|
+
/** `coefficient` times the MW quantity `kind` names at `element` (an element id
|
|
69
|
+
* or PowerIO row uid). */
|
|
70
|
+
export interface ConstraintTerm {
|
|
71
|
+
kind: ConstraintTermKind;
|
|
72
|
+
element: number | string;
|
|
73
|
+
coefficient: number;
|
|
74
|
+
}
|
|
75
|
+
/** A DC OPF linear constraint, such as an interface or transfer limit:
|
|
76
|
+
* `lower <= sum(coefficient * quantity) <= upper` in MW. Either limit may be
|
|
77
|
+
* omitted, not both; equal limits state an equality. */
|
|
78
|
+
export interface LinearConstraint {
|
|
79
|
+
id: string;
|
|
80
|
+
terms: ConstraintTerm[];
|
|
81
|
+
lower?: number;
|
|
82
|
+
upper?: number;
|
|
83
|
+
}
|
|
84
|
+
/** Which thermal limits a DC OPF may enforce. Branch keys are element ids or uids. */
|
|
85
|
+
export type ThermalLimits = 'all' | 'rated' | {
|
|
86
|
+
branches: (number | string)[];
|
|
87
|
+
};
|
|
88
|
+
export interface LazyLimits {
|
|
89
|
+
max_rounds?: number;
|
|
90
|
+
near_binding?: number;
|
|
91
|
+
}
|
|
92
|
+
/** Which limits the DC OPF program carries, and whether thermal limits are found lazily. */
|
|
93
|
+
export interface LimitOptions {
|
|
94
|
+
angle_difference?: boolean;
|
|
95
|
+
thermal?: ThermalLimits;
|
|
96
|
+
lazy?: LazyLimits;
|
|
97
|
+
}
|
|
63
98
|
export interface SolveRequest {
|
|
64
99
|
formulation?: FormulationId;
|
|
65
100
|
edits?: Edits;
|
|
101
|
+
/** `acpf` only; other formulations refuse `'case'`. Defaults to `'flat'`. */
|
|
102
|
+
start?: PowerFlowStart;
|
|
103
|
+
/** Linear constraints, accepted by `dcopf` only. */
|
|
104
|
+
constraints?: LinearConstraint[];
|
|
105
|
+
/** DC OPF only. */
|
|
106
|
+
limits?: LimitOptions;
|
|
66
107
|
sensitivities?: SensRequest[];
|
|
67
108
|
}
|
|
68
109
|
export interface SolveIteration {
|
|
@@ -75,7 +116,38 @@ export type NewtonIterations = {
|
|
|
75
116
|
count: number;
|
|
76
117
|
residual: number;
|
|
77
118
|
};
|
|
78
|
-
export
|
|
119
|
+
export interface AcOpfResiduals {
|
|
120
|
+
active_balance_mw: number;
|
|
121
|
+
reactive_balance_mvar: number;
|
|
122
|
+
voltage_bounds_pu: number;
|
|
123
|
+
active_generation_bounds_mw: number;
|
|
124
|
+
reactive_generation_bounds_mvar: number;
|
|
125
|
+
reference_angles_rad: number;
|
|
126
|
+
angle_limits_rad: number;
|
|
127
|
+
thermal_limits_mva: number;
|
|
128
|
+
piecewise_epigraph_cost: number;
|
|
129
|
+
objective_relative_error: number;
|
|
130
|
+
}
|
|
131
|
+
export interface NlpIterations {
|
|
132
|
+
nlp_iterations: number;
|
|
133
|
+
/** Maximum independent P/Q mismatch in MW/MVAr. */
|
|
134
|
+
primal_residual: number;
|
|
135
|
+
residuals?: AcOpfResiduals;
|
|
136
|
+
solver_status: string;
|
|
137
|
+
solver_constraint_violation: number;
|
|
138
|
+
solver_kkt_error: number;
|
|
139
|
+
model_fingerprint: string;
|
|
140
|
+
/** Base verdict and work across all attempts (older assets omit these). */
|
|
141
|
+
base_solver_status?: string;
|
|
142
|
+
total_nlp_iterations?: number;
|
|
143
|
+
/** Restoration entries in the selected solve. */
|
|
144
|
+
restoration_calls?: number;
|
|
145
|
+
/** Restoration entries in the original solve. */
|
|
146
|
+
base_restoration_calls?: number;
|
|
147
|
+
recovery_attempts?: string[];
|
|
148
|
+
recovered_by?: string;
|
|
149
|
+
}
|
|
150
|
+
export type Iterations = SolveIteration[] | NewtonIterations | NlpIterations;
|
|
79
151
|
export interface BusScalar {
|
|
80
152
|
bus: number;
|
|
81
153
|
/** powerio row uid, present when the solved network carried uids. */
|
|
@@ -120,6 +192,35 @@ export interface SensitivityMatrix {
|
|
|
120
192
|
cols: ColMeta[];
|
|
121
193
|
units: string;
|
|
122
194
|
}
|
|
195
|
+
/** One DC OPF solve run under LimitOptions. */
|
|
196
|
+
export interface LimitRound {
|
|
197
|
+
enforced: number;
|
|
198
|
+
violated: number;
|
|
199
|
+
added: number;
|
|
200
|
+
max_loading: number;
|
|
201
|
+
variables: number;
|
|
202
|
+
rows: number;
|
|
203
|
+
ipm_iterations: number;
|
|
204
|
+
}
|
|
205
|
+
/** The solved state of one LinearConstraint. `shadow_price` is
|
|
206
|
+
* `-d objective / d limit` in objective units per MW: positive when the upper
|
|
207
|
+
* limit binds, negative when the lower limit binds. */
|
|
208
|
+
export interface ConstraintResult {
|
|
209
|
+
id: string;
|
|
210
|
+
value: number;
|
|
211
|
+
lower?: number;
|
|
212
|
+
upper?: number;
|
|
213
|
+
shadow_price?: number;
|
|
214
|
+
binding: boolean;
|
|
215
|
+
}
|
|
216
|
+
/** How a solve treated the network's islands. `code` is
|
|
217
|
+
* 'island_deenergized', 'island_reference_designated', or
|
|
218
|
+
* 'island_extra_reference'; `buses` are original bus ids. */
|
|
219
|
+
export interface SolveDiagnostic {
|
|
220
|
+
code: string;
|
|
221
|
+
message: string;
|
|
222
|
+
buses: number[];
|
|
223
|
+
}
|
|
123
224
|
export interface SolveResponse {
|
|
124
225
|
formulation: FormulationId;
|
|
125
226
|
status: SolveStatus;
|
|
@@ -133,12 +234,17 @@ export interface SolveResponse {
|
|
|
133
234
|
injections?: BusInjection[];
|
|
134
235
|
flows?: BranchFlow[];
|
|
135
236
|
dispatch?: GenDispatch[];
|
|
237
|
+
constraints?: ConstraintResult[];
|
|
238
|
+
diagnostics?: SolveDiagnostic[];
|
|
239
|
+
limit_rounds?: LimitRound[];
|
|
136
240
|
sensitivities?: SensitivityMatrix[];
|
|
137
241
|
}
|
|
138
242
|
export interface ProblemCaps {
|
|
139
243
|
formulation: FormulationId;
|
|
140
244
|
available: boolean;
|
|
141
245
|
blocks: string[];
|
|
246
|
+
/** Term kinds accepted in SolveRequest.constraints; empty when refused. */
|
|
247
|
+
constraints?: ConstraintTermKind[];
|
|
142
248
|
operands?: Operand[];
|
|
143
249
|
parameters?: Parameter[];
|
|
144
250
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,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B,SAAS,EAAE,MAAM,CAAC;IAClB,sEAAsE;IACtE,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,4EAA4E;IAC5E,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;CACzC;AAED,MAAM,WAAW,WAAW;IAC3B,oEAAoE;IACpE,kBAAkB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACnC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,wCAAwC;IACxC,KAAK,EAAE,MAAM,CAAC;IACd,2CAA2C;IAC3C,QAAQ,EAAE,MAAM,CAAC;IACjB,uEAAuE;IACvE,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,0EAA0E;IAC1E,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,KAAK,EAAE,MAAM,CAAC;CACd;AAED;yDACyD;AACzD,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,GAAG,MAAM,EAAE,MAAM,CAAC,CAAC;AAE3D,MAAM,MAAM,kBAAkB,GAAG,MAAM,CAAC,MAAM,GAAG,MAAM,EAAE,MAAM,CAAC,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// Generated by packages/engine/scripts/generate-types.mjs.
|
|
2
2
|
// Rust source: crates/tellegen/src/api.rs
|
|
3
|
-
// Rust source sha256:
|
|
4
|
-
export const ENGINE_VERSION = "0.4.
|
|
5
|
-
export const API_SOURCE_SHA256 = "
|
|
3
|
+
// Rust source sha256: 70037546522df410fbb9fc4eee279c72bf46c968e52bdbc77f74705175e73e04
|
|
4
|
+
export const ENGINE_VERSION = "0.4.3";
|
|
5
|
+
export const API_SOURCE_SHA256 = "70037546522df410fbb9fc4eee279c72bf46c968e52bdbc77f74705175e73e04";
|
|
6
6
|
export const FORMULATION_IDS = ["dcpf", "dcopf", "acpf", "socwr", "acopf"];
|
|
7
7
|
export const SOLVE_STATUSES = ["optimal", "feasible"];
|
|
8
8
|
//# sourceMappingURL=api-types.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"study-schema.d.ts","sourceRoot":"","sources":["../../src/generated/study-schema.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,
|
|
1
|
+
{"version":3,"file":"study-schema.d.ts","sourceRoot":"","sources":["../../src/generated/study-schema.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAA8ytC,CAAC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// Generated from the Rust Study types.
|
|
2
|
-
export const studySchema = { "$defs": { "ArtifactKind": { "enum": ["powerio_ir", "geo_layer", "evidence"], "type": "string" }, "Bound": { "description": "A min or max bound, e.g. the lower/upper voltage-magnitude limit.", "enum": ["Min", "Max"], "type": "string" }, "BranchFlow": { "description": "Branch flows, keyed by original branch id (plus the row uid when carried, as in\n[`BusScalar`]). `pf` (from-end active, MW) and `loading` (|S|/limit,\ndimensionless) are present on every formulation that has flows; the reactive\nand to-end legs are `None` on the DC paths.", "properties": { "branch": { "format": "uint", "minimum": 0, "type": "integer" }, "loading": { "format": "double", "type": "number" }, "pf": { "format": "double", "type": "number" }, "pt": { "format": "double", "type": ["number", "null"] }, "qf": { "format": "double", "type": ["number", "null"] }, "qt": { "format": "double", "type": ["number", "null"] }, "uid": { "type": ["string", "null"] } }, "required": ["branch", "pf", "loading"], "type": "object" }, "BranchScalar": { "description": "A branch-indexed voltage product, in squared per unit.", "properties": { "branch": { "format": "uint", "minimum": 0, "type": "integer" }, "value": { "format": "double", "type": "number" } }, "required": ["branch", "value"], "type": "object" }, "BusInjection": { "description": "A nodal net injection (MW / MVAr), keyed by original bus id (plus the row uid\nwhen carried, as in [`BusScalar`]). Injections describe the net nodal power balance.", "properties": { "bus": { "format": "uint", "minimum": 0, "type": "integer" }, "p": { "format": "double", "type": "number" }, "q": { "format": "double", "type": "number" }, "uid": { "type": ["string", "null"] } }, "required": ["bus", "p", "q"], "type": "object" }, "BusScalar": { "description": "A scalar keyed by original bus id (LMP, voltage, angle, squared magnitude).\n`uid` is the bus's powerio row uid when the solved network carried one, so an\noverlay can re-key on stable identity instead of the positional id.", "properties": { "bus": { "format": "uint", "minimum": 0, "type": "integer" }, "uid": { "type": ["string", "null"] }, "value": { "format": "double", "type": "number" } }, "required": ["bus", "value"], "type": "object" }, "Camera": { "additionalProperties": false, "properties": { "bearing": { "format": "double", "type": "number" }, "center": { "items": { "format": "double", "type": "number" }, "maxItems": 2, "minItems": 2, "type": "array" }, "pitch": { "format": "double", "type": "number" }, "zoom": { "format": "double", "type": "number" } }, "required": ["center", "zoom", "bearing", "pitch"], "type": "object" }, "ColMeta": { "description": "Identity and quantity metadata for one column of a [`SensitivityMatrix`].", "properties": { "element": { "$ref": "#/$defs/ElementId" }, "index": { "description": "Dense index of the element this column varies.", "format": "uint", "minimum": 0, "type": "integer" }, "parameter": { "$ref": "#/$defs/Parameter" } }, "required": ["parameter", "element", "index"], "type": "object" }, "Comparison": { "additionalProperties": false, "properties": { "goal": { "type": ["string", "null"] }, "improvement": { "format": "double", "type": ["number", "null"] }, "left": { "type": "string" }, "left_value": { "format": "double", "type": ["number", "null"] }, "left_view": { "anyOf": [{ "$ref": "#/$defs/SolveResponse" }, { "type": "null" }] }, "right": { "type": "string" }, "right_value": { "format": "double", "type": ["number", "null"] }, "right_view": { "anyOf": [{ "$ref": "#/$defs/SolveResponse" }, { "type": "null" }] } }, "required": ["left", "right"], "type": "object" }, "CostApproximation": { "properties": { "bus": { "format": "uint", "minimum": 0, "type": "integer" }, "generator": { "format": "uint", "minimum": 0, "type": "integer" }, "max_breakpoint_error": { "format": "double", "type": "number" }, "model_cost": { "$ref": "#/$defs/GenCost" }, "rms_breakpoint_error": { "format": "double", "type": "number" }, "source_cost": { "$ref": "#/$defs/GenCost" } }, "required": ["generator", "bus", "source_cost", "model_cost", "rms_breakpoint_error", "max_breakpoint_error"], "type": "object" }, "CostPreparation": { "enum": ["exact", "convex_quadratic_fit"], "type": "string" }, "CostTerm": { "description": "Which generation-cost coefficient: the quadratic `cq` or the linear `cl`.", "enum": ["Quadratic", "Linear"], "type": "string" }, "CreateDisplay": { "additionalProperties": false, "properties": { "camera": { "anyOf": [{ "$ref": "#/$defs/Camera" }, { "type": "null" }] }, "case_id": { "type": "string" }, "diagram_camera": { "anyOf": [{ "$ref": "#/$defs/DiagramCamera" }, { "type": "null" }], "default": null }, "geo_layer": { "type": "string" }, "layers": { "default": [], "items": { "type": "string" }, "type": "array" } }, "required": ["case_id", "geo_layer"], "type": "object" }, "CreateStudy": { "additionalProperties": false, "properties": { "base_input": { "default": null, "description": "Original network data before interactive edits, when available.", "type": ["string", "null"] }, "decisions": { "anyOf": [{ "$ref": "#/$defs/DecisionSpace" }, { "type": "null" }] }, "display": { "anyOf": [{ "$ref": "#/$defs/CreateDisplay" }, { "type": "null" }] }, "formulation": { "enum": ["dcopf", "acpf", "socwr"], "type": "string" }, "id": { "type": "string" }, "input": { "type": "string" }, "interpretation": { "default": "", "type": "string" }, "model_details": { "anyOf": [{ "$ref": "#/$defs/ModelDetails" }, { "type": "null" }] }, "objective": { "anyOf": [{ "$ref": "#/$defs/StudyObjective" }, { "type": "null" }] }, "request": { "default": "", "type": "string" }, "solution": { "description": "A saved solution must belong to the supplied instance.", "type": ["string", "null"] }, "success_value": { "format": "double", "type": ["number", "null"] }, "title": { "type": "string" }, "view": { "anyOf": [{ "$ref": "#/$defs/SolveResponse" }, { "type": "null" }] } }, "required": ["id", "title", "input", "formulation"], "type": "object" }, "DecisionKind": { "enum": ["retain", "reject", "recommend", "apply"], "type": "string" }, "DecisionRecord": { "additionalProperties": false, "properties": { "choice": { "$ref": "#/$defs/DecisionKind" }, "evidence": { "items": { "type": "string" }, "type": "array" }, "experiment": { "type": "string" }, "rationale": { "type": "string" }, "state": { "type": ["string", "null"] } }, "required": ["experiment", "choice", "rationale", "evidence"], "type": "object" }, "DecisionSpace": { "additionalProperties": false, "description": "The feasible set, distinct from both the inner problem and the outer goal.", "properties": { "demand": { "anyOf": [{ "$ref": "#/$defs/DemandConstraint" }, { "type": "null" }] }, "max_changed_elements": { "format": "uint", "maximum": 65536, "minimum": 1, "type": "integer" }, "total_budget": { "format": "double", "minimum": 0, "type": "number" }, "variables": { "items": { "$ref": "#/$defs/DecisionVariable" }, "maxItems": 65536, "minItems": 1, "type": "array" } }, "required": ["variables", "total_budget", "max_changed_elements"], "type": "object" }, "DecisionVariable": { "additionalProperties": false, "description": "Bounds and increments apply to changes from the goal's anchor state in a Study.", "properties": { "budget_weight": { "description": "Budget consumption per absolute unit of intervention.", "format": "double", "type": "number" }, "element": { "$ref": "#/$defs/ElementKey" }, "id": { "maxLength": 128, "minLength": 1, "type": "string" }, "increment": { "format": "double", "type": "number" }, "intervention": { "$ref": "#/$defs/Intervention" }, "lower": { "format": "double", "type": "number" }, "upper": { "format": "double", "type": "number" } }, "required": ["id", "element", "intervention", "lower", "upper", "increment", "budget_weight"], "type": "object" }, "DemandAdjustment": { "additionalProperties": false, "properties": { "bus": { "$ref": "#/$defs/ElementKey" }, "delta_mw": { "description": "Signed increment to the selected state's demand, in MW.", "format": "double", "type": "number" } }, "required": ["bus", "delta_mw"], "type": "object" }, "DemandChange": { "additionalProperties": false, "properties": { "base_mw": { "format": "double", "type": "number" }, "bus": { "$ref": "#/$defs/ElementKey" }, "delta_mw": { "format": "double", "type": "number" }, "demand_mw": { "format": "double", "type": "number" } }, "required": ["bus", "base_mw", "demand_mw", "delta_mw"], "type": "object" }, "DemandConstraint": { "oneOf": [{ "additionalProperties": false, "description": "Allocate this additional MW across the declared demand decisions.", "properties": { "increase_mw": { "format": "double", "type": "number" }, "kind": { "const": "placement", "type": "string" } }, "required": ["kind", "increase_mw"], "type": "object" }, { "additionalProperties": false, "description": "Preserve the existing total MW across the declared demand decisions.", "properties": { "kind": { "const": "redistribution", "type": "string" } }, "required": ["kind"], "type": "object" }] }, "DiagramCamera": { "additionalProperties": false, "properties": { "center": { "items": { "format": "double", "type": "number" }, "maxItems": 2, "minItems": 2, "type": "array" }, "scale": { "format": "double", "type": "number" } }, "required": ["center", "scale"], "type": "object" }, "DisplayContext": { "additionalProperties": false, "properties": { "camera": { "anyOf": [{ "$ref": "#/$defs/Camera" }, { "type": "null" }] }, "case_id": { "type": "string" }, "diagram_camera": { "anyOf": [{ "$ref": "#/$defs/DiagramCamera" }, { "type": "null" }], "default": null }, "geography": { "description": "Content-addressed PowerIO GeoLayer used for display, independent of physics.", "type": "string" }, "layers": { "default": [], "items": { "type": "string" }, "type": "array" } }, "required": ["case_id", "geography"], "type": "object" }, "ElementId": { "description": "A source-id reference for a dense row or column, so a [`SensitivityMatrix`]\nself-describes and the api serializes it without re-deriving id maps.", "oneOf": [{ "additionalProperties": false, "properties": { "Bus": { "format": "uint", "minimum": 0, "type": "integer" } }, "required": ["Bus"], "type": "object" }, { "additionalProperties": false, "properties": { "Branch": { "format": "uint", "minimum": 0, "type": "integer" } }, "required": ["Branch"], "type": "object" }, { "additionalProperties": false, "properties": { "Generator": { "format": "uint", "minimum": 0, "type": "integer" } }, "required": ["Generator"], "type": "object" }] }, "ElementKey": { "oneOf": [{ "type": "integer" }, { "type": "string" }] }, "End": { "description": "Which end of a branch a flow is measured at.", "enum": ["From", "To"], "type": "string" }, "ExperimentKind": { "enum": ["inspection", "sensitivity", "planning", "counterfactual", "challenge", "historical_import"], "type": "string" }, "ExperimentRecord": { "additionalProperties": false, "description": "Stated rationales and evidence references describe observable agent actions.", "properties": { "assessed_recommendation": { "type": ["string", "null"] }, "evidence": { "items": { "type": "string" }, "type": "array" }, "goal": { "type": ["string", "null"] }, "kind": { "$ref": "#/$defs/ExperimentKind" }, "rationale": { "type": "string" }, "result_states": { "items": { "type": "string" }, "type": "array" }, "solve_count": { "format": "uint", "minimum": 0, "type": "integer" }, "start_state": { "description": "Historical imports can lack recoverable electrical state and goal data.", "type": ["string", "null"] }, "termination": { "type": "string" }, "trials": { "items": { "$ref": "#/$defs/TrialRecord" }, "type": "array" } }, "required": ["kind", "rationale", "evidence", "trials", "result_states", "solve_count", "termination"], "type": "object" }, "ExperimentSummary": { "additionalProperties": false, "properties": { "goal": { "type": ["string", "null"] }, "id": { "type": "string" }, "kind": { "$ref": "#/$defs/ExperimentKind" }, "rationale": { "type": "string" }, "result_states": { "items": { "type": "string" }, "type": "array" }, "solve_count": { "format": "uint", "minimum": 0, "type": "integer" }, "start_state": { "type": ["string", "null"] }, "termination": { "type": "string" }, "trial_count": { "format": "uint", "minimum": 0, "type": "integer" } }, "required": ["id", "kind", "rationale", "solve_count", "trial_count", "result_states", "termination"], "type": "object" }, "GB": { "description": "Conductance `g` or susceptance `b`, the real/imaginary parts of an admittance.", "enum": ["Conductance", "Susceptance"], "type": "string" }, "GenCost": { "description": "A generator cost curve (`mpc.gencost` row).", "properties": { "coeffs": { "description": "Raw coefficients, highest order first for the polynomial model:\n`[c_{k-1}, …, c1, c0]`.", "items": { "format": "double", "type": "number" }, "type": "array" }, "model": { "description": "1 = piecewise linear, 2 = polynomial.", "format": "uint8", "maximum": 255, "minimum": 0, "type": "integer" }, "ncost": { "description": "Number of cost coefficients (polynomial) or breakpoints (piecewise).", "format": "uint", "minimum": 0, "type": "integer" }, "shutdown": { "format": "double", "type": "number" }, "startup": { "format": "double", "type": "number" } }, "required": ["model", "startup", "shutdown", "ncost", "coeffs"], "type": "object" }, "GenDispatch": { "description": "Generator dispatch, keyed by original generator id. `qg` is `None` on the DC paths.", "properties": { "bus": { "description": "Original bus identity, allowing exact aggregation of co-located dispatch.", "format": "uint", "minimum": 0, "type": ["integer", "null"] }, "gen": { "format": "uint", "minimum": 0, "type": "integer" }, "pg": { "format": "double", "type": "number" }, "qg": { "format": "double", "type": ["number", "null"] } }, "required": ["gen", "pg"], "type": "object" }, "GoalRevision": { "additionalProperties": false, "description": "A goal revision retains its own anchor and interpretation.", "properties": { "anchor_state": { "type": "string" }, "decisions": { "$ref": "#/$defs/DecisionSpace" }, "interpretation": { "type": "string" }, "objective": { "$ref": "#/$defs/StudyObjective" }, "parent": { "type": ["string", "null"] }, "request": { "type": "string" }, "success_value": { "format": "double", "type": ["number", "null"] } }, "required": ["anchor_state", "request", "interpretation", "objective", "decisions"], "type": "object" }, "Intervention": { "description": "A numerical intervention supported by the existing solvers.", "enum": ["branch_rating", "active_demand"], "type": "string" }, "Iterations": { "anyOf": [{ "description": "Interior-point iterate trace (dcopf / socwr).", "items": { "$ref": "#/$defs/SolveIteration" }, "type": "array" }, { "description": "Newton iteration count and final infinity-norm mismatch (acpf).", "properties": { "count": { "format": "uint", "minimum": 0, "type": "integer" }, "residual": { "format": "double", "type": "number" } }, "required": ["count", "residual"], "type": "object" }], "description": "The convergence record. OPF paths carry the full interior-point trace (for the\nsolve-card sparkline); the AC power flow carries its Newton count and final\nmismatch. Untagged: the OPF arm serializes to the same bare array the DC OPF\nalways returned." }, "ModelDetails": { "properties": { "approximations": { "items": { "$ref": "#/$defs/CostApproximation" }, "type": "array" }, "method": { "$ref": "#/$defs/CostPreparation" }, "model": { "type": "string" }, "quantity": { "type": "string" }, "source": { "type": "string" }, "units": { "type": "string" } }, "required": ["method", "source", "model", "quantity", "units", "approximations"], "type": "object" }, "ObservableWeight": { "additionalProperties": false, "description": "A weighted observable in the units reported by the selected formulation.", "properties": { "element": { "$ref": "#/$defs/ElementKey" }, "weight": { "format": "double", "type": "number" } }, "required": ["element", "weight"], "type": "object" }, "Operand": { "description": "What a sensitivity is taken *of*, named for the physical power quantity rather\nthan a formulation's internal variable. The orthogonal sub-axes (active/reactive,\nfrom/to, voltage representation) are visible to the type system; each formulation\nmaps a request to its own KKT rows or returns [`SensError::Unsupported`].\n\nThe dialects fold into one vocabulary: DC `Angle` is `Voltage(Angle)`, the conic\nsquared magnitude `w` is `Voltage(Squared)`, the nodal price is `Price(Active)`.", "oneOf": [{ "additionalProperties": false, "description": "Nodal-balance dual (the LMP for active power, the reactive price for\nreactive), per bus.", "properties": { "Price": { "$ref": "#/$defs/Power" } }, "required": ["Price"], "type": "object" }, { "additionalProperties": false, "description": "Generator dispatch `pg` / `qg`, per generator.", "properties": { "Dispatch": { "$ref": "#/$defs/Power" } }, "required": ["Dispatch"], "type": "object" }, { "additionalProperties": false, "description": "Branch active/reactive flow at the from/to end, per branch.", "properties": { "Flow": { "properties": { "end": { "$ref": "#/$defs/End" }, "power": { "$ref": "#/$defs/Power" } }, "required": ["power", "end"], "type": "object" } }, "required": ["Flow"], "type": "object" }, { "additionalProperties": false, "description": "Bus voltage in the formulation's representation (`vm` / `va` / `w` / `wr` /\n`wi`), per bus.", "properties": { "Voltage": { "$ref": "#/$defs/VoltageKind" } }, "required": ["Voltage"], "type": "object" }] }, "Parameter": { "description": "What a sensitivity is taken *with respect to* — the parameter whose hand-derived\n`dK/dp` column drives the solve.", "oneOf": [{ "additionalProperties": false, "description": "Bus active/reactive demand `pd` / `qd`, per bus.", "properties": { "Demand": { "$ref": "#/$defs/Power" } }, "required": ["Demand"], "type": "object" }, { "additionalProperties": false, "description": "Generation cost coefficient, per generator.", "properties": { "Cost": { "$ref": "#/$defs/CostTerm" } }, "required": ["Cost"], "type": "object" }, { "const": "LineLimit", "description": "DC thermal limit `fmax` / AC-conic apparent-power `|S|` limit, per branch.", "type": "string" }, { "additionalProperties": false, "description": "Branch series admittance `g` / `b`, per branch.", "properties": { "SeriesAdmittance": { "$ref": "#/$defs/GB" } }, "required": ["SeriesAdmittance"], "type": "object" }, { "additionalProperties": false, "description": "Bus shunt admittance `gs` / `bs`, per bus.", "properties": { "ShuntAdmittance": { "$ref": "#/$defs/GB" } }, "required": ["ShuntAdmittance"], "type": "object" }, { "additionalProperties": false, "description": "Voltage-magnitude bound right-hand side (the `w = |V|²` bound), per bus.", "properties": { "VoltageBound": { "$ref": "#/$defs/Bound" } }, "required": ["VoltageBound"], "type": "object" }, { "additionalProperties": false, "description": "Generator output bound right-hand side (`pmax` / `pmin` / `qmax` / `qmin`),\nper generator.", "properties": { "GenBound": { "properties": { "bound": { "$ref": "#/$defs/Bound" }, "power": { "$ref": "#/$defs/Power" } }, "required": ["power", "bound"], "type": "object" } }, "required": ["GenBound"], "type": "object" }, { "additionalProperties": false, "description": "Transformer tap ratio / phase shift, per branch.", "properties": { "Transformer": { "$ref": "#/$defs/TapKind" } }, "required": ["Transformer"], "type": "object" }, { "const": "Switching", "description": "Branch switching state `sw` in `[0, 1]`, per branch.", "type": "string" }] }, "Power": { "description": "Active or reactive power. The orthogonal P/Q sub-axis shared by prices,\ndispatch, flows, and demand.", "enum": ["Active", "Reactive"], "type": "string" }, "Problem": { "description": "Which problem to solve. The convex/power flow solve paths, as the lowercase JSON\ntags `\"dcpf\"`/`\"dcopf\"`/`\"acpf\"`/`\"socwr\"`. A plain (not internally tagged) enum\nso a request that omits it defaults to [`DcOpf`](Problem::DcOpf), and `{}` is a\nvalid base-case DC OPF request.\n\nThe `\"acopf\"` tag (full nonlinear AC OPF) is retained for wire-format stability\nbut is not solved by this build: [`capabilities_json`] reports it unavailable and\nrequesting it returns a clean `Err`.", "oneOf": [{ "const": "dcpf", "description": "DC power flow: angles and flows at the fixed generator setpoints. No prices,\nno dispatch, no sensitivity.", "type": "string" }, { "const": "dcopf", "description": "DC OPF: the LMP / dispatch / flow workhorse. Differentiable via the DC KKT.", "type": "string" }, { "const": "acpf", "description": "AC polar Newton power flow. Voltages and nodal injections. Differentiable\nvia the AC Newton system.", "type": "string" }, { "const": "socwr", "description": "SOCWR (Jabr) conic relaxation of AC OPF. Differentiable via the conic KKT.", "type": "string" }, { "const": "acopf", "description": "Full nonlinear AC OPF. Not available in this build (the dispatch errors\ncleanly); the tag is kept so the JSON format stays stable.", "type": "string" }] }, "RowMeta": { "description": "Identity and quantity metadata for one row of a [`SensitivityMatrix`].", "properties": { "element": { "$ref": "#/$defs/ElementId" }, "index": { "description": "Dense index of the element this row reports.", "format": "uint", "minimum": 0, "type": "integer" }, "operand": { "$ref": "#/$defs/Operand" } }, "required": ["operand", "element", "index"], "type": "object" }, "SearchOptions": { "additionalProperties": false, "properties": { "beam_width": { "format": "uint", "maximum": 32, "minimum": 1, "type": "integer" }, "max_iterations": { "format": "uint", "maximum": 256, "minimum": 0, "type": "integer" }, "max_solves": { "format": "uint", "maximum": 256, "minimum": 0, "type": "integer" }, "min_improvement": { "format": "double", "minimum": 0, "type": "number" } }, "required": ["max_solves", "beam_width", "max_iterations", "min_improvement"], "type": "object" }, "SensitivityMatrix": { "description": "A self-describing sensitivity result: `values[r][c] = d(rows[r])/d(cols[c])`,\nwith row and column metadata naming each quantity and its source element, and the\nserved-unit label.", "properties": { "cols": { "items": { "$ref": "#/$defs/ColMeta" }, "type": "array" }, "rows": { "items": { "$ref": "#/$defs/RowMeta" }, "type": "array" }, "units": { "type": "string" }, "values": { "description": "`values[r][c] = d(operand_r)/d(parameter_c)`, in the units named by `units`. The\nengine produces per-unit values; the api edge rescales to served units.", "items": { "items": { "format": "double", "type": "number" }, "type": "array" }, "type": "array" } }, "required": ["values", "rows", "cols", "units"], "type": "object" }, "SolveIteration": { "description": "One interior-point iterate: the iteration index, the primal objective, and\nthe primal and dual residuals. Collected once per Clarabel iteration to draw\nthe convergence plot. Shape matches the frontend `SolveIteration`.", "properties": { "inf_du": { "format": "double", "type": "number" }, "inf_pr": { "format": "double", "type": "number" }, "iter": { "format": "uint32", "minimum": 0, "type": "integer" }, "objective": { "format": "double", "type": "number" } }, "required": ["iter", "objective", "inf_pr", "inf_du"], "type": "object" }, "SolveResponse": { "description": "The formulation-agnostic solve result. A superset: every block is optional, and\neach formulation fills what it produces. Powers are MW/MVAr, nodal values are\nin objective units per selected power unit, angles radians, `vm` per unit, and\n`w = |V|^2` per unit squared. Element ids\nare the original bus/branch/generator ids, so the frontend joins straight onto\nits case.", "properties": { "dispatch": { "items": { "$ref": "#/$defs/GenDispatch" }, "type": ["array", "null"] }, "flows": { "items": { "$ref": "#/$defs/BranchFlow" }, "type": ["array", "null"] }, "formulation": { "$ref": "#/$defs/Problem", "description": "The formulation that produced this, echoed for the client." }, "injections": { "description": "Nodal injections (acpf), MW/MVAr.", "items": { "$ref": "#/$defs/BusInjection" }, "type": ["array", "null"] }, "iterations": { "anyOf": [{ "$ref": "#/$defs/Iterations" }, { "type": "null" }] }, "lmp": { "description": "Active nodal price when the solved OPF declares a network generator\ncost objective. Feasibility solves leave this absent.", "items": { "$ref": "#/$defs/BusScalar" }, "type": ["array", "null"] }, "lmp_q": { "description": "Reactive nodal price. Always `None` in this build; the field is retained for\nwire-format stability.", "items": { "$ref": "#/$defs/BusScalar" }, "type": ["array", "null"] }, "objective": { "format": "double", "type": ["number", "null"] }, "sensitivities": { "description": "One self-describing matrix per requested cell, in request order. Each carries\nits own row/column element ids and the served-unit label.", "items": { "$ref": "#/$defs/SensitivityMatrix" }, "type": "array" }, "status": { "$ref": "#/$defs/SolveStatus" }, "va": { "description": "Voltage angle, radians (every path except socwr, which is W-space).", "items": { "$ref": "#/$defs/BusScalar" }, "type": ["array", "null"] }, "vm": { "description": "Voltage magnitude, per unit (ACPF or square root of SOCWR squared magnitude).", "items": { "$ref": "#/$defs/BusScalar" }, "type": ["array", "null"] }, "w": { "description": "Squared voltage magnitude `w = |V|^2`, per unit squared (socwr). The conic\nrelaxation does not guarantee a globally consistent set of voltage angles.", "items": { "$ref": "#/$defs/BusScalar" }, "type": ["array", "null"] }, "wi": { "items": { "$ref": "#/$defs/BranchScalar" }, "type": ["array", "null"] }, "wr": { "description": "Real and imaginary oriented branch voltage products (SOCWR).", "items": { "$ref": "#/$defs/BranchScalar" }, "type": ["array", "null"] } }, "required": ["formulation", "status"], "type": "object" }, "SolveStatus": { "description": "A solve outcome that succeeded. A failed solve is the `Err` arm of a solve entry.", "oneOf": [{ "const": "optimal", "description": "An OPF reached optimality.", "type": "string" }, { "const": "feasible", "description": "A power flow converged to a feasible point.", "type": "string" }] }, "StateNode": { "additionalProperties": false, "description": "An immutable electrical state. Inspection never implies application.", "properties": { "formulation": { "$ref": "#/$defs/Problem" }, "input": { "type": "string" }, "label": { "type": "string" }, "parent": { "type": ["string", "null"] }, "solution": { "type": ["string", "null"] }, "view": { "type": ["string", "null"] } }, "required": ["formulation", "input", "label"], "type": "object" }, "StudyArtifact": { "additionalProperties": false, "properties": { "kind": { "$ref": "#/$defs/ArtifactKind" }, "text": { "type": "string" } }, "required": ["kind", "text"], "type": "object" }, "StudyBundle": { "additionalProperties": false, "description": "Approvals are intentionally absent from the portable document.", "properties": { "artifacts": { "additionalProperties": { "$ref": "#/$defs/StudyArtifact" }, "type": "object" }, "document": { "$ref": "#/$defs/StudyDocument" } }, "required": ["document", "artifacts"], "type": "object" }, "StudyDocument": { "additionalProperties": false, "description": "A document contains references, while the bundle owns deduplicated artifacts.", "properties": { "active_goal": { "type": ["string", "null"] }, "applied_state": { "type": ["string", "null"] }, "base_input": { "description": "Original network input, retained independently of the starting operating point.", "type": ["string", "null"] }, "decisions": { "additionalProperties": { "$ref": "#/$defs/DecisionRecord" }, "type": "object" }, "display": { "anyOf": [{ "$ref": "#/$defs/DisplayContext" }, { "type": "null" }] }, "experiment_order": { "items": { "type": "string" }, "type": "array" }, "experiments": { "additionalProperties": { "$ref": "#/$defs/ExperimentRecord" }, "type": "object" }, "goals": { "additionalProperties": { "$ref": "#/$defs/GoalRevision" }, "type": "object" }, "id": { "type": "string" }, "inspected_state": { "type": ["string", "null"] }, "model_details": { "anyOf": [{ "$ref": "#/$defs/ModelDetails" }, { "type": "null" }] }, "recommended_state": { "type": ["string", "null"] }, "revision": { "format": "uint64", "minimum": 0, "type": "integer" }, "schema": { "type": "string" }, "states": { "additionalProperties": { "$ref": "#/$defs/StateNode" }, "type": "object" }, "title": { "type": "string" }, "version": { "format": "uint32", "minimum": 0, "type": "integer" } }, "required": ["schema", "version", "id", "title", "revision", "goals", "states", "experiments", "experiment_order", "decisions"], "type": "object" }, "StudyObjective": { "description": "A scalar goal over the exact operating point and explicit interventions.", "oneOf": [{ "additionalProperties": false, "properties": { "kind": { "const": "weighted_observable", "type": "string" }, "operand": { "$ref": "#/$defs/Operand" }, "weights": { "items": { "$ref": "#/$defs/ObservableWeight" }, "maxItems": 65536, "minItems": 1, "type": "array" } }, "required": ["kind", "operand", "weights"], "type": "object" }, { "additionalProperties": false, "properties": { "kind": { "const": "sum", "type": "string" }, "terms": { "items": { "$ref": "#/$defs/StudyObjective" }, "maxItems": 65536, "minItems": 1, "type": "array" } }, "required": ["kind", "terms"], "type": "object" }, { "additionalProperties": false, "properties": { "expression": { "$ref": "#/$defs/StudyObjective" }, "factor": { "format": "double", "type": "number" }, "kind": { "const": "scale", "type": "string" } }, "required": ["kind", "factor", "expression"], "type": "object" }, { "additionalProperties": false, "properties": { "expression": { "$ref": "#/$defs/StudyObjective" }, "kind": { "const": "squared_target", "type": "string" }, "target": { "format": "double", "type": "number" } }, "required": ["kind", "target", "expression"], "type": "object" }, { "additionalProperties": false, "properties": { "decision": { "type": "string" }, "kind": { "const": "intervention_penalty", "type": "string" }, "linear": { "format": "double", "type": "number" }, "quadratic": { "format": "double", "type": "number" } }, "required": ["kind", "decision", "linear", "quadratic"], "type": "object" }] }, "StudyOperation": { "oneOf": [{ "additionalProperties": false, "properties": { "kind": { "const": "inspect", "type": "string" }, "state": { "type": "string" } }, "required": ["kind", "state"], "type": "object" }, { "additionalProperties": false, "properties": { "kind": { "const": "branch", "type": "string" }, "rationale": { "type": "string" }, "state": { "type": "string" } }, "required": ["kind", "state", "rationale"], "type": "object" }, { "additionalProperties": false, "properties": { "goal": { "$ref": "#/$defs/GoalRevision" }, "kind": { "const": "revise_goal", "type": "string" } }, "required": ["kind", "goal"], "type": "object" }, { "additionalProperties": false, "properties": { "goal": { "type": ["string", "null"] }, "kind": { "const": "compare", "type": "string" }, "left": { "type": "string" }, "right": { "type": "string" } }, "required": ["kind", "left", "right"], "type": "object" }, { "additionalProperties": false, "properties": { "goal": { "type": "string" }, "kind": { "const": "propose", "type": "string" }, "options": { "$ref": "#/$defs/SearchOptions" }, "rationale": { "type": "string" }, "state": { "type": "string" } }, "required": ["kind", "state", "goal", "options", "rationale"], "type": "object" }, { "additionalProperties": false, "properties": { "changes": { "items": { "$ref": "#/$defs/DemandAdjustment" }, "maxItems": 65536, "minItems": 1, "type": "array" }, "constrain_to_goal": { "default": true, "type": "boolean" }, "goal": { "type": ["string", "null"] }, "kind": { "const": "edit_demand", "type": "string" }, "rationale": { "type": "string" }, "state": { "type": "string" } }, "required": ["kind", "state", "changes", "rationale"], "type": "object" }, { "additionalProperties": false, "properties": { "goal": { "type": ["string", "null"] }, "kind": { "const": "restore_base", "type": "string" }, "rationale": { "type": "string" }, "state": { "type": "string" } }, "required": ["kind", "state", "rationale"], "type": "object" }, { "additionalProperties": false, "properties": { "assessed_recommendation": { "type": ["string", "null"] }, "evidence": true, "goal": { "type": ["string", "null"] }, "kind": { "const": "record_evidence", "type": "string" }, "rationale": { "type": "string" }, "sensitivity": { "type": "boolean" }, "state": { "type": "string" } }, "required": ["kind", "state", "sensitivity", "rationale", "evidence"], "type": "object" }, { "additionalProperties": false, "description": "The calling UI or native user action must authorize this exact binding.", "properties": { "base_state": { "type": "string" }, "goal": { "type": ["string", "null"] }, "kind": { "const": "apply", "type": "string" }, "proposal": { "type": "string" }, "state": { "type": "string" } }, "required": ["kind", "proposal", "state", "base_state"], "type": "object" }] }, "StudyOperationResult": { "additionalProperties": false, "properties": { "comparison": { "anyOf": [{ "$ref": "#/$defs/Comparison" }, { "type": "null" }] }, "demand_changes": { "default": null, "items": { "$ref": "#/$defs/DemandChange" }, "type": ["array", "null"] }, "experiment": { "type": ["string", "null"] }, "inspected_view": { "anyOf": [{ "$ref": "#/$defs/SolveResponse" }, { "type": "null" }] }, "summary": { "$ref": "#/$defs/StudySummary" } }, "required": ["summary"], "type": "object" }, "StudyRequest": { "additionalProperties": false, "properties": { "expected_revision": { "format": "uint64", "minimum": 0, "type": "integer" }, "operation": { "$ref": "#/$defs/StudyOperation" } }, "required": ["expected_revision", "operation"], "type": "object" }, "StudySummary": { "additionalProperties": false, "properties": { "active_goal": { "maxItems": 2, "minItems": 2, "prefixItems": [{ "type": "string" }, { "$ref": "#/$defs/GoalRevision" }], "type": ["array", "null"] }, "applied_state": { "type": ["string", "null"] }, "experiment_count": { "format": "uint", "minimum": 0, "type": "integer" }, "id": { "type": "string" }, "inspected_state": { "type": ["string", "null"] }, "recent_experiments": { "items": { "$ref": "#/$defs/ExperimentSummary" }, "type": "array" }, "recommended_state": { "type": ["string", "null"] }, "revision": { "format": "uint64", "minimum": 0, "type": "integer" }, "state_count": { "format": "uint", "minimum": 0, "type": "integer" }, "title": { "type": "string" }, "unavailable_historical_states": { "format": "uint", "minimum": 0, "type": "integer" } }, "required": ["id", "title", "revision", "state_count", "experiment_count", "recent_experiments", "unavailable_historical_states"], "type": "object" }, "TapKind": { "description": "A transformer control: the tap ratio or the phase-shift angle.", "enum": ["Ratio", "PhaseShift"], "type": "string" }, "TrialRecord": { "additionalProperties": false, "properties": { "accepted": { "type": "boolean" }, "changes": { "items": { "format": "double", "type": "number" }, "type": "array" }, "evidence": { "items": { "type": "string" }, "type": "array" }, "exact_value": { "format": "double", "type": ["number", "null"] }, "failure": { "type": ["string", "null"] }, "predicted_value": { "format": "double", "type": ["number", "null"] }, "state": { "type": ["string", "null"] } }, "required": ["changes", "accepted", "evidence"], "type": "object" }, "VoltageKind": { "description": "How a voltage operand is represented: polar (`Magnitude`, `Angle`) for the AC\npower flow, or the W-space lift (`Squared` = `|V|²`, `ProductReal` = `Re(Vi Vj*)`,\n`ProductImag` = `Im(Vi Vj*)`) for the conic relaxation.", "enum": ["Magnitude", "Angle", "Squared", "ProductReal", "ProductImag"], "type": "string" } }, "$schema": "https://json-schema.org/draft/2020-12/schema", "properties": { "bundle": { "$ref": "#/$defs/StudyBundle" }, "create": { "$ref": "#/$defs/CreateStudy" }, "request": { "$ref": "#/$defs/StudyRequest" }, "response": { "$ref": "#/$defs/StudyOperationResult" } }, "required": ["bundle", "create", "request", "response"], "title": "StudySchema", "type": "object", "x-rust-source-sha256": "8367802fb3705b500789689bcdae441abd9ee1e2e5acb5ba353ee52298e97807" };
|
|
2
|
+
export const studySchema = { "$defs": { "AcOpfResiduals": { "description": "Independent AC OPF checks, with units stated per family. Objective agreement\nis separate from primal feasibility. Bounds are evaluated only when selected.", "properties": { "active_balance_mw": { "format": "double", "type": "number" }, "active_generation_bounds_mw": { "format": "double", "type": "number" }, "angle_limits_rad": { "format": "double", "type": "number" }, "objective_relative_error": { "format": "double", "type": "number" }, "piecewise_epigraph_cost": { "format": "double", "type": "number" }, "reactive_balance_mvar": { "format": "double", "type": "number" }, "reactive_generation_bounds_mvar": { "format": "double", "type": "number" }, "reference_angles_rad": { "format": "double", "type": "number" }, "thermal_limits_mva": { "format": "double", "type": "number" }, "voltage_bounds_pu": { "format": "double", "type": "number" } }, "required": ["active_balance_mw", "reactive_balance_mvar", "voltage_bounds_pu", "active_generation_bounds_mw", "reactive_generation_bounds_mvar", "reference_angles_rad", "angle_limits_rad", "thermal_limits_mva", "piecewise_epigraph_cost", "objective_relative_error"], "type": "object" }, "ArtifactKind": { "enum": ["powerio_ir", "geo_layer", "evidence"], "type": "string" }, "Bound": { "description": "A min or max bound, e.g. the lower/upper voltage-magnitude limit.", "enum": ["Min", "Max"], "type": "string" }, "BranchFlow": { "description": "Branch flows, keyed by original branch id (plus the row uid when carried, as in\n[`BusScalar`]). `pf` (from-end active, MW) and `loading` (|S|/limit,\ndimensionless) are present on every formulation that has flows; the reactive\nand to-end legs are `None` on the DC paths.", "properties": { "branch": { "format": "uint", "minimum": 0, "type": "integer" }, "loading": { "format": "double", "type": "number" }, "pf": { "format": "double", "type": "number" }, "pt": { "format": "double", "type": ["number", "null"] }, "qf": { "format": "double", "type": ["number", "null"] }, "qt": { "format": "double", "type": ["number", "null"] }, "uid": { "type": ["string", "null"] } }, "required": ["branch", "pf", "loading"], "type": "object" }, "BranchScalar": { "description": "A branch-indexed voltage product, in squared per unit.", "properties": { "branch": { "format": "uint", "minimum": 0, "type": "integer" }, "value": { "format": "double", "type": "number" } }, "required": ["branch", "value"], "type": "object" }, "BusInjection": { "description": "A nodal net injection (MW / MVAr), keyed by original bus id (plus the row uid\nwhen carried, as in [`BusScalar`]). Injections describe the net nodal power balance.", "properties": { "bus": { "format": "uint", "minimum": 0, "type": "integer" }, "p": { "format": "double", "type": "number" }, "q": { "format": "double", "type": "number" }, "uid": { "type": ["string", "null"] } }, "required": ["bus", "p", "q"], "type": "object" }, "BusScalar": { "description": "A scalar keyed by original bus id (LMP, voltage, angle, squared magnitude).\n`uid` is the bus's powerio row uid when the solved network carried one, so an\noverlay can re-key on stable identity instead of the positional id.", "properties": { "bus": { "format": "uint", "minimum": 0, "type": "integer" }, "uid": { "type": ["string", "null"] }, "value": { "format": "double", "type": "number" } }, "required": ["bus", "value"], "type": "object" }, "Camera": { "additionalProperties": false, "properties": { "bearing": { "format": "double", "type": "number" }, "center": { "items": { "format": "double", "type": "number" }, "maxItems": 2, "minItems": 2, "type": "array" }, "pitch": { "format": "double", "type": "number" }, "zoom": { "format": "double", "type": "number" } }, "required": ["center", "zoom", "bearing", "pitch"], "type": "object" }, "ColMeta": { "description": "Identity and quantity metadata for one column of a [`SensitivityMatrix`].", "properties": { "element": { "$ref": "#/$defs/ElementId" }, "index": { "description": "Dense index of the element this column varies.", "format": "uint", "minimum": 0, "type": "integer" }, "parameter": { "$ref": "#/$defs/Parameter" } }, "required": ["parameter", "element", "index"], "type": "object" }, "Comparison": { "additionalProperties": false, "properties": { "goal": { "type": ["string", "null"] }, "improvement": { "format": "double", "type": ["number", "null"] }, "left": { "type": "string" }, "left_value": { "format": "double", "type": ["number", "null"] }, "left_view": { "anyOf": [{ "$ref": "#/$defs/SolveResponse" }, { "type": "null" }] }, "right": { "type": "string" }, "right_value": { "format": "double", "type": ["number", "null"] }, "right_view": { "anyOf": [{ "$ref": "#/$defs/SolveResponse" }, { "type": "null" }] } }, "required": ["left", "right"], "type": "object" }, "ConstraintResult": { "description": "The solved state of one [`LinearConstraint`], in request order. `value`,\n`lower`, and `upper` are MW; `shadow_price` is in objective units per MW, the\nsame units as `lmp`.", "properties": { "binding": { "description": "`value` sits at a limit, within solver tolerance. Always true for an\nequality.", "type": "boolean" }, "id": { "type": "string" }, "lower": { "format": "double", "type": ["number", "null"] }, "shadow_price": { "description": "The objective decrease per MW the binding limit is raised:\n`-d objective / d limit`. Positive when the upper limit binds, negative\nwhen the lower limit binds, zero when neither does. A bus's price then\ndiffers from its island's reference bus's by `-shadow_price` times the\nchange in `value` per MW injected at the bus and withdrawn at that reference.\nAbsent when the declared objective gives prices no economic meaning, as\nfor `lmp`.", "format": "double", "type": ["number", "null"] }, "upper": { "format": "double", "type": ["number", "null"] }, "value": { "description": "`sum(coefficient * quantity)` at the solution.", "format": "double", "type": "number" } }, "required": ["id", "value", "binding"], "type": "object" }, "CostApproximation": { "properties": { "bus": { "format": "uint", "minimum": 0, "type": "integer" }, "generator": { "format": "uint", "minimum": 0, "type": "integer" }, "max_breakpoint_error": { "format": "double", "type": "number" }, "model_cost": { "$ref": "#/$defs/GenCost" }, "rms_breakpoint_error": { "format": "double", "type": "number" }, "source_cost": { "$ref": "#/$defs/GenCost" } }, "required": ["generator", "bus", "source_cost", "model_cost", "rms_breakpoint_error", "max_breakpoint_error"], "type": "object" }, "CostPreparation": { "enum": ["exact", "convex_quadratic_fit"], "type": "string" }, "CostTerm": { "description": "Which generation-cost coefficient: the quadratic `cq` or the linear `cl`.", "enum": ["Quadratic", "Linear"], "type": "string" }, "CreateDisplay": { "additionalProperties": false, "properties": { "camera": { "anyOf": [{ "$ref": "#/$defs/Camera" }, { "type": "null" }] }, "case_id": { "type": "string" }, "diagram_camera": { "anyOf": [{ "$ref": "#/$defs/DiagramCamera" }, { "type": "null" }], "default": null }, "geo_layer": { "type": "string" }, "layers": { "default": [], "items": { "type": "string" }, "type": "array" } }, "required": ["case_id", "geo_layer"], "type": "object" }, "CreateStudy": { "additionalProperties": false, "properties": { "base_input": { "default": null, "description": "Original network data before interactive edits, when available.", "type": ["string", "null"] }, "decisions": { "anyOf": [{ "$ref": "#/$defs/DecisionSpace" }, { "type": "null" }] }, "display": { "anyOf": [{ "$ref": "#/$defs/CreateDisplay" }, { "type": "null" }] }, "formulation": { "enum": ["dcopf", "acpf", "socwr"], "type": "string" }, "id": { "type": "string" }, "input": { "type": "string" }, "interpretation": { "default": "", "type": "string" }, "model_details": { "anyOf": [{ "$ref": "#/$defs/ModelDetails" }, { "type": "null" }] }, "objective": { "anyOf": [{ "$ref": "#/$defs/StudyObjective" }, { "type": "null" }] }, "request": { "default": "", "type": "string" }, "solution": { "description": "A saved solution must belong to the supplied instance.", "type": ["string", "null"] }, "success_value": { "format": "double", "type": ["number", "null"] }, "title": { "type": "string" }, "view": { "anyOf": [{ "$ref": "#/$defs/SolveResponse" }, { "type": "null" }] } }, "required": ["id", "title", "input", "formulation"], "type": "object" }, "DecisionKind": { "enum": ["retain", "reject", "recommend", "apply"], "type": "string" }, "DecisionRecord": { "additionalProperties": false, "properties": { "choice": { "$ref": "#/$defs/DecisionKind" }, "evidence": { "items": { "type": "string" }, "type": "array" }, "experiment": { "type": "string" }, "rationale": { "type": "string" }, "state": { "type": ["string", "null"] } }, "required": ["experiment", "choice", "rationale", "evidence"], "type": "object" }, "DecisionSpace": { "additionalProperties": false, "description": "The feasible set, distinct from both the inner problem and the outer goal.", "properties": { "demand": { "anyOf": [{ "$ref": "#/$defs/DemandConstraint" }, { "type": "null" }] }, "max_changed_elements": { "format": "uint", "maximum": 65536, "minimum": 1, "type": "integer" }, "total_budget": { "format": "double", "minimum": 0, "type": "number" }, "variables": { "items": { "$ref": "#/$defs/DecisionVariable" }, "maxItems": 65536, "minItems": 1, "type": "array" } }, "required": ["variables", "total_budget", "max_changed_elements"], "type": "object" }, "DecisionVariable": { "additionalProperties": false, "description": "Bounds and increments apply to changes from the goal's anchor state in a Study.", "properties": { "budget_weight": { "description": "Budget consumption per absolute unit of intervention.", "format": "double", "type": "number" }, "element": { "$ref": "#/$defs/ElementKey" }, "id": { "maxLength": 128, "minLength": 1, "type": "string" }, "increment": { "format": "double", "type": "number" }, "intervention": { "$ref": "#/$defs/Intervention" }, "lower": { "format": "double", "type": "number" }, "upper": { "format": "double", "type": "number" } }, "required": ["id", "element", "intervention", "lower", "upper", "increment", "budget_weight"], "type": "object" }, "DemandAdjustment": { "additionalProperties": false, "properties": { "bus": { "$ref": "#/$defs/ElementKey" }, "delta_mw": { "description": "Signed increment to the selected state's demand, in MW.", "format": "double", "type": "number" } }, "required": ["bus", "delta_mw"], "type": "object" }, "DemandChange": { "additionalProperties": false, "properties": { "base_mw": { "format": "double", "type": "number" }, "bus": { "$ref": "#/$defs/ElementKey" }, "delta_mw": { "format": "double", "type": "number" }, "demand_mw": { "format": "double", "type": "number" } }, "required": ["bus", "base_mw", "demand_mw", "delta_mw"], "type": "object" }, "DemandConstraint": { "oneOf": [{ "additionalProperties": false, "description": "Allocate this additional MW across the declared demand decisions.", "properties": { "increase_mw": { "format": "double", "type": "number" }, "kind": { "const": "placement", "type": "string" } }, "required": ["kind", "increase_mw"], "type": "object" }, { "additionalProperties": false, "description": "Preserve the existing total MW across the declared demand decisions.", "properties": { "kind": { "const": "redistribution", "type": "string" } }, "required": ["kind"], "type": "object" }] }, "DiagramCamera": { "additionalProperties": false, "properties": { "center": { "items": { "format": "double", "type": "number" }, "maxItems": 2, "minItems": 2, "type": "array" }, "scale": { "format": "double", "type": "number" } }, "required": ["center", "scale"], "type": "object" }, "DisplayContext": { "additionalProperties": false, "properties": { "camera": { "anyOf": [{ "$ref": "#/$defs/Camera" }, { "type": "null" }] }, "case_id": { "type": "string" }, "diagram_camera": { "anyOf": [{ "$ref": "#/$defs/DiagramCamera" }, { "type": "null" }], "default": null }, "geography": { "description": "Content-addressed PowerIO GeoLayer used for display, independent of physics.", "type": "string" }, "layers": { "default": [], "items": { "type": "string" }, "type": "array" } }, "required": ["case_id", "geography"], "type": "object" }, "ElementId": { "description": "A source-id reference for a dense row or column, so a [`SensitivityMatrix`]\nself-describes and the api serializes it without re-deriving id maps.", "oneOf": [{ "additionalProperties": false, "properties": { "Bus": { "format": "uint", "minimum": 0, "type": "integer" } }, "required": ["Bus"], "type": "object" }, { "additionalProperties": false, "properties": { "Branch": { "format": "uint", "minimum": 0, "type": "integer" } }, "required": ["Branch"], "type": "object" }, { "additionalProperties": false, "properties": { "Generator": { "format": "uint", "minimum": 0, "type": "integer" } }, "required": ["Generator"], "type": "object" }, { "additionalProperties": false, "description": "A caller-supplied linear constraint, by its position in the request.", "properties": { "Constraint": { "format": "uint", "minimum": 0, "type": "integer" } }, "required": ["Constraint"], "type": "object" }] }, "ElementKey": { "oneOf": [{ "type": "integer" }, { "type": "string" }] }, "End": { "description": "Which end of a branch a flow is measured at.", "enum": ["From", "To"], "type": "string" }, "ExperimentKind": { "enum": ["inspection", "sensitivity", "planning", "counterfactual", "challenge", "historical_import"], "type": "string" }, "ExperimentRecord": { "additionalProperties": false, "description": "Stated rationales and evidence references describe observable agent actions.", "properties": { "assessed_recommendation": { "type": ["string", "null"] }, "evidence": { "items": { "type": "string" }, "type": "array" }, "goal": { "type": ["string", "null"] }, "kind": { "$ref": "#/$defs/ExperimentKind" }, "rationale": { "type": "string" }, "result_states": { "items": { "type": "string" }, "type": "array" }, "solve_count": { "format": "uint", "minimum": 0, "type": "integer" }, "start_state": { "description": "Historical imports can lack recoverable electrical state and goal data.", "type": ["string", "null"] }, "termination": { "type": "string" }, "trials": { "items": { "$ref": "#/$defs/TrialRecord" }, "type": "array" } }, "required": ["kind", "rationale", "evidence", "trials", "result_states", "solve_count", "termination"], "type": "object" }, "ExperimentSummary": { "additionalProperties": false, "properties": { "goal": { "type": ["string", "null"] }, "id": { "type": "string" }, "kind": { "$ref": "#/$defs/ExperimentKind" }, "rationale": { "type": "string" }, "result_states": { "items": { "type": "string" }, "type": "array" }, "solve_count": { "format": "uint", "minimum": 0, "type": "integer" }, "start_state": { "type": ["string", "null"] }, "termination": { "type": "string" }, "trial_count": { "format": "uint", "minimum": 0, "type": "integer" } }, "required": ["id", "kind", "rationale", "solve_count", "trial_count", "result_states", "termination"], "type": "object" }, "GB": { "description": "Conductance `g` or susceptance `b`, the real/imaginary parts of an admittance.", "enum": ["Conductance", "Susceptance"], "type": "string" }, "GenCost": { "description": "A generator cost curve (`mpc.gencost` row).", "properties": { "coeffs": { "description": "Raw coefficients, highest order first for the polynomial model:\n`[c_{k-1}, …, c1, c0]`.", "items": { "format": "double", "type": "number" }, "type": "array" }, "model": { "description": "1 = piecewise linear, 2 = polynomial.", "format": "uint8", "maximum": 255, "minimum": 0, "type": "integer" }, "ncost": { "description": "Number of cost coefficients (polynomial) or breakpoints (piecewise).", "format": "uint", "minimum": 0, "type": "integer" }, "shutdown": { "format": "double", "type": "number" }, "startup": { "format": "double", "type": "number" } }, "required": ["model", "startup", "shutdown", "ncost", "coeffs"], "type": "object" }, "GenDispatch": { "description": "Generator dispatch, keyed by original generator id. `qg` is `None` on the DC paths.", "properties": { "bus": { "description": "Original bus identity, allowing exact aggregation of co-located dispatch.", "format": "uint", "minimum": 0, "type": ["integer", "null"] }, "gen": { "format": "uint", "minimum": 0, "type": "integer" }, "pg": { "format": "double", "type": "number" }, "qg": { "format": "double", "type": ["number", "null"] } }, "required": ["gen", "pg"], "type": "object" }, "GoalRevision": { "additionalProperties": false, "description": "A goal revision retains its own anchor and interpretation.", "properties": { "anchor_state": { "type": "string" }, "decisions": { "$ref": "#/$defs/DecisionSpace" }, "interpretation": { "type": "string" }, "objective": { "$ref": "#/$defs/StudyObjective" }, "parent": { "type": ["string", "null"] }, "request": { "type": "string" }, "success_value": { "format": "double", "type": ["number", "null"] } }, "required": ["anchor_state", "request", "interpretation", "objective", "decisions"], "type": "object" }, "Intervention": { "description": "A numerical intervention supported by the existing solvers.", "enum": ["branch_rating", "active_demand"], "type": "string" }, "Iterations": { "anyOf": [{ "description": "Interior-point iterate trace (dcopf / socwr).", "items": { "$ref": "#/$defs/SolveIteration" }, "type": "array" }, { "description": "Newton iteration count and final infinity-norm mismatch (acpf).", "properties": { "count": { "format": "uint", "minimum": 0, "type": "integer" }, "residual": { "format": "double", "type": "number" } }, "required": ["count", "residual"], "type": "object" }, { "description": "Nonlinear-program diagnostics. The primal residual is Tellegen's\nindependent maximum P/Q balance mismatch in MW/MVAr; other residuals\nare separated by family below or reported by POUNCE.", "properties": { "base_restoration_calls": { "description": "Restoration entries in the original solve, even when a retry wins.", "format": "uint", "minimum": 0, "type": ["integer", "null"] }, "base_solver_status": { "description": "Status before recovery; absent in older responses.", "type": ["string", "null"] }, "model_fingerprint": { "type": "string" }, "nlp_iterations": { "format": "uint", "minimum": 0, "type": "integer" }, "primal_residual": { "format": "double", "type": "number" }, "recovered_by": { "type": ["string", "null"] }, "recovery_attempts": { "items": { "type": "string" }, "type": "array" }, "residuals": { "anyOf": [{ "$ref": "#/$defs/AcOpfResiduals" }, { "type": "null" }] }, "restoration_calls": { "description": "Restoration entries in the selected solve (not the whole ladder).", "format": "uint", "minimum": 0, "type": ["integer", "null"] }, "solver_constraint_violation": { "format": "double", "type": "number" }, "solver_kkt_error": { "format": "double", "type": "number" }, "solver_status": { "type": "string" }, "total_nlp_iterations": { "description": "Base plus every retry, including rejected attempts.", "format": "uint", "minimum": 0, "type": ["integer", "null"] } }, "required": ["nlp_iterations", "primal_residual", "solver_status", "solver_constraint_violation", "solver_kkt_error", "model_fingerprint"], "type": "object" }], "description": "The convergence record. OPF paths carry the full interior-point trace (for the\nsolve-card sparkline); the AC power flow carries its Newton count and final\nmismatch. Untagged: the OPF arm serializes to the same bare array the DC OPF\nalways returned." }, "LimitRound": { "description": "One solve of a DC OPF run under [`LimitOptions`]: the program it solved and\nhow the solution met the enforceable thermal limits. A run without lazy\nenforcement has one round.", "properties": { "added": { "description": "Limits added for the next round: the unenforced ones the flows violate\nor meet, and those loaded at or above `near_binding`.", "format": "uint", "minimum": 0, "type": "integer" }, "enforced": { "description": "Thermal limits the round's program enforced.", "format": "uint", "minimum": 0, "type": "integer" }, "ipm_iterations": { "description": "Interior-point iterations of the round's solve.", "format": "uint", "minimum": 0, "type": "integer" }, "max_loading": { "description": "The largest loading over the enforceable limits, as a fraction.", "format": "double", "type": "number" }, "rows": { "format": "uint", "minimum": 0, "type": "integer" }, "variables": { "description": "Variables and constraint rows of the round's program.", "format": "uint", "minimum": 0, "type": "integer" }, "violated": { "description": "Enforceable limits the round's solution violated; zero on the last round.", "format": "uint", "minimum": 0, "type": "integer" } }, "required": ["enforced", "violated", "added", "max_loading", "variables", "rows", "ipm_iterations"], "type": "object" }, "ModelDetails": { "properties": { "approximations": { "items": { "$ref": "#/$defs/CostApproximation" }, "type": "array" }, "method": { "$ref": "#/$defs/CostPreparation" }, "model": { "type": "string" }, "quantity": { "type": "string" }, "source": { "type": "string" }, "units": { "type": "string" } }, "required": ["method", "source", "model", "quantity", "units", "approximations"], "type": "object" }, "ObservableWeight": { "additionalProperties": false, "description": "A weighted observable in the units reported by the selected formulation.", "properties": { "element": { "$ref": "#/$defs/ElementKey" }, "weight": { "format": "double", "type": "number" } }, "required": ["element", "weight"], "type": "object" }, "Operand": { "description": "What a sensitivity is taken *of*, named for the physical power quantity rather\nthan a formulation's internal variable. The orthogonal sub-axes (active/reactive,\nfrom/to, voltage representation) are visible to the type system; each formulation\nmaps a request to its own KKT rows or returns [`SensError::Unsupported`].\n\nThe dialects fold into one vocabulary: DC `Angle` is `Voltage(Angle)`, the conic\nsquared magnitude `w` is `Voltage(Squared)`, the nodal price is `Price(Active)`.", "oneOf": [{ "additionalProperties": false, "description": "Nodal-balance dual (the LMP for active power, the reactive price for\nreactive), per bus.", "properties": { "Price": { "$ref": "#/$defs/Power" } }, "required": ["Price"], "type": "object" }, { "additionalProperties": false, "description": "Generator dispatch `pg` / `qg`, per generator.", "properties": { "Dispatch": { "$ref": "#/$defs/Power" } }, "required": ["Dispatch"], "type": "object" }, { "additionalProperties": false, "description": "Branch active/reactive flow at the from/to end, per branch.", "properties": { "Flow": { "properties": { "end": { "$ref": "#/$defs/End" }, "power": { "$ref": "#/$defs/Power" } }, "required": ["power", "end"], "type": "object" } }, "required": ["Flow"], "type": "object" }, { "additionalProperties": false, "description": "Bus voltage in the formulation's representation (`vm` / `va` / `w` / `wr` /\n`wi`), per bus.", "properties": { "Voltage": { "$ref": "#/$defs/VoltageKind" } }, "required": ["Voltage"], "type": "object" }] }, "Parameter": { "description": "What a sensitivity is taken *with respect to* — the parameter whose hand-derived\n`dK/dp` column drives the solve.", "oneOf": [{ "additionalProperties": false, "description": "Bus active/reactive demand `pd` / `qd`, per bus.", "properties": { "Demand": { "$ref": "#/$defs/Power" } }, "required": ["Demand"], "type": "object" }, { "additionalProperties": false, "description": "Generation cost coefficient, per generator.", "properties": { "Cost": { "$ref": "#/$defs/CostTerm" } }, "required": ["Cost"], "type": "object" }, { "const": "LineLimit", "description": "DC thermal limit `fmax` / AC-conic apparent-power `|S|` limit, per branch.", "type": "string" }, { "additionalProperties": false, "description": "Branch series admittance `g` / `b`, per branch.", "properties": { "SeriesAdmittance": { "$ref": "#/$defs/GB" } }, "required": ["SeriesAdmittance"], "type": "object" }, { "additionalProperties": false, "description": "Bus shunt admittance `gs` / `bs`, per bus.", "properties": { "ShuntAdmittance": { "$ref": "#/$defs/GB" } }, "required": ["ShuntAdmittance"], "type": "object" }, { "additionalProperties": false, "description": "Voltage-magnitude bound right-hand side (the `w = |V|²` bound), per bus.", "properties": { "VoltageBound": { "$ref": "#/$defs/Bound" } }, "required": ["VoltageBound"], "type": "object" }, { "additionalProperties": false, "description": "Generator output bound right-hand side (`pmax` / `pmin` / `qmax` / `qmin`),\nper generator.", "properties": { "GenBound": { "properties": { "bound": { "$ref": "#/$defs/Bound" }, "power": { "$ref": "#/$defs/Power" } }, "required": ["power", "bound"], "type": "object" } }, "required": ["GenBound"], "type": "object" }, { "additionalProperties": false, "description": "Transformer tap ratio / phase shift, per branch.", "properties": { "Transformer": { "$ref": "#/$defs/TapKind" } }, "required": ["Transformer"], "type": "object" }, { "const": "Switching", "description": "Branch switching state `sw` in `[0, 1]`, per branch.", "type": "string" }, { "const": "ConstraintLimit", "description": "A shift of both limits of a caller-supplied linear constraint (the\nfixed value of an equality), per constraint in request order.", "type": "string" }] }, "Power": { "description": "Active or reactive power. The orthogonal P/Q sub-axis shared by prices,\ndispatch, flows, and demand.", "enum": ["Active", "Reactive"], "type": "string" }, "Problem": { "description": "Which problem to solve. The convex/power flow solve paths, as the lowercase JSON\ntags `\"dcpf\"`/`\"dcopf\"`/`\"acpf\"`/`\"socwr\"`. A plain (not internally tagged) enum\nso a request that omits it defaults to [`DcOpf`](Problem::DcOpf), and `{}` is a\nvalid base-case DC OPF request.\n\nThe `\"acopf\"` tag enables full nonlinear AC OPF only when the opt-in `acopf`\nfeature is built. Shipping adapters do not forward that feature.", "oneOf": [{ "const": "dcpf", "description": "DC power flow: angles and flows at the fixed generator setpoints. No prices,\nno dispatch, no sensitivity.", "type": "string" }, { "const": "dcopf", "description": "DC OPF: the LMP / dispatch / flow workhorse. Differentiable via the DC KKT.", "type": "string" }, { "const": "acpf", "description": "AC polar Newton power flow. Voltages and nodal injections. Differentiable\nvia the AC Newton system.", "type": "string" }, { "const": "socwr", "description": "SOCWR (Jabr) conic relaxation of AC OPF. Differentiable via the conic KKT.", "type": "string" }, { "const": "acopf", "description": "Full nonlinear AC OPF through the opt-in POUNCE backend.", "type": "string" }] }, "RowMeta": { "description": "Identity and quantity metadata for one row of a [`SensitivityMatrix`].", "properties": { "element": { "$ref": "#/$defs/ElementId" }, "index": { "description": "Dense index of the element this row reports.", "format": "uint", "minimum": 0, "type": "integer" }, "operand": { "$ref": "#/$defs/Operand" } }, "required": ["operand", "element", "index"], "type": "object" }, "SearchOptions": { "additionalProperties": false, "properties": { "beam_width": { "format": "uint", "maximum": 32, "minimum": 1, "type": "integer" }, "max_iterations": { "format": "uint", "maximum": 256, "minimum": 0, "type": "integer" }, "max_solves": { "format": "uint", "maximum": 256, "minimum": 0, "type": "integer" }, "min_improvement": { "format": "double", "minimum": 0, "type": "number" } }, "required": ["max_solves", "beam_width", "max_iterations", "min_improvement"], "type": "object" }, "SensitivityMatrix": { "description": "A self-describing sensitivity result: `values[r][c] = d(rows[r])/d(cols[c])`,\nwith row and column metadata naming each quantity and its source element, and the\nserved-unit label.", "properties": { "cols": { "items": { "$ref": "#/$defs/ColMeta" }, "type": "array" }, "rows": { "items": { "$ref": "#/$defs/RowMeta" }, "type": "array" }, "units": { "type": "string" }, "values": { "description": "`values[r][c] = d(operand_r)/d(parameter_c)`, in the units named by `units`. The\nengine produces per-unit values; the api edge rescales to served units.", "items": { "items": { "format": "double", "type": "number" }, "type": "array" }, "type": "array" } }, "required": ["values", "rows", "cols", "units"], "type": "object" }, "SolveDiagnostic": { "description": "A finding about how the solve treated the network, such as an island left out\nbecause nothing supplies it. `code` is stable for programs; `message` is for\npeople. `buses` names the original ids of the buses concerned.", "properties": { "buses": { "items": { "format": "uint", "minimum": 0, "type": "integer" }, "type": "array" }, "code": { "description": "`island_deenergized`: an island with no in-service generator was left\nout of the solve; its buses carry no results and its load is unserved.\n`island_reference_designated`: a supplied island stated no reference bus,\nso the bus of its largest generator became the island's reference.\n`island_extra_reference`: the AC power flow found several reference\nbuses in one island and kept the first as its slack; the others hold\ntheir voltage magnitude as PV (or PQ) buses.", "type": "string" }, "message": { "type": "string" } }, "required": ["code", "message", "buses"], "type": "object" }, "SolveIteration": { "description": "One interior-point iterate: the iteration index, the primal objective, and\nthe primal and dual residuals. Collected once per Clarabel iteration to draw\nthe convergence plot. Shape matches the frontend `SolveIteration`.", "properties": { "inf_du": { "format": "double", "type": "number" }, "inf_pr": { "format": "double", "type": "number" }, "iter": { "format": "uint32", "minimum": 0, "type": "integer" }, "objective": { "format": "double", "type": "number" } }, "required": ["iter", "objective", "inf_pr", "inf_du"], "type": "object" }, "SolveResponse": { "description": "The formulation-agnostic solve result. A superset: every block is optional, and\neach formulation fills what it produces. Powers are MW/MVAr, nodal values are\nin objective units per selected power unit, angles radians, `vm` per unit, and\n`w = |V|^2` per unit squared. Element ids\nare the original bus/branch/generator ids, so the frontend joins straight onto\nits case.", "properties": { "constraints": { "description": "The request's linear constraints, in request order (dcopf). Absent when\nthe request stated none.", "items": { "$ref": "#/$defs/ConstraintResult" }, "type": ["array", "null"] }, "diagnostics": { "description": "How the solve treated the network's islands. Empty, and omitted, when\nevery island is supplied and referenced as stated.", "items": { "$ref": "#/$defs/SolveDiagnostic" }, "type": "array" }, "dispatch": { "items": { "$ref": "#/$defs/GenDispatch" }, "type": ["array", "null"] }, "flows": { "items": { "$ref": "#/$defs/BranchFlow" }, "type": ["array", "null"] }, "formulation": { "$ref": "#/$defs/Problem", "description": "The formulation that produced this, echoed for the client." }, "injections": { "description": "Nodal injections (acpf), MW/MVAr.", "items": { "$ref": "#/$defs/BusInjection" }, "type": ["array", "null"] }, "iterations": { "anyOf": [{ "$ref": "#/$defs/Iterations" }, { "type": "null" }] }, "limit_rounds": { "description": "The solves a DC OPF ran under the request's `limits` (dcopf with\n`limits` only).", "items": { "$ref": "#/$defs/LimitRound" }, "type": ["array", "null"] }, "lmp": { "description": "Active nodal price when the solved OPF declares a network generator\ncost objective. Feasibility solves leave this absent.", "items": { "$ref": "#/$defs/BusScalar" }, "type": ["array", "null"] }, "lmp_q": { "description": "Reactive nodal price. Always `None` in this build; the field is retained for\nwire-format stability.", "items": { "$ref": "#/$defs/BusScalar" }, "type": ["array", "null"] }, "objective": { "format": "double", "type": ["number", "null"] }, "sensitivities": { "description": "One self-describing matrix per requested cell, in request order. Each carries\nits own row/column element ids and the served-unit label.", "items": { "$ref": "#/$defs/SensitivityMatrix" }, "type": "array" }, "status": { "$ref": "#/$defs/SolveStatus" }, "va": { "description": "Voltage angle, radians (every path except socwr, which is W-space).", "items": { "$ref": "#/$defs/BusScalar" }, "type": ["array", "null"] }, "vm": { "description": "Voltage magnitude, per unit (ACPF or square root of SOCWR squared magnitude).", "items": { "$ref": "#/$defs/BusScalar" }, "type": ["array", "null"] }, "w": { "description": "Squared voltage magnitude `w = |V|^2`, per unit squared (socwr). The conic\nrelaxation does not guarantee a globally consistent set of voltage angles.", "items": { "$ref": "#/$defs/BusScalar" }, "type": ["array", "null"] }, "wi": { "items": { "$ref": "#/$defs/BranchScalar" }, "type": ["array", "null"] }, "wr": { "description": "Real and imaginary oriented branch voltage products (SOCWR).", "items": { "$ref": "#/$defs/BranchScalar" }, "type": ["array", "null"] } }, "required": ["formulation", "status"], "type": "object" }, "SolveStatus": { "description": "A solve outcome that succeeded. A failed solve is the `Err` arm of a solve entry.", "oneOf": [{ "const": "optimal", "description": "An OPF reached optimality.", "type": "string" }, { "const": "feasible", "description": "A power flow or local AC OPF solve reached a validated feasible point.", "type": "string" }] }, "StateNode": { "additionalProperties": false, "description": "An immutable electrical state. Inspection never implies application.", "properties": { "formulation": { "$ref": "#/$defs/Problem" }, "input": { "type": "string" }, "label": { "type": "string" }, "parent": { "type": ["string", "null"] }, "solution": { "type": ["string", "null"] }, "view": { "type": ["string", "null"] } }, "required": ["formulation", "input", "label"], "type": "object" }, "StudyArtifact": { "additionalProperties": false, "properties": { "kind": { "$ref": "#/$defs/ArtifactKind" }, "text": { "type": "string" } }, "required": ["kind", "text"], "type": "object" }, "StudyBundle": { "additionalProperties": false, "description": "Approvals are intentionally absent from the portable document.", "properties": { "artifacts": { "additionalProperties": { "$ref": "#/$defs/StudyArtifact" }, "type": "object" }, "document": { "$ref": "#/$defs/StudyDocument" } }, "required": ["document", "artifacts"], "type": "object" }, "StudyDocument": { "additionalProperties": false, "description": "A document contains references, while the bundle owns deduplicated artifacts.", "properties": { "active_goal": { "type": ["string", "null"] }, "applied_state": { "type": ["string", "null"] }, "base_input": { "description": "Original network input, retained independently of the starting operating point.", "type": ["string", "null"] }, "decisions": { "additionalProperties": { "$ref": "#/$defs/DecisionRecord" }, "type": "object" }, "display": { "anyOf": [{ "$ref": "#/$defs/DisplayContext" }, { "type": "null" }] }, "experiment_order": { "items": { "type": "string" }, "type": "array" }, "experiments": { "additionalProperties": { "$ref": "#/$defs/ExperimentRecord" }, "type": "object" }, "goals": { "additionalProperties": { "$ref": "#/$defs/GoalRevision" }, "type": "object" }, "id": { "type": "string" }, "inspected_state": { "type": ["string", "null"] }, "model_details": { "anyOf": [{ "$ref": "#/$defs/ModelDetails" }, { "type": "null" }] }, "recommended_state": { "type": ["string", "null"] }, "revision": { "format": "uint64", "minimum": 0, "type": "integer" }, "schema": { "type": "string" }, "states": { "additionalProperties": { "$ref": "#/$defs/StateNode" }, "type": "object" }, "title": { "type": "string" }, "version": { "format": "uint32", "minimum": 0, "type": "integer" } }, "required": ["schema", "version", "id", "title", "revision", "goals", "states", "experiments", "experiment_order", "decisions"], "type": "object" }, "StudyObjective": { "description": "A scalar goal over the exact operating point and explicit interventions.", "oneOf": [{ "additionalProperties": false, "properties": { "kind": { "const": "weighted_observable", "type": "string" }, "operand": { "$ref": "#/$defs/Operand" }, "weights": { "items": { "$ref": "#/$defs/ObservableWeight" }, "maxItems": 65536, "minItems": 1, "type": "array" } }, "required": ["kind", "operand", "weights"], "type": "object" }, { "additionalProperties": false, "properties": { "kind": { "const": "sum", "type": "string" }, "terms": { "items": { "$ref": "#/$defs/StudyObjective" }, "maxItems": 65536, "minItems": 1, "type": "array" } }, "required": ["kind", "terms"], "type": "object" }, { "additionalProperties": false, "properties": { "expression": { "$ref": "#/$defs/StudyObjective" }, "factor": { "format": "double", "type": "number" }, "kind": { "const": "scale", "type": "string" } }, "required": ["kind", "factor", "expression"], "type": "object" }, { "additionalProperties": false, "properties": { "expression": { "$ref": "#/$defs/StudyObjective" }, "kind": { "const": "squared_target", "type": "string" }, "target": { "format": "double", "type": "number" } }, "required": ["kind", "target", "expression"], "type": "object" }, { "additionalProperties": false, "properties": { "decision": { "type": "string" }, "kind": { "const": "intervention_penalty", "type": "string" }, "linear": { "format": "double", "type": "number" }, "quadratic": { "format": "double", "type": "number" } }, "required": ["kind", "decision", "linear", "quadratic"], "type": "object" }] }, "StudyOperation": { "oneOf": [{ "additionalProperties": false, "properties": { "kind": { "const": "inspect", "type": "string" }, "state": { "type": "string" } }, "required": ["kind", "state"], "type": "object" }, { "additionalProperties": false, "properties": { "kind": { "const": "branch", "type": "string" }, "rationale": { "type": "string" }, "state": { "type": "string" } }, "required": ["kind", "state", "rationale"], "type": "object" }, { "additionalProperties": false, "properties": { "goal": { "$ref": "#/$defs/GoalRevision" }, "kind": { "const": "revise_goal", "type": "string" } }, "required": ["kind", "goal"], "type": "object" }, { "additionalProperties": false, "properties": { "goal": { "type": ["string", "null"] }, "kind": { "const": "compare", "type": "string" }, "left": { "type": "string" }, "right": { "type": "string" } }, "required": ["kind", "left", "right"], "type": "object" }, { "additionalProperties": false, "properties": { "goal": { "type": "string" }, "kind": { "const": "propose", "type": "string" }, "options": { "$ref": "#/$defs/SearchOptions" }, "rationale": { "type": "string" }, "state": { "type": "string" } }, "required": ["kind", "state", "goal", "options", "rationale"], "type": "object" }, { "additionalProperties": false, "properties": { "changes": { "items": { "$ref": "#/$defs/DemandAdjustment" }, "maxItems": 65536, "minItems": 1, "type": "array" }, "constrain_to_goal": { "default": true, "type": "boolean" }, "goal": { "type": ["string", "null"] }, "kind": { "const": "edit_demand", "type": "string" }, "rationale": { "type": "string" }, "state": { "type": "string" } }, "required": ["kind", "state", "changes", "rationale"], "type": "object" }, { "additionalProperties": false, "properties": { "goal": { "type": ["string", "null"] }, "kind": { "const": "restore_base", "type": "string" }, "rationale": { "type": "string" }, "state": { "type": "string" } }, "required": ["kind", "state", "rationale"], "type": "object" }, { "additionalProperties": false, "properties": { "assessed_recommendation": { "type": ["string", "null"] }, "evidence": true, "goal": { "type": ["string", "null"] }, "kind": { "const": "record_evidence", "type": "string" }, "rationale": { "type": "string" }, "sensitivity": { "type": "boolean" }, "state": { "type": "string" } }, "required": ["kind", "state", "sensitivity", "rationale", "evidence"], "type": "object" }, { "additionalProperties": false, "description": "The calling UI or native user action must authorize this exact binding.", "properties": { "base_state": { "type": "string" }, "goal": { "type": ["string", "null"] }, "kind": { "const": "apply", "type": "string" }, "proposal": { "type": "string" }, "state": { "type": "string" } }, "required": ["kind", "proposal", "state", "base_state"], "type": "object" }] }, "StudyOperationResult": { "additionalProperties": false, "properties": { "comparison": { "anyOf": [{ "$ref": "#/$defs/Comparison" }, { "type": "null" }] }, "demand_changes": { "default": null, "items": { "$ref": "#/$defs/DemandChange" }, "type": ["array", "null"] }, "experiment": { "type": ["string", "null"] }, "inspected_view": { "anyOf": [{ "$ref": "#/$defs/SolveResponse" }, { "type": "null" }] }, "summary": { "$ref": "#/$defs/StudySummary" } }, "required": ["summary"], "type": "object" }, "StudyRequest": { "additionalProperties": false, "properties": { "expected_revision": { "format": "uint64", "minimum": 0, "type": "integer" }, "operation": { "$ref": "#/$defs/StudyOperation" } }, "required": ["expected_revision", "operation"], "type": "object" }, "StudySummary": { "additionalProperties": false, "properties": { "active_goal": { "maxItems": 2, "minItems": 2, "prefixItems": [{ "type": "string" }, { "$ref": "#/$defs/GoalRevision" }], "type": ["array", "null"] }, "applied_state": { "type": ["string", "null"] }, "experiment_count": { "format": "uint", "minimum": 0, "type": "integer" }, "id": { "type": "string" }, "inspected_state": { "type": ["string", "null"] }, "recent_experiments": { "items": { "$ref": "#/$defs/ExperimentSummary" }, "type": "array" }, "recommended_state": { "type": ["string", "null"] }, "revision": { "format": "uint64", "minimum": 0, "type": "integer" }, "state_count": { "format": "uint", "minimum": 0, "type": "integer" }, "title": { "type": "string" }, "unavailable_historical_states": { "format": "uint", "minimum": 0, "type": "integer" } }, "required": ["id", "title", "revision", "state_count", "experiment_count", "recent_experiments", "unavailable_historical_states"], "type": "object" }, "TapKind": { "description": "A transformer control: the tap ratio or the phase-shift angle.", "enum": ["Ratio", "PhaseShift"], "type": "string" }, "TrialRecord": { "additionalProperties": false, "properties": { "accepted": { "type": "boolean" }, "changes": { "items": { "format": "double", "type": "number" }, "type": "array" }, "evidence": { "items": { "type": "string" }, "type": "array" }, "exact_value": { "format": "double", "type": ["number", "null"] }, "failure": { "type": ["string", "null"] }, "predicted_value": { "format": "double", "type": ["number", "null"] }, "state": { "type": ["string", "null"] } }, "required": ["changes", "accepted", "evidence"], "type": "object" }, "VoltageKind": { "description": "How a voltage operand is represented: polar (`Magnitude`, `Angle`) for the AC\npower flow, or the W-space lift (`Squared` = `|V|²`, `ProductReal` = `Re(Vi Vj*)`,\n`ProductImag` = `Im(Vi Vj*)`) for the conic relaxation.", "enum": ["Magnitude", "Angle", "Squared", "ProductReal", "ProductImag"], "type": "string" } }, "$schema": "https://json-schema.org/draft/2020-12/schema", "properties": { "bundle": { "$ref": "#/$defs/StudyBundle" }, "create": { "$ref": "#/$defs/CreateStudy" }, "request": { "$ref": "#/$defs/StudyRequest" }, "response": { "$ref": "#/$defs/StudyOperationResult" } }, "required": ["bundle", "create", "request", "response"], "title": "StudySchema", "type": "object", "x-rust-source-sha256": "0f183bfc85f4fefb746b2630bdc4c12e5a9f2f285c5a8047b4668fa378e1b83e" };
|
|
3
3
|
//# sourceMappingURL=study-schema.js.map
|