📄 gycall.m
字号:
function Gycall(a)global DAEif ~a.n, return, endV1 = DAE.y(a.v1);V2 = DAE.y(a.v2);t1 = DAE.y(a.bus1);t2 = DAE.y(a.bus2);ss = sin(t1-t2);cc = cos(t1-t2);a1 = ss.*a.B;a2 = cc.*a.B;a3 = V1.*V2;a4 = a3.*a1;a5 = a3.*a2;t2 = a.con(:,3) == 2;ta = a.con(:,4) == 1; Kp = t2.*a.con(:,12);b1 = ta.*ss.*(a.B+a.y);b5 = ta.*a3.*cc.*(a.B+a.y);DAE.Gy = DAE.Gy ... + sparse(a.bus1,a.bus1, a5,DAE.m,DAE.m) ... + sparse(a.bus1,a.bus2,-a5,DAE.m,DAE.m) ... + sparse(a.bus2,a.bus1,-a5,DAE.m,DAE.m) ... + sparse(a.bus2,a.bus2, a5,DAE.m,DAE.m);DAE.Gy = DAE.Gy ... + sparse(a.bus2,a.v1,-V2.*a1,DAE.m,DAE.m) ... + sparse(a.bus2,a.v2,-V1.*a1,DAE.m,DAE.m) ... + sparse(a.bus1,a.v1, V2.*a1,DAE.m,DAE.m) ... + sparse(a.bus1,a.v2, V1.*a1,DAE.m,DAE.m);DAE.Gy = DAE.Gy ... + sparse(a.v1,a.bus1, a4,DAE.m,DAE.m) ... + sparse(a.v1,a.bus2,-a4,DAE.m,DAE.m) ... + sparse(a.v2,a.bus1, a4,DAE.m,DAE.m) ... + sparse(a.v2,a.bus2,-a4,DAE.m,DAE.m);DAE.Gy = DAE.Gy ... + sparse(a.v1,a.v1,(2*V1-V2.*cc).*a.B,DAE.m,DAE.m) ... + sparse(a.v1,a.v2,-V1.*a2,DAE.m,DAE.m) ... + sparse(a.v2,a.v2,(2*V2-V1.*cc).*a.B,DAE.m,DAE.m) ... + sparse(a.v2,a.v1,-V2.*a2,DAE.m,DAE.m);DAE.Gy = DAE.Gy ... - sparse(a.x0,a.x0,1,DAE.m,DAE.m) ... - sparse(a.x0,a.pref,Kp,DAE.m,DAE.m) ... - sparse(a.pref,a.pref,1,DAE.m,DAE.m);DAE.Gy = DAE.Gy ... + sparse(a.x0,a.v1,Kp.*V2.*b1,DAE.m,DAE.m) ... + sparse(a.x0,a.v2,Kp.*V1.*b1,DAE.m,DAE.m) ... + sparse(a.x0,a.bus1,Kp.*b5,DAE.m,DAE.m) ... - sparse(a.x0,a.bus2,Kp.*b5,DAE.m,DAE.m);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -