⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 gcall.m

📁 电力系统分析计算程序
💻 M
字号:
function gcall(a)global DAE Lineif ~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);% update BB = btcsc(a);P1 = V1.*V2.*ss.*B;DAE.g = DAE.g ...        + sparse(a.bus1,1,P1,DAE.m,1) ...        - sparse(a.bus2,1,P1,DAE.m,1) ...        + sparse(a.v1,1,V1.*(V1-V2.*cc).*B,DAE.m,1) ...        + sparse(a.v2,1,V2.*(V2-V1.*cc).*B,DAE.m,1); t2 = a.con(:,3) == 2;ta = a.con(:,4) == 2;   x0 = a.X0;x2 = zeros(a.n,1);x2(find(t2)) = DAE.x(a.x2(find(t2)));Pref = DAE.y(a.pref);[Ps,Qs,Pr,Qr] = flows(Line,'pq',a.line);[Ps,Qs,Pr,Qr] = flows(a,Ps,Qs,Pr,Qr,'tcsc');Kp = a.con(:,12);x0 = -t2.*Kp.*(Pref-Ps-ta.*Pr) + x2;DAE.g = DAE.g ...        + sparse(a.x0,1,x0-DAE.y(a.x0),DAE.m,1) ...        + sparse(a.pref,1,a.Pref-DAE.y(a.pref),DAE.m,1);

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -