From eea457bae4cc5bf53f82be4402019caa8622ab6d Mon Sep 17 00:00:00 2001 From: "dmy@lab" Date: Wed, 23 Sep 2015 20:11:25 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=AF=E4=BB=A5=E8=BE=BE=E5=88=B00.01%?= =?UTF-8?q?=E7=9A=84=E7=B2=BE=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: dmy@lab --- SelfAdaptSimulation.m | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/SelfAdaptSimulation.m b/SelfAdaptSimulation.m index d2ce2af..b700347 100644 --- a/SelfAdaptSimulation.m +++ b/SelfAdaptSimulation.m @@ -9,7 +9,7 @@ semi_lineDistance=257;% semi_lineCount=4;%分裂数 ConductorX=[-14500,14500];%导线距地高度 ConductorY=[16500,16500];%导线间距 -CSM_N=10;%每一个子导线的模拟电荷数 +CSM_N=80;%每一个子导线的模拟电荷数 subconductorR=30;%子导线半径 %% %设置电压 @@ -22,9 +22,9 @@ CSM_arc=2*pi/CSM_N; %子导线中心到导线中心的距离 R=semi_lineDistance/2/sin(arc/2); %计算模拟电荷的位置 -r1=2; +r1=20; error=10000; -step=1/20; +step=1/10; maxLoop=round((subconductorR-r1)/step); for Loop=1:maxLoop; simulationChargePos=ones(CSM_N,1); @@ -60,11 +60,11 @@ for Loop=1:maxLoop; %求电荷 QRI=P\Volt; %以下是验证部分 - if error<0.01 + if error<0.0001 break; end %选检验导线上一个角度 - vrfRelA=linspace(0,2*pi)';%vrf=verify + vrfRelA=linspace(0,2*pi,200)';%vrf=verify %计算检验点相对于子导线的位置 vrfRelPos=exp(1j*vrfRelA)*subconductorR; %移动坐标,使验证的子导线中心和实际子导线中心重合。 @@ -80,10 +80,13 @@ for Loop=1:maxLoop; Pij=1/2/pi/eslong*log(vrf2MirrorDistance./vrf2ConductorDistance); %计算电压 V=Pij*QRI; - error=sum(abs(V-500)./500)/length(V) + error=sum(abs(V-500)./500)/length(V); r1=r1+step; end display('Finished.'); +if Loop