|
| 1 | +# State Input Format |
| 2 | + |
| 3 | +A state file separates the model definition from its initial state. |
| 4 | + |
| 5 | +This also separates the case from the dispatch. One canonical `texas.case.json` can have multiple operating points in `examples/`: |
| 6 | + |
| 7 | +- `texas-summer2025.state.json` |
| 8 | +- `texas-winter2025.state.json` |
| 9 | +- `texas-summer2026.state.json` |
| 10 | + |
| 11 | +For example `texas-summer2025.state.json` might be structured as: |
| 12 | + |
| 13 | +```json |
| 14 | +"header":{ |
| 15 | + ... |
| 16 | +}, |
| 17 | +"buses":{ |
| 18 | + ... |
| 19 | +}, |
| 20 | +"devices":{ |
| 21 | + ... |
| 22 | +} |
| 23 | +``` |
| 24 | + |
| 25 | +Each entry gives initial outputs and operating settings. Models use these values and connected inputs to initialize their own state. |
| 26 | + |
| 27 | +Buses own their voltage and shunt outputs. Devices own their terminal current outputs. These values support initialization across PowerFlow, OPF, PhasorDynamics, and EMT. |
| 28 | + |
| 29 | +## Bus |
| 30 | + |
| 31 | +### RMS State (PowerFlow & PhasorDynamics) |
| 32 | + |
| 33 | +RMS voltages use real and imaginary parts: |
| 34 | + |
| 35 | +```json |
| 36 | +"bus_id_2533":{ |
| 37 | + "vr": 0.9289638822595822, |
| 38 | + "vi": -0.39534548980249884 |
| 39 | +} |
| 40 | +``` |
| 41 | + |
| 42 | +### ABC State (EMT) |
| 43 | + |
| 44 | +EMT bus entries give instantaneous phase voltages. Device entries give currents. Each model defines any other initial states or history it needs. |
| 45 | + |
| 46 | +```json |
| 47 | +"bus_id_2533":{ |
| 48 | + "va": 0.9289638822595822, |
| 49 | + "vb": -0.39534548980249884, |
| 50 | + "vc": -0.39534548980249884 |
| 51 | +} |
| 52 | +``` |
| 53 | + |
| 54 | +## Devices |
| 55 | + |
| 56 | +Device entries give initial outputs and settings such as `online`, `open`, `tap`, and `phase`. |
| 57 | + |
| 58 | +Use `ir`/`ii` for one terminal and `ir1`/`ii1`, `ir2`/`ii2` for multiple terminals. Numbers follow the model's terminal numbering. Currents are positive into each connected bus. Phasor currents use the system base. EMT uses the model's phase output names and units. |
| 59 | + |
| 60 | +> At nonzero voltage, convert terminal power to initial current with `I = conj((P + jQ) / V)`. |
| 61 | +
|
| 62 | +```json |
| 63 | +"gen_id_2":{ |
| 64 | + "online": true, |
| 65 | + "ir": 0.8, |
| 66 | + "ii": -0.2 |
| 67 | +}, |
| 68 | +"br_id_2":{ |
| 69 | + "open": false, |
| 70 | + "tap": 1, |
| 71 | + "phase": 0 |
| 72 | +} |
| 73 | +``` |
| 74 | + |
| 75 | +# Migration |
| 76 | + |
| 77 | +- Initialize components from output values and connected inputs. |
| 78 | +- Derive missing values and check the initialization equations. |
| 79 | + |
| 80 | +`Bus`: |
| 81 | + |
| 82 | +- Treat buses as components with `vr` and `vi` output ports. |
| 83 | +- Move voltage initialization from the case to the state file. |
| 84 | + |
| 85 | +`Branch`: |
| 86 | + |
| 87 | +- Expose `ir1`, `ii1`, `ir2`, and `ii2` as output ports. |
| 88 | +- Make `tap`, `phase`, and `open` input ports. |
| 89 | + |
| 90 | +`REGCA`, `LoadZ`, `LoadZIP`, `GENROU`, `GENSAL`, `GenClassical`: |
| 91 | + |
| 92 | +- Expose `ir` and `ii` as output ports. |
| 93 | +- Initialize from terminal voltage and current. |
| 94 | +- Remove generator and converter `p0`/`q0` parameters. |
| 95 | +- Make `online` an input port. |
0 commit comments