1.修复了坐标对齐的bug

2.修复了迭代步长增加的bug

Signed-off-by: dmy@lab <dmy@lab.com>
This commit is contained in:
dmy@lab 2015-09-23 19:02:32 +08:00
parent d17ed3632d
commit da85b45e7e
1 changed files with 15 additions and 9 deletions

View File

@ -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)]));