FastFieldSolvers Forum
FastFieldSolvers Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
 All Forums
 FastFieldSolvers
 FastHenry2
 Interface to Matlab
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

dnl

United Kingdom
11 Posts

Posted - Sep 17 2007 :  12:31:40  Show Profile
I would like to be able to visualise the current density in conductors, and it appears to me that the easiest way to do this is by using Matlab, as various data files are created which can be read by Matlab, and Matlab already has tools for plotting 3D structures.

However, as FastHenry has different visualisation and calculation run modes, it appears that multiple FastHenry runs will be required to generate the data. FastHenry would therefore need controlling by Matlab, and the Matlab facility to run programs (System command) does not appear to start a FastHenry run. However, the documentation on Automation in FastHenry implies that it may be possible using ActiveX technology. Is anyone more familiar than me with this, and able to start me on how to call FastHenry from Matlab?

There is then the zbuf program used for visualisation, which can be run from the Matlab system command, but appears to create invalid matlab files for some of my data. However, it appears that the input files for zbuf are fairly simple, so Matlab should be able to do the job of zbuf. As a start of that process, here is code that will read in and give a plot of the files created by the FastHenry -f options (zbuffile, zbuffile2, and heir.qui)



function testread
fid=0;
lmax=5000; %maximum number of lines to read
while fid < 1 
   filename=input('Open file: ', 's');
   [fid,message] = fopen(filename, 'r');
   if fid == -1
     disp(message)
   end
end
lcount = 0;
pcount = 0;
id_list=[];
while (feof(fid) == 0) & (lcount <lmax)
   tline = fgetl(fid);
   lcount = lcount+1;
   LineData=ProcessLine(tline);
   switch LineData.code;
       case '0' % title
            disp(LineData.text);       
       case '*' % title
           disp('input file comment:')
            disp(LineData.text);       
       case 'Z' % title
           disp('input file not processed correctly for line')
            disp(LineData.text);       
       case 'Q','T';
           j=1;
           while (j<=length(id_list)) && (id_list(j).id~=LineData.id)
               j=j+1;
           end
           if j>length(id_list)
               id_list(j).id=LineData.id;
               id_list(j).start=pcount+1;
               id_list(j).points=1;
           else
                id_list(j).points=1+id_list(j).points;               
           end
           for j=1:length(LineData.P)
               pcount = pcount+1;
               xp(pcount)= LineData.P(j).x;
               yp(pcount)= LineData.P(j).y;
               zp(pcount)= LineData.P(j).z;
           end
   end
   
end
fclose(fid); 
% plot the points
plot3(xp*1000,yp*1000,zp*1000)
groups=length(id_list);
disp(['There are ' num2str(groups) ' sets of points']);
for j=1:groups
    disp(['id ',num2str(id_list(j).id),' starts at ',num2str(id_list(j).start),' for ',num2str(id_list(j).points),' points'])
end
return


function   LineData=ProcessLine(tline)
   LineData.code = upper(tline(1));
   switch LineData.code
       case '0' % title
           LineData.text=tline(2:length(tline));
           LineData.type='title';
       case '*','%','#' %comments   
           LineData.text=tline(2:length(tline));
           LineData.type='comment';
           LineData.code='*';
       case 'Q' % set of 4 xyz
              [A,count,errmsg,nextindex]  = sscanf(tline,'%s %f %f %f %f %f %f %f %f %f %f %f %f %f');
               if length(errmsg) > 0
                   LineData.type='error';
                   LineData.text=errmsg;
                   LineData.code='Z';
               else
                   LineData.type='Quad';
                   LineData.id=A(2);
                   for j=1:4
                     P(j).x=A(j*3);
                     P(j).y=A(j*3+1);
                     P(j).z=A(j*3+2);
                     LineData.P(j)=P(j);
                   end                   
               end
        case 'T' % set of 3 xyz
              [A,count,errmsg,nextindex]  = sscanf(tline,'%s %f %f %f %f %f %f %f %f %f %f %f %f %f');
               if length(errmsg) > 0
                   LineData.type='error';
                   LineData.text=errmsg;
               else
                   LineData.type='Tri';
                   LineData.id=A(2);
                   for j=1:3
                     P(j).x=A(j*3);
                     P(j).y=A(j*3+1);
                     P(j).z=A(j*3+2);
                     LineData.P(j)=P(j);
                   end                   
               end
       case 'N','G','B','D','C','F','R','E'
           %Name,Group,Boundary,Dielectric,Conductor,F?,Recusive,E?
           % see zbuf source files - InOut and input
           LineData.type='not decoded';
           LineData.text=tline;
           LineData.code='Z';
       otherwise
           LineData.type='not recognised';
           LineData.text=tline;
           LineData.code='Z';
   end
  
  return


David Lee
Power Electronics, UK

Enrico

550 Posts

Posted - Sep 25 2007 :  17:49:22  Show Profile
Thanks for sharing the MatLab function, bypassing zbuf.

For current distribution vs. visualization, see also the post "get_new_x_y: Vector never hits edge of box?"

Enrico
Go to Top of Page

dnl

United Kingdom
11 Posts

Posted - Sep 27 2007 :  10:32:42  Show Profile
I will reply here, rather than in the post "get_new_x_y: Vector never hits edge of box?", as this makes the thread easier to follow.

Enrico wrote

quote:
2. Regarding MatLab zbuf output, this is not a much used feature, since people usually rely on FastModel for visualization. It might be that is buggish; did you EVER get a valid MatLab file in this way?

3. Let's not confuse things together. The '-f' option, together with zbuf program, are for geometrical visualization only, not to show current distributions. Current distributions can be output with '-d grids' option in FastHenry, and then visualized loading the output files in MatLab. This feature has been tested, is used and should work. Examples are described in FastHenry's user manual, paragraph 4


With the code listed above, I think that point number 2 becomes no longer worth investigating.

On point 3, I am trying to do something slightly more than just the '-d grids' option. That displays the current vector in each cell, as the total current in that cell. However, the cell sizes, especially in a non-uniform plane, vary, and so I was interested in the current density in each cell, which requires dividing the current by the area for each cell. To extract the area of each cell, I was seeking to use the '-f heir' to get the cell sizes. It therefore requires two runs of FastHenry, with the same input file but different options, to create the raw data for Matlab (hense my interest in being able to call FastHenry from Matlab).
To display this, my aim was to start with the code of FastHenry's user manual, paragraph 4, and then to colour each cell acording to the current density.

However, you may notice that I saying "it was", not "I would like to". I reached being able to plot the current on different z planes, and superimposed the plane boundaries on the plot, but then found that some currents were outside of conductors - they appeared to belong to a conductor on a different Z plane. As this may be a visualisation effect, or it may be that FastHenry has positioned the conductor at the wrong height internally, I felt I could not trust the output of FastHenry, and so stopped trying to get further results from it.

From Enrico's response earlier, it may be that he does not have access to Matlab, so can not easily check this problem, but will not be keen to have the possibility around of a serious error in FastHenry! I can not at present work out how to put the Matlab figure outputs into this forum as posts, although there are image tags available. So it looks like the most useful thing I can do at present is to post both my Matlab code, and the FastHenry input file.
function currentgrid
% FASTHENRY HELPER PROGRAM
% for use with a PCB layout, which has multiple conductors at different
% depths of Z
% Reads in the structure, as processed by FastHery and output in a zbuffile
% Then reads in the current distribution, output by fasthenry -d grids
% and plots, for each Z level, the geometry and currents

% David Lee, Converteam, September 2007
% The Grid* files are not readable, so use the J*.mat files
% Some currents apperared on the incorrect Z plane, which apperass to be a
% Fasthenry fault
%Development stopped due to the above
%19 Sept 2007

%see also testread, which displays full structure, including 3D plot
% and testgrid, which displays current only

%read in the geomentary
lmax=1000; %maximum number of lines to read
f2id=0;
while f2id < 1 
   filename=input('Open output of "fasthenry -f refined" :[zbuffile, zbuffile2] ', 's');
   [f2id,message] = fopen(filename, 'r');
   if f2id == -1
     disp(message)
   end
end
lcount = 0;
shapes.ids=[];
shapes.xyz=[];
while (feof(f2id) == 0) & (lcount <=lmax)
   tline = fgetl(f2id);
   lcount = lcount+1;
   LineData=ProcessLine(tline);
   switch LineData.code;
       case '0' % title
            disp(LineData.text);       
       case '*' % title
           disp('input file comment:')
            disp(LineData.text);       
       case 'Z' % title
           disp('input file not processed correctly for line')
            disp(LineData.text);       
       case 'Q','T';
           [id_pointer,shapes,new_id]=getpointer(LineData.id,shapes);
              for j=1:length(LineData.P)
               shapes.xyz=[shapes.xyz;LineData.P(j).x,LineData.P(j).y,LineData.P(j).z,j,LineData.id];
              end
              shapes.xyz=[shapes.xyz;LineData.P(1).x,LineData.P(1).y,LineData.P(1).z,0,LineData.id];
   end  
end
fclose(f2id); 
disp(['read ',num2str(lcount),' lines (max is ',num2str(lmax),' lines)'])
%Simplify number of Z planes
allz=shapes.xyz(:,3)';
allz=unique(allz);
%tollerance setting for Z plane
Zsmooth=20;
Ztol=(max(allz)-min(allz))/Zsmooth;
Znom=round(allz/Ztol);
allz=unique(Znom)*Ztol;

fid=0;
lmax=7000; %maximum number of lines to read
while fid < 1 
   filename=input('Open output of "fasthenry -d grids" :[Gridx_y.mat Jmagx_y.mat Jimagx_y.mat Jreal1_0.mat] ', 's');
   [fid,message] = fopen(filename, 'r');
   if fid == -1
     disp(message)
   end
end
switch upper(filename(1));
    case 'G' %Grid of currents - sometimes corrupted
        filetype='G';        
    case 'J' %currents - three subtypes
        filetype=upper(filename(2));
    otherwise
        disp('unrecognised file type from file name')
        return
end

lcount = 0;
pcount = 0;
plane_list=[];
while (feof(fid) == 0) & (lcount < lmax)
   tline = fgetl(fid);
   lcount = lcount+1;
   switch filetype;
       case 'G'
           LineData=ProcessLineJ(tline);
       case {'M','I','R'}
           LineData=ProcessLineR(tline);
       otherwise
           disp(['invalid internal filetype of ',filetype])
           return
   end   
   j=1;
   while (j<=length(plane_list)) && (plane_list(j).z~=LineData.z);
       j=j+1;
   end
   if j>length(plane_list); %onto a new plane
       if j>1 %plot previous plane
            zt=plane_list(length(plane_list)).z;
           plotcurrent(xp,yp,up,vp,zt);
           %now also add the structure
            points=find(shapes.xyz(:,3)>zt-Ztol & shapes.xyz(:,3)<zt+Ztol);
            hold on
            plotshapes(points, shapes.xyz)
            title(['currents between ',num2str(1000*(zt-Ztol)), ' and ',num2str(1000*(zt+Ztol)) ,' mm from ',filename])        
        end    
        plane_list(j).z=LineData.z;
        plane_list(j).points=1;
        xp=LineData.x;
        yp=LineData.y;
        up=LineData.dx;
        vp=LineData.dy;
   else
        plane_list(j).points=1+plane_list(j).points;
        xp=[xp,LineData.x];
        yp=[yp,LineData.y];
        up=[up,LineData.dx];
        vp=[vp,LineData.dy];
        
   end
end
fclose(fid); 
disp(['read ',num2str(lcount),' lines (max is ',num2str(lmax),' lines)']);

% plot the points
	zt=plane_list(length(plane_list)).z;
	plotcurrent(xp,yp,up,vp,zt);
	%now also add the structure
	points=find(shapes.xyz(:,3)>zt-Ztol & shapes.xyz(:,3)<zt+Ztol);
	hold on
	plotshapes(points, shapes.xyz)
    title(['currents between ',num2str(1000*(zt-Ztol)), ' and ',num2str(1000*(zt+Ztol)) ,' mm'])
