1.修复了坐标对齐的bug
2.修复了迭代步长增加的bug Signed-off-by: dmy@lab <dmy@lab.com>
This commit is contained in:
parent
d17ed3632d
commit
da85b45e7e
|
|
@ -9,21 +9,26 @@ semi_lineDistance=457;%
|
||||||
semi_lineCount=4;%分裂数
|
semi_lineCount=4;%分裂数
|
||||||
ConductorX=[-14500,14500];%导线距地高度
|
ConductorX=[-14500,14500];%导线距地高度
|
||||||
ConductorY=[16500,16500];%导线间距
|
ConductorY=[16500,16500];%导线间距
|
||||||
|
CSM_N=10;%每一个子导线的模拟电荷数
|
||||||
%%
|
%%
|
||||||
%设置电压
|
%设置电压
|
||||||
Volt=[500;500;500;500;-500;-500;-500;-500];
|
Volt=[500;500;500;500;-500;-500;-500;-500];
|
||||||
|
Volt=[500*ones(CSM_N,1);-500*ones(CSM_N,1)];
|
||||||
%按分裂数和分裂导线间距布置单相线路导线
|
%按分裂数和分裂导线间距布置单相线路导线
|
||||||
%用极坐标
|
%用极坐标
|
||||||
arc=2*pi/semi_lineCount;
|
arc=2*pi/semi_lineCount;
|
||||||
|
CSM_arc=2*pi/CSM_N;
|
||||||
%子导线中心到导线中心的距离
|
%子导线中心到导线中心的距离
|
||||||
R=semi_lineDistance/2/sin(arc/2);
|
R=semi_lineDistance/2/sin(arc/2);
|
||||||
%计算模拟电荷的位置
|
%计算模拟电荷的位置
|
||||||
r1=-10;
|
r1=200;
|
||||||
error=10000;
|
error=10000;
|
||||||
for Loop=1:10000
|
step=1/20;
|
||||||
simulationChargePos=ones(semi_lineCount,1);
|
maxLoop=round((R-r1)/step);
|
||||||
for I=1:semi_lineCount
|
for Loop=1:maxLoop;
|
||||||
simulationChargePos(I)=exp(1j*((I-1)*arc+arc/2))*(R+r1);%逆时针转一个角度
|
simulationChargePos=ones(CSM_N,1);
|
||||||
|
for I=1:CSM_N
|
||||||
|
simulationChargePos(I)=exp(1j*((I-1)*CSM_arc+CSM_arc/2))*(R+r1);%逆时针转一个角度
|
||||||
end
|
end
|
||||||
simulationChargeAPos=simulationChargePos+ConductorX(1)+1j*ConductorY(1);
|
simulationChargeAPos=simulationChargePos+ConductorX(1)+1j*ConductorY(1);
|
||||||
simulationChargeBPos=simulationChargePos+ConductorX(2)+1j*ConductorY(2);
|
simulationChargeBPos=simulationChargePos+ConductorX(2)+1j*ConductorY(2);
|
||||||
|
|
@ -47,15 +52,16 @@ for Loop=1:10000
|
||||||
%求电荷
|
%求电荷
|
||||||
QRI=P\Volt;
|
QRI=P\Volt;
|
||||||
%以下是验证部分
|
%以下是验证部分
|
||||||
if error<0.01
|
if error<0.0001
|
||||||
break;
|
break;
|
||||||
end
|
end
|
||||||
%选检验导线上一个角度
|
%选检验导线上一个角度
|
||||||
vrfRelA=linspace(0,2*pi)';%vrf=verify
|
vrfRelA=linspace(0,2*pi)';%vrf=verify
|
||||||
%计算检验点相对于子导线的位置
|
%计算检验点相对于子导线的位置
|
||||||
vrfRelPos=exp(1j*vrfRelA)*r(1);
|
vrfRelPos=exp(1j*vrfRelA)*R;
|
||||||
%移动坐标,使验证的子导线中心和实际子导线中心重合。
|
%移动坐标,使验证的子导线中心和实际子导线中心重合。
|
||||||
vrfPos=exp(1j*(0+arc/2))*R+ConductorX(1)+1j*ConductorY(1)+vrfRelPos;
|
vrfPos=exp(1j*(0+arc/2))*R+ConductorX(1)+1j*ConductorY(1)+vrfRelPos;
|
||||||
|
vrfPos=ConductorX(1)+1j*ConductorY(1)+vrfRelPos;
|
||||||
%计算这一点的电位系数
|
%计算这一点的电位系数
|
||||||
matVrfPos=repmat(vrfPos,1,length(simulationChargePos));
|
matVrfPos=repmat(vrfPos,1,length(simulationChargePos));
|
||||||
vrf2ConductorDistance=abs(matVrfPos-repmat(conj(simulationChargePos'),length(vrfPos),1));
|
vrf2ConductorDistance=abs(matVrfPos-repmat(conj(simulationChargePos'),length(vrfPos),1));
|
||||||
|
|
@ -64,8 +70,8 @@ for Loop=1:10000
|
||||||
%计算电压
|
%计算电压
|
||||||
V=Pij*QRI;
|
V=Pij*QRI;
|
||||||
error=sum(abs(V-500)./500)/length(V);
|
error=sum(abs(V-500)./500)/length(V);
|
||||||
r1=r1+r(1)/100;
|
r1=r1+Loop*step;
|
||||||
end
|
end
|
||||||
display('Finished.');
|
display('Finished.');
|
||||||
display(Loop);
|
display(Loop);
|
||||||
% scatter(real([simulationChargeAPos;vrfPos]),imag([simulationChargeAPos;vrfPos]));
|
scatter(real([simulationChargeAPos;vrfPos;ConductorX(1)]),imag([simulationChargeAPos;vrfPos;+1j*ConductorY(1)]));
|
||||||
Loading…
Reference in New Issue