function [J] = jacobian1(nodeNum,PVI,PQI,aij,Y1,e,f,PQPVI)
if isempty(PVI)~=1&&isempty(PQI)~=1
H=zeros(nodeNum-1);N=H;
M=zeros(size(PQI,1),nodeNum-1);L=M;
R=zeros(size(PVI,1),nodeNum-1);S=R;
for i=1:nodeNum-1%对H矩阵进行构成
for j=1:nodeNum-1
if PQPVI(i)==PQPVI(j)
H(i,j)=H(i,j)-e(PQPVI(i))*Y1(PQPVI(i),PQPVI(i))*cos(aij(PQPVI(i),PQPVI(i)))-f(PQPVI(i))*Y1(PQPVI(i),PQPVI(i))*sin(aij(PQPVI(i),PQPVI(i)));
for hi=1:nodeNum
H(i,j)= H(i,j)-(Y1(PQPVI(i),hi)*cos(aij(PQPVI(i),hi))*e(hi)-Y1(PQPVI(i),hi)*sin(aij(PQPVI(i),hi))*f(hi));
end
else
H(i,j)=-e(PQPVI(i))*Y1(PQPVI(i),PQPVI(j))*cos(aij(PQPVI(i),PQPVI(j)))-f(PQPVI(i))*Y1(PQPVI(i),PQPVI(j))*sin(aij(PQPVI(i),PQPVI(j)));
end
end
end
for i=1:nodeNum-1%对N矩阵进行构成
for j=1:nodeNum-1
if PQPVI(i)==PQPVI(j)
N(i,j)=e(PQPVI(i))*Y1(PQPVI(i),PQPVI(j))*sin(aij(PQPVI(i),PQPVI(j)))-f(PQPVI(i))*Y1(PQPVI(i),PQPVI(j))*cos(aij(PQPVI(i),PQPVI(j)));
for ni=1:nodeNum
N(i,j)=N(i,j)-(Y1(PQPVI(i),ni)*cos(aij(PQPVI(i),ni))*f(hi)+Y1(PQPVI(i),ni)*sin(aij(PQPVI(i),ni))*e(ni));
end
else
N(i,j)=e(PQPVI(i))*Y1(PQPVI(i),PQPVI(j))*sin(aij(PQPVI(i),PQPVI(j)))-f(PQPVI(i))*Y1(PQPVI(i),PQPVI(j))*cos(aij(PQPVI(i),PQPVI(j)));
end
end
end
for i=1:size(PQI,1)%对M矩阵
for j=1:nodeNum-1
if PQI(i)==PQPVI(j)
M(i,j)=e(PQI(i))*Y1(PQI(i),PQI(i))*sin(aij(PQI(i),PQI(i)))-f(PQI(i))*Y1(PQI(i),PQI(i))*cos(aij(PQI(i),PQI(i)));
for mi=1:nodeNum
M(i,j)=M(i,j)+(Y1(PQI(i),mi)*cos(aij(PQI(i),mi))*f(mi)-Y1(PQI(i),mi)*sin(aij(PQI(i),mi))*e(mi));
end
else
M(i,j)=e(PQI(i))*Y1(PQI(i),PQPVI(j))*sin(aij(PQI(i),PQPVI(j)))-f(PQI(i))*Y1(PQI(i),PQPVI(j))*cos(aij(PQI(i),PQPVI(j)));
end
end
end
for i=1:size(PQI,1)%对L矩阵进行构成
for j=1:nodeNum-1
if PQI(i)==PQPVI(j)
L(i,j)=e(PQI(i))*Y1(PQI(i),PQI(i))*cos(aij(PQI(i),PQI(i)))+f(PQI(i))*Y1(PQI(i),PQI(i))*sin(aij(PQI(i),PQI(i)));
for li=1:nodeNum
L(i,j)=L(i,j)-(Y1(PQI(i),li)*cos(aij(PQI(i),li))*e(li)-Y1(PQI(i),li)*sin(aij(PQI(i),li))*f(li));
end
else
L(i,j)=e(PQI(i))*Y1(PQI(i),PQPVI(j))*cos(aij(PQI(i),PQPVI(j)))+f(PQI(i))*Y1(PQI(i),PQPVI(j))*sin(aij(PQI(i),PQPVI(j)));
end
end
end
for i=1:size(PVI,1)%对R矩阵
for j=1:nodeNum-1
if PVI(i)==PQPVI(j)
R(i,j)=-2*e(PVI(i));
end
end
end
for i=1:size(PVI,1)%对S矩阵
for j=1:nodeNum-1
if PVI(i)==PQPVI(j)
S(i,j)=-2*f(PVI(i));
end
end
end
J=[H,N;M,L;R,S];%形成雅克比矩阵J
elseif isempty(PVI)==1&&isempty(PQI)~=1%假如没有PV节点
H=zeros(nodeNum-1);N=H;
M=zeros(size(PQI,1),nodeNum-1);L=M;
for i=1:nodeNum-1%对H矩阵进行构成
for j=1:nodeNum-1
if PQPVI(i)==PQPVI(j)
H(i,j)=H(i,j)-e(PQPVI(i))*Y1(PQPVI(i),PQPVI(i))*cos(aij(PQPVI(i),PQPVI(i)))-f(PQPVI(i))*Y1(PQPVI(i),PQPVI(i))*sin(aij(PQPVI(i),PQPVI(i)));
for hi=1:nodeNum
H(i,j)= H(i,j)-(Y1(PQPVI(i),hi)*cos(aij(PQPVI(i),hi))*e(hi)-Y1(PQPVI(i),hi)*sin(aij(PQPVI(i),hi))*f(hi));
end
else
H(i,j)=-e(PQPVI(i))*Y1(PQPVI(i),PQPVI(j))*cos(aij(PQPVI(i),PQPVI(j)))-f(PQPVI(i))*Y1(PQPVI(i),PQPVI(j))*sin(aij(PQPVI(i),PQPVI(j)));
end
end
end
for i=1:nodeNum-1%对N矩阵进行构成
for j=1:nodeNum-1
if PQPVI(i)==PQPVI(j)
N(i,j)=e(PQPVI(i))*Y1(PQPVI(i),PQPVI(j))*sin(aij(PQPVI(i),PQPVI(j)))-f(PQPVI(i))*Y1(PQPVI(i),PQPVI(j))*cos(aij(PQPVI(i),PQPVI(j)));
for ni=1:nodeNum
N(i,j)=N(i,j)-(Y1(PQPVI(i),ni)*cos(aij(PQPVI(i),ni))*f(hi)+Y1(PQPVI(i),ni)*sin(aij(PQPVI(i),ni))*e(ni));
end
else
N(i,j)=e(PQPVI(i))*Y1(PQPVI(i),PQPVI(j))*sin(aij(PQPVI(i),PQPVI(j)))-f(PQPVI(i))*Y1(PQPVI(i),PQPVI(j))*cos(aij(PQPVI(i),PQPVI(j)));
end
end
end
for i=1:size(PQI,1)%对M矩阵
for j=1:nodeNum-1
if PQI(i)==PQPVI(j)
M(i,j)=e(PQI(i))*Y1(PQI(i),PQI(i))*sin(aij(PQI(i),PQI(i)))-f(PQI(i))*Y1(PQI(i),PQI(i))*cos(aij(PQI(i),PQI(i)));
for mi=1:nodeNum
M(i,j)=M(i,j)+(Y1(PQI(i),mi)*cos(aij(PQI(i),mi))*f(mi)-Y1(PQI(i),mi)*sin(aij(PQI(i),mi))*e(mi));
end
else
M(i,j)=e(PQI(i))*Y1(PQI(i),PQPVI(j))*sin(aij(PQI(i),PQPVI(j)))-f(PQI(i))*Y1(PQI(i),PQPVI(j))*cos(aij(PQI(i),PQPVI(j)));
end
end
end
for i=1:size(PQI,1)%对L矩阵进行构成
for j=1:nodeNum-1
if PQI(i)==PQPVI(j)
L(i,j)=e(PQI(i))*Y1(PQI(i),PQI(i))*cos(aij(PQI(i),PQI(i)))+f(PQI(i))*Y1(PQI(i),PQI(i))*sin(aij(PQI(i),PQI(i)));
for li=1:nodeNum
L(i,j)=L(i,j)-(Y1(PQI(i),li)*cos(aij(PQI(i),li))*e(li)-Y1(PQI(i),li)*sin(aij(PQI(i),li))*f(li));
end
else
L(i,j)=e(PQI(i))*Y1(PQI(i),PQPVI(j))*cos(aij(PQI(i),PQPVI(j)))+f(PQI(i))*Y1(PQI(i),PQPVI(j))*sin(aij(PQI(i),PQPVI(j)));
end
end
end
J=[H,N;M,L];%形成雅克比矩阵J
else%假如没有PQ节点
H=zeros(nodeNum-1);N=H;
R=zeros(size(PVI,1),nodeNum-1);S=R;
for i=1:nodeNum-1%对H矩阵进行构成
for j=1:nodeNum-1
if PQPVI(i)==PQPVI(j)
H(i,j)=H(i,j)-e(PQPVI(i))*Y1(PQPVI(i),PQPVI(i))*cos(aij(PQPVI(i),PQPVI(i)))-f(PQPVI(i))*Y1(PQPVI(i),PQPVI(i))*sin(aij(PQPVI(i),PQPVI(i)));
for hi=1:nodeNum
H(i,j)= H(i,j)-(Y1(PQPVI(i),hi)*cos(aij(PQPVI(i),hi))*e(hi)-Y1(PQPVI(i),hi)*sin(aij(PQPVI(i),hi))*f(hi));
end
else
H(i,j)=-e(PQPVI(i))*Y1(PQPVI(i),PQPVI(j))*cos(aij(PQPVI(i),PQPVI(j)))-f(PQPVI(i))*Y1(PQPVI(i),PQPVI(j))*sin(aij(PQPVI(i),PQPVI(j)));
end
end
end
for i=1:nodeNum-1%对N矩阵进行构成
for j=1:nodeNum-1
if PQPVI(i)==PQPVI(j)
N(i,j)=e(PQPVI(i))*Y1(PQPVI(i),PQPVI(j))*sin(aij(PQPVI(i),PQPVI(j)))-f(PQPVI(i))*Y1(PQPVI(i),PQPVI(j))*cos(aij(PQPVI(i),PQPVI(j)));
for ni=1:nodeNum
N(i,j)=N(i,j)-(Y1(PQPVI(i),ni)*cos(aij(PQPVI(i),ni))*f(hi)+Y1(PQPVI(i),ni)*sin(aij(PQPVI(i),ni))*e(ni));
end
else
N(i,j)=e(PQPVI(i))*Y1(PQPVI(i),PQPVI(j))*sin(aij(PQPVI(i),PQPVI(j)))-f(PQPVI(i))*Y1(PQPVI(i),PQPVI(j))*cos(aij(PQPVI(i),PQPVI(j)));
end
end
end
for i=1:size(PVI,1)%对R矩阵
for j=1:nodeNum-1
if PVI(i)==PQPVI(j)
R(i,j)=-2*e(PVI(i));
end
end
end
for i=1:size(PVI,1)%对S矩阵
for j=1:nodeNum-1
if PVI(i)==PQPVI(j)
S(i,j)=-2*f(PVI(i));
end
end
end
J=[H,N;R,S];%形成雅克比矩阵J
end
end
没有合适的资源?快使用搜索试试~ 我知道了~
将数学规划原理和常规潮流计算相有机结合_形成的带有最优乘子的牛顿算法_最优潮流_matlab
共23个文件
m:17个
xls:6个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 83 浏览量
2022-03-19
21:40:18
上传
评论 1
收藏 52KB RAR 举报
温馨提示
【达摩老生出品,必属精品,亲测校正,质量保证】 资源名:将数学规划原理和常规潮流计算相有机结合_形成的带有最优乘子的牛顿算法_最优潮流_matlab 资源类型:matlab项目全套源码 源码说明: 全部项目源码都是经过测试校正后百分百成功运行的,如果您下载后不能运行可联系我进行指导或者更换。 适合人群:新手及有一定经验的开发人员
资源推荐
资源详情
资源评论
收起资源包目录
将数学规划原理和常规潮流计算相有机结合_形成的带有最优乘子的牛顿算法_最优潮流_matlab.rar (23个子文件)
常规潮流算法-牛拉法-直角坐标 - 最小化潮流
main.m 2KB
FormY.m 536B
常规潮流算法-牛拉法-保留非线性
main.m 2KB
FormY.m 536B
ieee14.xls 24KB
jacobian1.m 7KB
ieee33.xls 27KB
writexlsresult.m 1KB
ReadData1.m 287B
ReadData2.m 218B
culation.m 2KB
branchpower.m 583B
resultieee14.xls 27KB
ieee14.xls 24KB
jacobian1.m 7KB
get_u.m 2KB
ieee33.xls 27KB
writexlsresult.m 2KB
ReadData1.m 287B
ReadData2.m 218B
culation.m 963B
branchpower.m 583B
resultieee14.xls 27KB
共 23 条
- 1
资源评论
阿里matlab建模师
- 粉丝: 3505
- 资源: 2787
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功