function Shield_Patterns % ERIC LUNDQUIST % FDFD Code % Shielded Parallel Pair % 2009 close all clear all clc display('Warning! This code is for visualization purposes and does not produce accurate Zo or C values!') distance = 12 ; % distance between center and matrix edge (m) wire_diameter = 1 ; % wire diameter (m) wire_space = 1.5 ; % distance between wire centers % Normalization gs = 0.1 ; % grid size grid_distance = distance/(wire_diameter) ; % Normalized distance between wire and grid edge wire_separation = wire_space/(wire_diameter)/gs; % Distance between wire centers % Constants er = 1 ; % Permittivity of Surrounding Medium (i.e. 1 for air, 80 for water) e0 = 8.854e-12; % Permittivity Constant u = 3e8; % Speed of light % Wire Characteristics a = 1; % Radius of the conductor h=2*grid_distance; % Horizontal Field Boundary v=2*grid_distance; % Vertical Field Boundary rows = round(h/gs); % number of rows columns = round(v/gs); % number of columns r=rows; c=columns; ht=rows/2; % vertical Center of the grid lt=columns/2; % horizontal Center of the grid vd = 100; % potential of the conductor A=zeros(rows,columns); % Grid vector E = ones(r,c); % permittivity vector BC = zeros(r,c) ; % ---CONDUCTOR--- % (the addition and subtraction of 'radius' determine distance from % center wire to surrounding wires for i=1:rows for j=1:columns if (i-ht)^2+(j-(lt-wire_separation))^2round((4*a/gs)^2)% Shield A(i,j)=0; BC(i,j)=1; end end end BC(1:80,:)=0; % Imposed shield damage figure % Visualization of BC Definitions imagesc(BC) axis equal colormap(winter) title('Visualization of BC Definitions') colorbar; % ---WIRE INSULATION--- for i=1:rows for j=1:columns if (i-ht)^2+(j-lt)^2(nmax/10) tc=now; %current time te=tc-tstart; %elapsed time t2=te*nmax/n; %estimated total time tr=t2-te; %estimated remaining time tr_str=datestr(tr,'HH:MM:SS'); time_status = sprintf(['\n\nEstimated time remaining: ',tr_str,'\n']); end if n>(nmax*.98) time_status = sprintf(['\n\nGenerating Visualization Images...\n']); end figure(99); imagesc(bar) colormap(winter) daspect([8,100/nmax,1]) % x/y aspect ratio axis off title([status,time_status])