Skip to content

Commit 6d4d7ab

Browse files
committed
Add cross-references between PyRAMSES examples and test system pages
- Examples page: replaced duplicate Nordic/5-bus sections with concise versions that link to test system pages for details - Nordic page: added See Also linking to PyRAMSES examples - 5-bus page: added See Also linking to PyRAMSES examples
1 parent c61d020 commit 6d4d7ab

File tree

3 files changed

+41
-43
lines changed

3 files changed

+41
-43
lines changed

src/content/docs/pyramses/examples.md

Lines changed: 32 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -191,79 +191,68 @@ ssa('jac_val.dat', 'jac_eqs.dat', 'jac_var.dat', 'jac_struc.dat')
191191
Set `$OMEGA_REF SYN ;` in the solver settings file when exporting Jacobians for eigenanalysis.
192192
:::
193193

194-
## Nordic Test System: Generator Trip
194+
## Test System Examples
195195

196-
The following example is based on the [Nordic JHub starter notebook](https://github.com/SPS-L/Nordic_JhubStart). It simulates a generator trip at t = 10 s and plots the rotor speed of the tripped machine.
196+
The following examples use the ready-to-run test systems. For system descriptions, data files, and disturbance scenarios, see the [Test Systems](/stepss-docs/test-systems/nordic/) section.
197+
198+
### Nordic Test System: Generator Trip
199+
200+
Trips generator g7 at $t = 10$ s on the heavily-stressed Operating Point B and observes the voltage collapse dynamics over 150 seconds. See the [Nordic Test System](/stepss-docs/test-systems/nordic/) page for full system details and file descriptions.
197201

198202
```python
199203
import pyramses
200204
import os
201205

202-
# --- Configure the test case ---
203206
case = pyramses.cfg()
204-
case.addData('dyn_B.dat') # dynamic model data
205-
case.addData('volt_rat_B.dat') # power-flow initialisation
206-
case.addData('settings1.dat') # solver settings
207-
case.addDst('nothing.dst') # no pre-defined disturbances
208-
case.addObs('obs.dat') # observables to record
209-
case.addTrj('output.trj') # trajectory output file
210-
211-
# --- Remove stale output files from previous runs ---
207+
case.addData('dyn_B.dat')
208+
case.addData('volt_rat_B.dat')
209+
case.addData('settings1.dat')
210+
case.addDst('nothing.dst')
211+
case.addObs('obs.dat')
212+
case.addTrj('output.trj')
213+
212214
for f in os.listdir('.'):
213215
if f.endswith('.trj') or f.endswith('.trace'):
214216
os.remove(f)
215217

216-
# --- Run simulation ---
217218
ram = pyramses.sim()
218-
ram.execSim(case, 0.0) # initialise, paused at t = 0
219-
ram.addDisturb(10.0, 'BREAKER SYNC_MACH g7 0') # trip generator g7 at t = 10 s
220-
ram.contSim(150.0) # simulate to t = 150 s
219+
ram.execSim(case, 0.0)
220+
ram.addDisturb(10.0, 'BREAKER SYNC_MACH g7 0')
221+
ram.contSim(150.0)
221222
ram.endSim()
222223

223-
# --- Extract and plot results ---
224224
ext = pyramses.extractor(case.getTrj())
225-
ext.getSync('g7').S.plot() # rotor speed of generator g7
225+
ext.getSync('g7').S.plot() # rotor speed
226+
ext.getBus('1041').mag.plot() # voltage at central bus
226227
```
227228

228-
:::note
229-
The Nordic test system files (`dyn_B.dat`, `volt_rat_B.dat`, etc.) are available in the [Nordic_JhubStart](https://github.com/SPS-L/Nordic_JhubStart) repository.
230-
:::
231-
232-
## 5-Bus System: Exciter Parameter Change
229+
### 5-Bus System: Exciter Parameter Change
233230

234-
The following example is based on the [5-bus test system Case 2 notebook](https://github.com/SPS-L/5_bus_test_system). It applies a step change to the exciter voltage setpoint at t = 1 s and plots the generator active power.
231+
Applies a step change to the exciter voltage setpoint at $t = 1$ s and plots the generator response. See the [5-Bus Test System](/stepss-docs/test-systems/5bus/) page for details.
235232

236233
```python
237234
import pyramses
238235
import os
239236

240-
# --- Configure the test case ---
241237
case = pyramses.cfg()
242-
case.addData('dyn.dat') # dynamic model data
243-
case.addData('lf1solv.dat') # power-flow solution
244-
case.addData('solveroptions.dat') # solver settings
245-
case.addDst('nothing.dst') # no pre-defined disturbances
246-
case.addObs('obs.dat') # observables to record
247-
case.addTrj('output.trj') # trajectory output file
248-
249-
# --- Remove stale output files from previous runs ---
238+
case.addData('dyn.dat')
239+
case.addData('lf1solv.dat')
240+
case.addData('solveroptions.dat')
241+
case.addDst('nothing.dst')
242+
case.addObs('obs.dat')
243+
case.addTrj('output.trj')
244+
250245
for f in os.listdir('.'):
251246
if f.endswith('.trj') or f.endswith('.trace'):
252247
os.remove(f)
253248

254-
# --- Run simulation ---
255249
ram = pyramses.sim()
256-
ram.execSim(case, 0.0) # initialise, paused at t = 0
257-
ram.addDisturb(1.0, 'CHGPRM EXC G Vo 0.05 2') # step +0.05 pu on Vo of exciter G at t = 1 s
258-
ram.contSim(60.0) # simulate to t = 60 s
250+
ram.execSim(case, 0.0)
251+
ram.addDisturb(1.0, 'CHGPRM EXC G Vo 0.05 2')
252+
ram.contSim(60.0)
259253
ram.endSim()
260254

261-
# --- Extract and plot results ---
262255
ext = pyramses.extractor(case.getTrj())
263-
ext.getSync('G').P.plot() # active power of generator G
264-
ext.getSync('G').Q.plot() # reactive power of generator G
256+
ext.getSync('G').P.plot()
257+
ext.getSync('G').Q.plot()
265258
```
266-
267-
:::note
268-
The 5-bus test system files are available in the [5_bus_test_system](https://github.com/SPS-L/5_bus_test_system) repository.
269-
:::

src/content/docs/test-systems/5bus.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,3 +47,7 @@ ext.getSync('G').Q.plot() # reactive power
4747
## Download
4848

4949
The test system files are available in the [5_bus_test_system repository](https://github.com/SPS-L/5_bus_test_system).
50+
51+
## See Also
52+
53+
- [PyRAMSES Examples](/stepss-docs/pyramses/examples/#5-bus-system-exciter-parameter-change) — Complete Python simulation workflow with this test system

src/content/docs/test-systems/nordic.mdx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,3 +175,8 @@ After a generator trip on Operating Point B, the simulation demonstrates:
175175
- T. Van Cutsem, M. Classes, "Description, modelling and simulation results of a test system for voltage stability analysis," IEEE PES Technical Report PES-TR19, 2013. Available from the [IEEE Resource Center](https://resourcecenter.ieee.org/publications/technical-reports/PESTR19)
176176
- [RAMSES project page](https://sps-lab.org/project/pyramses/) at the Sustainable Power Systems Lab
177177
- [STEPSS project page](https://sps-lab.org/project/stepss/) at the Sustainable Power Systems Lab
178+
179+
## See Also
180+
181+
- [PyRAMSES Examples](/stepss-docs/pyramses/examples/#nordic-test-system-generator-trip) — Complete Python simulation workflow with this test system
182+
- [PyRAMSES API Reference](/stepss-docs/pyramses/api-reference/) — Full API documentation for scripting simulations

0 commit comments

Comments
 (0)