return

function   LineData=ProcessLineJ(tline)
[A,count,errmsg,nextindex]  = sscanf(tline,'%f %f %f %f %s %f %f %s %f');
   if length(errmsg) > 0
       LineData.type='error';
       LineData.text=errmsg;
       LineData.code='Z';
       disp(errmsg);
       disp(tline);
   else
       LineData.x=A(1);
       LineData.y=A(2);
       LineData.z=A(3);
       LineData.dx=A(4);
       LineData.dy=A(8);
   end
return
               
function   LineData=ProcessLineR(tline)
[A,count,errmsg,nextindex]  = sscanf(tline,'%f %f %f %f %f %f');
   if length(errmsg) > 0
       LineData.type='error';
       LineData.text=errmsg;
       LineData.code='Z';
       disp(errmsg);
       disp(tline);
   else
       LineData.x=A(1);
       LineData.y=A(2);
       LineData.z=A(3);
       LineData.dx=A(4);
       LineData.dy=A(5);
   end
return

function   LineData=ProcessLine(tline)
   LineData.code = upper(tline(1));
   switch LineData.code
       case '0' % title
           LineData.text=tline(2:length(tline));
           LineData.type='title';
       case '*','%','#' %comments   
           LineData.text=tline(2:length(tline));
           LineData.type='comment';
           LineData.code='*';
       case 'Q' % set of 4 xyz
              [A,count,errmsg,nextindex]  = sscanf(tline,'%s %f %f %f %f %f %f %f %f %f %f %f %f %f');
               if length(errmsg) > 0
                   LineData.type='error';
                   LineData.text=errmsg;
                   LineData.code='Z';
               else
                   LineData.type='Quad';
                   LineData.id=A(2);
                   for j=1:4
                     P(j).x=A(j*3);
                     P(j).y=A(j*3+1);
                     P(j).z=A(j*3+2);
                     LineData.P(j)=P(j);
                   end                   
               end
        case 'T' % set of 3 xyz
              [A,count,errmsg,nextindex]  = sscanf(tline,'%s %f %f %f %f %f %f %f %f %f %f %f %f %f');
               if length(errmsg) > 0
                   LineData.type='error';
                   LineData.text=errmsg;
               else
                   LineData.type='Tri';
                   LineData.id=A(2);
                   for j=1:3
                     P(j).x=A(j*3);
                     P(j).y=A(j*3+1);
                     P(j).z=A(j*3+2);
                     LineData.P(j)=P(j);
                   end                   
               end
       case 'N','G','B','D','C','F','R','E'
           %Name,Group,Boundary,Dielectric,Conductor,F?,Recusive,E?
           % see zbuf source files - InOut and input
           LineData.type='not decoded';
           LineData.text=tline;
           LineData.code='Z';
       otherwise
           LineData.type='not recognised';
           LineData.text=tline;
           LineData.code='Z';
   end
return

function [pointer,array,new]=getpointer(searchvalue,array)
    places=find(array.ids == searchvalue);
    if length(places) > 0
        pointer=places(1);
        new=false;
    else
        array.ids=[array.ids,searchvalue];
        pointer=length(array.ids);
        new=true;
    end
return


function plotcurrent(xp,yp,up,vp,z)
	figure
	quiver(xp*1000,yp*1000,up,vp);
	%title(['currents at height ',num2str(1000*z), ' mm'])
return

function plotshapes(pointlist, xyz)
    j=1;
    while j<length(pointlist)
        grpid=xyz(pointlist(j),5);
        pltxyz=xyz(pointlist(j),1:3);
        while j<length(pointlist) && (grpid==xyz(pointlist(j+1),5))
            j=j+1;
            pltxyz=[pltxyz;xyz(pointlist(j),1:3)];
        end
        line(pltxyz(:,1)*1000,pltxyz(:,2)*1000,pltxyz(:,3)*1000,'color','r');
        hold on
        j=j+1;
    end
    hold off
return



And the fastHenry input file:
*printed circuit board
* September 2007 David Lee
.units MM
.default z=0 sigma=5.8e4


*Layer 2 earth plane - model as simple plane with holes in it 
Glayer2 x1=0 x2=41 x3=41 y1=24.3 y2=24.3 y3=-24.3 z1=-0.3 z2=-0.3 z3=-0.3 thick=0.105
+ seg1 = 30 seg2 = 40
+ hole circle (24.5,0,-0.3,5)
+ hole rect (0,4,-0.3,16.4,5.5,-0.3)
+ hole rect (0,-4,-0.3,16.4,-5.5,-0.3)
+ hole circle (11.4,11.8,-0.3,1.5)
+ hole circle (11.4,-11.8,-0.3,1.5)
+ hole circle (40,11.8,-0.3,1.5)
+ hole circle (40,-11.8,-0.3,1.5)
* connection points to plane
+NVEA (11,-21,-0.3)
+NVEB (13.85,-21,-0.3)
+NVEC (16.7,-21,-0.3)
+NVED (19.55,-21,-0.3)
+NVEE (22.4,-21,-0.3)
+NVEF (25.25,-21,-0.3)
+NVEG (28.1,-21,-0.3)
+NVEH (30.95,-21,-0.3)
+NVEI (33.8,-21,-0.3)
+NVEJ (36.65,-21,-0.3)
+NEVA (11,21,-0.3)
+NEVB (13.85,21,-0.3)
+NEVC (16.7,21,-0.3)
+NEVD (19.55,21,-0.3)
+NEVE (22.4,21,-0.3)
+NEVF (25.25,21,-0.3)
+NEVG (28.1,21,-0.3)
+NEVH (30.95,21,-0.3)
+NEVI (33.8,21,-0.3)
+NEVJ (36.65,21,-0.3)
+NETA (8,0,-0.3) 
+NETB (14,0,-0.3)
+NETC (11,-3,-0.3)
+NETD (11,3,-0.3) 
+NETE (8.9,-2.1,-0.3)
+NETF (8.9,2.1,-0.3) 
+NETG (13.1,-2.1,-0.3) 
+NETH (13.1,2.1,-0.3) 
+NETI (6.5,0,-0.3) 
+NETJ (4,0,-0.3)  
+NETK (1.5,0,-0.3) 
+NETL (6.5,2.5,-0.3) 
+NETM (4,2.5,-0.3)
+NETN (1.5,2.5,-0.3) 
+NETO (6.5,-2.5,-0.3) 
+NETP (4,-2.5,-0.3) 
+NETQ (1.5,-2.5,-0.3)
+NTEST (34.1,0,-0.3)

*top surface connection to cathode
G1a x1=0 x2=14.7 x3=14.7 y1=-4 y2=-4 y3=4 z1=0 z2=0 z3=0 thick=0.105 
+NETA1 (8,0,0) 
+NETB1 (14,0,0)
+NETC1 (11,-3,0)
+NETD1 (11,3,0) 
+NETE1 (8.9,-2.1,0)
+NETF1 (8.9,2.1,0) 
+NETG1 (13.1,-2.1,0) 
+NETH1 (13.1,2.1,0) 
+NETI1 (6.5,0,0) 
+NETJ1 (4,0,0)  
+NETK1 (1.5,0,0) 
+NETL1 (6.5,2.5,0) 
+NETM1 (4,2.5,0)
+NETN1 (1.5,2.5,0) 
+NETO1 (6.5,-2.5,0) 
+NETP1 (4,-2.5,0) 
+NETQ1 (1.5,-2.5,0)
+ file=NONE
+ contact initial_grid (15, 30) 
*+ contact equiv_rect n_kathode (3,-1,0,2,4)
+contact connection n_kathode (9.5,-1,0,3,2,2.5)


