Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
S
sparrowzz
概览
Overview
Details
Activity
Cycle Analytics
版本库
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
问题
0
Issues
0
列表
Board
标记
里程碑
合并请求
0
Merge Requests
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
Snippets
成员
Collapse sidebar
Close sidebar
活动
图像
聊天
创建新问题
作业
提交
Issue Boards
Open sidebar
sgool
sparrowzz
Commits
1290de75
Commit
1290de75
authored
Jun 21, 2025
by
dongshufeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor: add case14 data
parent
856fed5a
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
180 行增加
和
1 行删除
+180
-1
rspower/examples/test_make_ybus.txt
+11
-1
rspower/lib/idx_brch.txt
+87
-0
rspower/lib/idx_bus.txt
+82
-0
没有找到文件。
rspower/examples/test_make_ybus.txt
查看文件 @
1290de75
#include ../lib/idx_gen.txt
#include ../data/case14.txt
#include ../lib/idx_gen.txt
#include ../lib/idx_bus.txt
#include ../lib/idx_brch.txt
// constants
nb = size(bus, 1); // number of buses
nl = size(branch, 1); // number of lines
println(nb);
println(nl);
return gencost;
\ No newline at end of file
rspower/lib/idx_brch.txt
0 → 100644
查看文件 @
1290de75
//IDX_BRCH Defines constants for named column indices to branch matrix.
// Example:
//
// [F_BUS, T_BUS, BR_R, BR_X, BR_B, RATE_A, RATE_B, RATE_C, ...
// TAP, SHIFT, BR_STATUS, PF, QF, PT, QT, MU_SF, MU_ST, ...
// ANGMIN, ANGMAX, MU_ANGMIN, MU_ANGMAX] = idx_brch;
//
// Some examples of usage, after defining the constants using the line above,
// are:
//
// branch(4, BR_STATUS) = 0; % take branch 4 out of service
// Ploss = branch(:, PF) + branch(:, PT); % compute real power loss vector
//
// The index, name and meaning of each column of the branch matrix is given
// below:
//
// columns 1-11 must be included in input matrix (in case file)
// 1 F_BUS f, from bus number
// 2 T_BUS t, to bus number
// 3 BR_R r, resistance (p.u.)
// 4 BR_X x, reactance (p.u.)
// 5 BR_B b, total line charging susceptance (p.u.)
// 6 RATE_A rateA, MVA rating A (long term rating)
// 7 RATE_B rateB, MVA rating B (short term rating)
// 8 RATE_C rateC, MVA rating C (emergency rating)
// 9 TAP ratio, transformer off nominal turns ratio
// 10 SHIFT angle, transformer phase shift angle (degrees)
// 11 BR_STATUS initial branch status, 1 - in service, 0 - out of service
// 12 ANGMIN minimum angle difference, angle(Vf) - angle(Vt) (degrees)
// 13 ANGMAX maximum angle difference, angle(Vf) - angle(Vt) (degrees)
// (The voltage angle difference is taken to be unbounded below
// if ANGMIN < -360 and unbounded above if ANGMAX > 360.
// If both parameters are zero, it is unconstrained.)
//
// columns 14-17 are added to matrix after power flow or OPF solution
// they are typically not present in the input matrix
// 14 PF real power injected into "from" end of branch (MW)
// 15 QF reactive power injected into "from" end of branch (MVAr)
// 16 PT real power injected into "to" end of branch (MW)
// 17 QT reactive power injected into "to" end of branch (MVAr)
//
// columns 18-21 are added to matrix after OPF solution
// they are typically not present in the input matrix
// (assume OPF objective function has units, u)
// 18 MU_SF Kuhn-Tucker multiplier on MVA limit at "from" bus (u/MVA)
// 19 MU_ST Kuhn-Tucker multiplier on MVA limit at "to" bus (u/MVA)
// 20 MU_ANGMIN Kuhn-Tucker multiplier lower angle difference limit (u/degree)
// 21 MU_ANGMAX Kuhn-Tucker multiplier upper angle difference limit (u/degree)
//
// See also DEFINE_CONSTANTS.
// MATPOWER
// Copyright (c) 1996-2016, Power Systems Engineering Research Center (PSERC)
// by Ray Zimmerman, PSERC Cornell
//
// This file is part of MATPOWER.
// Covered by the 3-clause BSD License (see LICENSE file for details).
// See https://matpower.org for more info.
// define the indices
F_BUS = 1; // f, from bus number
T_BUS = 2; // t, to bus number
BR_R = 3; // r, resistance (p.u.)
BR_X = 4; // x, reactance (p.u.)
BR_B = 5; // b, total line charging susceptance (p.u.)
RATE_A = 6; // rateA, MVA rating A (long term rating)
RATE_B = 7; // rateB, MVA rating B (short term rating)
RATE_C = 8; // rateC, MVA rating C (emergency rating)
TAP = 9; // ratio, transformer off nominal turns ratio
SHIFT = 10; // angle, transformer phase shift angle (degrees)
BR_STATUS = 11; // initial branch status, 1 - in service, 0 - out of service
ANGMIN = 12; // minimum angle difference, angle(Vf) - angle(Vt) (degrees)
ANGMAX = 13; // maximum angle difference, angle(Vf) - angle(Vt) (degrees)
// included in power flow solution, not necessarily in input
PF = 14; // real power injected at "from" bus end (MW) (not in PTI format)
QF = 15; // reactive power injected at "from" bus end (MVAr) (not in PTI format)
PT = 16; // real power injected at "to" bus end (MW) (not in PTI format)
QT = 17; // reactive power injected at "to" bus end (MVAr) (not in PTI format)
// included in opf solution, not necessarily in input
// assume objective function has units, u
MU_SF = 18; // Kuhn-Tucker multiplier on MVA limit at "from" bus (u/MVA)
MU_ST = 19; // Kuhn-Tucker multiplier on MVA limit at "to" bus (u/MVA)
MU_ANGMIN = 20; // Kuhn-Tucker multiplier lower angle difference limit (u/degree)
MU_ANGMAX = 21; // Kuhn-Tucker multiplier upper angle difference limit (u/degree)
\ No newline at end of file
rspower/lib/idx_bus.txt
0 → 100644
查看文件 @
1290de75
//IDX_BUS Defines constants for named column indices to bus matrix.
// Example:
//
// [PQ, PV, REF, NONE, BUS_I, BUS_TYPE, PD, QD, GS, BS, BUS_AREA, VM, ...
// VA, BASE_KV, ZONE, VMAX, VMIN, LAM_P, LAM_Q, MU_VMAX, MU_VMIN] = idx_bus;
//
// Some examples of usage, after defining the constants using the line above,
// are:
//
// Pd = bus(4, PD); % get the real power demand at bus 4
// bus(:, VMIN) = 0.95; % set the min voltage magnitude to 0.95 at all buses
//
// The index, name and meaning of each column of the bus matrix is given
// below:
//
// columns 1-13 must be included in input matrix (in case file)
// 1 BUS_I bus number (positive integer)
// 2 BUS_TYPE bus type (1 = PQ, 2 = PV, 3 = ref, 4 = isolated)
// 3 PD Pd, real power demand (MW)
// 4 QD Qd, reactive power demand (MVAr)
// 5 GS Gs, shunt conductance (MW demanded at V = 1.0 p.u.)
// 6 BS Bs, shunt susceptance (MVAr injected at V = 1.0 p.u.)
// 7 BUS_AREA area number, (positive integer)
// 8 VM Vm, voltage magnitude (p.u.)
// 9 VA Va, voltage angle (degrees)
// 10 BASE_KV baseKV, base voltage (kV)
// 11 ZONE zone, loss zone (positive integer)
// 12 VMAX maxVm, maximum voltage magnitude (p.u.)
// 13 VMIN minVm, minimum voltage magnitude (p.u.)
//
// columns 14-17 are added to matrix after OPF solution
// they are typically not present in the input matrix
// (assume OPF objective function has units, u)
// 14 LAM_P Lagrange multiplier on real power mismatch (u/MW)
// 15 LAM_Q Lagrange multiplier on reactive power mismatch (u/MVAr)
// 16 MU_VMAX Kuhn-Tucker multiplier on upper voltage limit (u/p.u.)
// 17 MU_VMIN Kuhn-Tucker multiplier on lower voltage limit (u/p.u.)
//
// additional constants, used to assign/compare values in the BUS_TYPE column
// 1 PQ PQ bus
// 2 PV PV bus
// 3 REF reference bus
// 4 NONE isolated bus
//
// See also DEFINE_CONSTANTS.
// MATPOWER
// Copyright (c) 1996-2016, Power Systems Engineering Research Center (PSERC)
// by Ray Zimmerman, PSERC Cornell
//
// This file is part of MATPOWER.
// Covered by the 3-clause BSD License (see LICENSE file for details).
// See https://matpower.org for more info.
// define bus types
PQ = 1;
PV = 2;
REF = 3;
NONE = 4;
// define the indices
BUS_I = 1; // bus number (1 to 29997)
BUS_TYPE = 2; // bus type (1 - PQ bus, 2 - PV bus, 3 - reference bus, 4 - isolated bus)
PD = 3; // Pd, real power demand (MW)
QD = 4; // Qd, reactive power demand (MVAr)
GS = 5; // Gs, shunt conductance (MW at V = 1.0 p.u.)
BS = 6; // Bs, shunt susceptance (MVAr at V = 1.0 p.u.)
BUS_AREA = 7; // area number, 1-100
VM = 8; // Vm, voltage magnitude (p.u.)
VA = 9; // Va, voltage angle (degrees)
BASE_KV = 10; // baseKV, base voltage (kV)
ZONE = 11; // zone, loss zone (1-999)
VMAX = 12; // maxVm, maximum voltage magnitude (p.u.) (not in PTI format)
VMIN = 13; // minVm, minimum voltage magnitude (p.u.) (not in PTI format)
// included in opf solution, not necessarily in input
// assume objective function has units, u
LAM_P = 14; // Lagrange multiplier on real power mismatch (u/MW)
LAM_Q = 15; // Lagrange multiplier on reactive power mismatch (u/MVAr)
MU_VMAX = 16; // Kuhn-Tucker multiplier on upper voltage limit (u/p.u.)
MU_VMIN = 17; // Kuhn-Tucker multiplier on lower voltage limit (u/p.u.)
\ No newline at end of file
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论