*Vias to the output earth tab
*need equivs only on old style earth plane
NETA2 y=0 X=8 Z=-0.3
EETA NETA1 NETA2 W=0.7 H=0.7
.Equiv NETA NETA2
NETB2 y=0 X=14 Z=-0.3
EETB NETB1 NETB2 W=0.7 H=0.7
.Equiv NETB NETB2
NETC2 y=-3 X=11 Z=-0.3
EETC NETC1 NETC2 W=0.7 H=0.7
.Equiv NETC NETC2
NETD2 y=3 X=11 Z=-0.3
EETD NETD1 NETD2 W=0.7 H=0.7
.Equiv NETD NETD2
NETE2 y=-2.1 X=8.9 Z=-0.3
EETE NETE1 NETE2 W=0.7 H=0.7
.Equiv NETE NETE2
NETF2 y=2.1 X=8.9 Z=-0.3
EETF NETF1 NETF2 W=0.7 H=0.7
.Equiv NETF NETF2
NETG2 y=-2.1 X=13.1 Z=-0.3
EETG NETG1 NETG2 W=0.7 H=0.7
.Equiv NETG NETG2
NETH2 y=2.1 X=13.1 Z=-0.3
EETH NETH1 NETH2 W=0.7 H=0.7
.Equiv NETH NETH2
NETI2 y=0 X=6.5 Z=-0.3
EETI NETI1 NETI2 W=0.7 H=0.7
.Equiv NETI NETI2
NETJ2 y=0 X=4 Z=-0.3
EETJ NETJ1 NETJ2 W=0.7 H=0.7
.Equiv NETJ NETJ2
NETK2 y=0 X=1.5 Z=-0.3
EETK NETK1 NETK2 W=0.7 H=0.7
.Equiv NETK NETK2
NETL2 y=2.5 X=6.5 Z=-0.3
EETL NETL1 NETL2 W=0.7 H=0.7
.Equiv NETL NETL2
NETM2 y=2.5 X=4 Z=-0.3
EETM NETM1 NETM2 W=0.7 H=0.7
.Equiv NETM NETM2
NETN2 y=2.5 X=1.5 Z=-0.3
EETN NETN1 NETN2 W=0.7 H=0.7
.Equiv NETN NETN2
NETo2 y=-2.5 X=6.5 Z=-0.3
EETo NETo1 NETo2 W=0.7 H=0.7
.Equiv NETo NETo2
NETP2 y=-2.5 X=4 Z=-0.3
EETP NETP1 NETP2 W=0.7 H=0.7
.Equiv NETP NETP2
NETQ2 y=-2.5 X=1.5 Z=-0.3
EETQ NETQ1 NETQ2 W=0.7 H=0.7
.Equiv NETQ NETQ2

*Side earth sections connected by vias
G1c x1=0 x2=41 x3=41 y1=18 y2=18 y3=24.3 z1=0 z2=0 z3=0 thick=0.105 file=NONE
+ contact initial_grid (20, 6) 
+NEVA1 (11,21,0)
+NEVB1 (13.85,21,0)
+NEVC1 (16.7,21,0)
+NEVD1 (19.55,21,0)
+NEVE1 (22.4,21,0)
+NEVF1 (25.25,21,0)
+NEVG1 (28.1,21,0)
+NEVH1 (30.95,21,0)
+NEVI1 (33.8,21,0)
+NEVJ1 (36.65,21,0)
+N1c_c1 (11,18.5,0)
+N1c_c2 (36.5,18.5,0)

*+ contact trace (-3700,0,150,-1700,0,150,50,1)
*Vias to the track
NEVA2 y=21 X=11 Z=-0.3
EEVA NEVA1 NEVA2 W=0.7 H=0.7
.Equiv NEVA NEVA2
NEVB2 y=21 X=13.85 Z=-0.3
EEVB NEVB1 NEVB2 W=0.7 H=0.7
.Equiv NEVB NEVB2
NEVC2 y=21 X=16.7 Z=-0.3
EEVC NEVC1 NEVC2 W=0.7 H=0.7
.Equiv NEVC NEVC2
NEVD2 y=21 X=19.55 Z=-0.3
EEVD NEVD1 NEVD2 W=0.7 H=0.7
.Equiv NEVD NEVD2
NEVE2 y=21 X=22.4 Z=-0.3
EEVE NEVE1 NEVE2 W=0.7 H=0.7
.Equiv NEVE NEVE2
NEVF2 y=21 X=25.25 Z=-0.3
EEVF NEVF1 NEVF2 W=0.7 H=0.7
.Equiv NEVF NEVF2
NEVG2 y=21 X=28.1 Z=-0.3
EEVG NEVG1 NEVG2 W=0.7 H=0.7
.Equiv NEVG NEVG2
NEVH2 y=21 X=30.95 Z=-0.3
EEVH NEVH1 NEVH2 W=0.7 H=0.7
.Equiv NEVH NEVH2
NEVI2 y=21 X=33.8 Z=-0.3
EEVI NEVI1 NEVI2 W=0.7 H=0.7
.Equiv NEVI NEVI2
NEVJ2 y=21 X=36.65 Z=-0.3
EEVJ NEVJ1 NEVJ2 W=0.7 H=0.7
.Equiv NEVJ NEVJ2

G1d x1=0 x2=41 x3=41 y1=-24.3 y2=-24.3 y3=-18 z1=0 z2=0 z3=0 thick=0.105 file=NONE
+ contact initial_grid (20, 6) 
+NVEA1 (11,-21,0)
+NVEB1 (13.85,-21,0)
+NVEC1 (16.7,-21,0)
+NVED1 (19.55,-21,0)
+NVEE1 (22.4,-21,0)
+NVEF1 (25.25,-21,0)
+NVEG1 (28.1,-21,0)
+NVEH1 (30.95,-21,0)
+NVEI1 (33.8,-21,0)
+NVEJ1 (36.65,-21,0)
*+ contact trace (-3700,0,150,-1700,0,150,50,1)
*Vias to the track
NVEA2 y=-21 X=11 Z=-0.3
EVEA NVEA1 NVEA2 W=0.7 H=0.7
.Equiv NVEA NVEA2
NVEB2 y=-21 X=13.85 Z=-0.3
EVEB NVEB1 NVEB2 W=0.7 H=0.7
.Equiv NVEB NVEB2
NVEC2 y=-21 X=16.7 Z=-0.3
EVEC NVEC1 NVEC2 W=0.7 H=0.7
.Equiv NVEC NVEC2
NVED2 y=-21 X=19.55 Z=-0.3
EVED NVED1 NVED2 W=0.7 H=0.7
.Equiv NVED NVED2
NVEE2 y=-21 X=22.4 Z=-0.3
EVEE NVEE1 NVEE2 W=0.7 H=0.7
.Equiv NVEE NVEE2
NVEF2 y=-21 X=25.25 Z=-0.3
EVEF NVEF1 NVEF2 W=0.7 H=0.7
.Equiv NVEF NVEF2
NVEG2 y=-21 X=28.1 Z=-0.3
EVEG NVEG1 NVEG2 W=0.7 H=0.7
.Equiv NVEG NVEG2
NVEH2 y=-21 X=30.95 Z=-0.3
EVEH NVEH1 NVEH2 W=0.7 H=0.7
.Equiv NVEH NVEH2
NVEI2 y=-21 X=33.8 Z=-0.3
EVEI NVEI1 NVEI2 W=0.7 H=0.7
.Equiv NVEI NVEI2
NVEJ2 y=-21 X=36.65 Z=-0.3
EVEJ NVEJ1 NVEJ2 W=0.7 H=0.7
.Equiv NVEJ NVEJ2


*gate connection
G1b x1=15.2 x2=34.1 x3=34.1 y1=-10 y2=-10 y3=10 z1=0 z2=0 z3=0 thick=0.105 file=NONE
+ contact initial_grid (21, 22) 
*+contact connection nx_g1b_1 (20,-2,0,1,1,4)
*+contact connection nx_g1b_2 (30,-2,0,1,1,4)
*+ contact equiv_rect n_gate (20,-2,0,1,4)
+ contact connection n_gate (23,-1,0,3,2,2.5)
+ contact connection nx_g1b_2 (30,-1,0,3,2,2.5)
+NVGA1 (21.0,0,0)
* above contact out of place to be unique location
+NVGB1 (27.5,0,0)
+NVGC1 (24.5,-3,0)
+NVGD1 (24.5,3,0)
+NVGE1 (22.4,-2.1,0)
+NVGF1 (22.4,2.1,0)
+NVGG1 (26.6,-2.1,0)
+NVGH1 (26.6,2.1,0)
*+contact connection n1be (15.5,9.5,0,18.5,0.5,2.5)
*+contact connection n1be (17,9,0,15,1,2.5)
*Contacts along the edge to g1e. grid is 0.9x 0.9y
+n1be1 (15.2,10,0) n1be2 (16.1,10,0) n1be3 (17,10,0)
+n1be4 (17.9,10,0) n1be5 (18.8,10,0) n1be6 (19.6,10,0)

+contact connection n1bf (17,-10,0,15,1,2.5)
*+ contact trace (-3700,0,150,-1700,0,150,50,1)
*gate on other side of board
G6b x1=15.2 x2=34.1 x3=34.1 y1=-10 y2=-10 y3=10 z1=-1.5 z2=-1.5 z3=-1.5 thick=0.105 file=NONE
+ contact initial_grid (21, 22) 
+NVGA2 (21.0,0,-1.5)
* above contact out of place by 0.5 to be unique location
+NVGB2 (27.5,0,-1.5)
+NVGC2 (24.5,-3,-1.5)
+NVGD2 (24.5,3,-1.5)
+NVGE2 (22.4,-2.1,-1.5)
+NVGF2 (22.4,2.1,-1.5)
+NVGG2 (26.6,-2.1,-1.5)
+NVGH2 (26.6,2.1,-1.5)
*connect to gate on other side of board

EVGA NVGA1 NVGA2 W=0.7 H=0.7
EVGB NVGB1 NVGB2 W=0.7 H=0.7
EVGC NVGC1 NVGC2 W=0.7 H=0.7
EVGD NVGD1 NVGD2 W=0.7 H=0.7
EVGE NVGE1 NVGE2 W=0.7 H=0.7
EVGF NVGF1 NVGF2 W=0.7 H=0.7
EVGG NVGG1 NVGG2 W=0.7 H=0.7
EVGH NVGH1 NVGH2 W=0.7 H=0.7

G1e x1=10.4 x2=41 x3=41 y1=10 y2=10 y3=13.8 z1=0 z2=0 z3=0 thick=0.105 file=NONE
+ contact initial_grid (34, 9)
*grid must give same spacing as connecting areas = 0.9 for g1b 
*+contact connection n1eb (15.5,10,0,18.5,0.5,2.5)
*connections along the edge to g1b at pitch of that plane
*+contact connection n1eb (17,10,0,15,1,2.5)
+n1eb1 (15.2,10,0) n1eb2 (16.1,10,0) n1eb3 (17,10,0)
+n1eb4 (17.9,10,0) n1eb5 (18.8,10,0) n1eb6 (19.6,10,0)
+N1e_c1 (11,13.2,0)
+N1e_c2 (36.5,13.2,0)
.equiv n1eb1 n1be1
.equiv n1eb2 n1be2
.equiv n1eb3 n1be3
.equiv n1eb4 n1be4
.equiv n1eb5 n1be5
.equiv n1eb6 n1be6

G1f x1=10.4 x2=41 x3=41 y1=-13.8 y2=-13.8 y3=-10 z1=0 z2=0 z3=0 thick=0.105 file=NONE
+ contact initial_grid (30, 9) 
*+contact connection n1eb (15.5,10,0,18.5,0.5,2.5)
+contact connection n1fb (17,-11,0,15,1,2.5)
+N1f_c1 (11,-13.2,0)
+N1f_c2 (36.5,-13.2,0)
.equiv n1fb n1bf

*n_earth x=34.1 y=0 z=-0.3
*.equiv ntest n_earth
*n_input x=34.1 y=0 z=-30
*ETT n_input n_earth W=1 H=1

.equiv n_gate n_kathode

.external N1c_c2 N1e_c2


.freq fmin=1e-1 fmax=1e8 ndec=0.25
.end



David Lee
Power Electronics, UK
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
FastFieldSolvers Forum © 2020 FastFieldSolvers S.R.L. Go To Top Of Page
Powered By: Snitz Forums 2000 Version 3.4.06