HiPhi boundary input from EStat

November 23rd, 2008

Many improvements to our programs follow from user suggestions. My consulting projects often provide motivations for new features. I am presently working on a simulation of a large cylindrical vacuum insulator for a pulsed-electron-beam injector. The issue is whether non-symmetrical flaws in the insulator surface will cause substantial field perturbations. I started by creating a 2D EStat solution for the ideal insulator for the following reasons:

  • I wanted to get a sense of the baseline electrical field magnitude in different regions and to check the sensitivity to changes in the dielectric properties of surrounding structures.
  • I could use the DXF import capability of the Mesh drawing editor to create a set of outlines for the complex turnings. After testing, I moved them directly to the MetaMesh script.
  • I wanted benchmark values to check that the 3D solution was set up correctly.

Because 2D solutions run quickly, I incorporated the entire injector assembly in the mesh. Extending this solution volume to three dimensions would have resulted in a huge mesh and many hours of run time. I feel that if a run takes more than one hour, there is probably a better way to solve the problem.

Since the flaws were relatively localized, it would be possible to get a good idea of their effect by limiting the axial extent of the solution to a space near the insulator. In this case, I could define a fixed-potential region on the solution volume boundaries in -z and +z and assign a spatial variation using data from the EStat solution. The existing version of HiPhi supported the definition of potential variations from mathematical functions using the command:

POTENTIAL NoReg > f(x,y,z)

Here, f(x,y,z) is any algebraic function of the Cartesian coordinates. In order to use the feature, it would have been necessary to take a radial scan of potential and then to fit the results with a power series  in √[x^2 + y^2]. This approach seemed like it would be a lot of work, and I didn’t feel like doing it.

Instead, I took advantage of my unique position as deity of the HiPhi source code and added a new program feature. It is ideally suited to using a 2D solution as the basis of a 3D microscopic solution. Here is the corresponding script command

POTENTIAL NoReg TABLE [x,y,z,r] TabName

The string TabName is the name of a text file defining the potential variation along the specified direction (the variable r is interpreted as √[x^2+y^2]). It consists of a set of data lines:

r[n]    phi(r[n])

For the project I prepared tables for the downstream and upstream boundaries directly from EStat scans, using ConText to remove unwanted columns. The process took only a few minutes.

The figure below shows a test solution for the potential inside a grounded cylinder. The bottom boundary in z is grounded and the potential on the top follows a tabular variation in r (a partial cosine function). The top picture shows equipotential lines in the plane x = 0.0 and the bottom shows lines in a plane normal to z near the defined fixed-potential boundary.

I modified the HiPhi instruction manual, describing how to use the new command forms. While I was at it, I decided to ex[and the existing commands for relative dielectric constant, conductivity and space-charge density to handle table input.

For more information on HiPhi, please use this link: http://www.fieldp.com/hiphi.html.

Creating DXF files for Mesh

November 19th, 2008

Recently, I had a consulting job that required loading vectors from a complex CAD drawing to the Mesh drawing editor. The work gave me an opportunity to correct several small errors in Mesh when handling large drawing files. It was also a good time to reflect on optimal approaches to creating and importing DXF files for the program. There are two reasons why we included the capability:

  • Dedicated CAD programs have more features than we could include in the Mesh drawing editor. In particular, there are extensive options to fit arcs to drawing entities.
  • You can easily capture vector information from layouts prepared by others.

The second option applied to the consulting job. I started the project from a drawing prepared at a national laboratory using the latest version of AutoCAD. In this article, I wanted to share my experience and recommend a good CAD program to use with Mesh.

My work involves mostly mesh import and a little 2D design work. I am certainly not about to spend $4000 for AutoCAD. For many years, I used TurboCAD as an alternative. The program began as a basic 2D drawing utility with a cost of about $30. Over the years, under the relentless pressure of mail flyers and internal reminders from the program, I have dutifully upgraded to Version 14. In the effort to stuff in as many features as AutoCAD, TurboCAD has followed two unfortunate trends:

  • The program has become fragile, complex and generally unapproachable.
  • The price for the professional version has balooned to over $1000.

During the current project, I said a long overdue good-bye to TurboCAD. To begin, the DXF files I created crashed Mesh. After checking with a text editor, I discovered that TurboCAD was adding a thumbnail bitmap image to files by default! Why would anyone put this information in a neutral exchange file that is supposed to be in text format? I was able to turn off this feature, but ran into another problem that was the final straw: I was unable to split an arc vector at its midpoint. Although I followed the instructions exactly, the program refused to perform the operation, emitting an unhelpful error beep with no explanation. An hour’s search through the help utility provided no  information. I can only speculate that the arc occupied a different quantum state in a three-dimensional world view. Splitting the arc was apparently a greater challenge than splitting the atom.

Fortunately, there is a good alternative. QCAD is full-featured program that does only 2D drawings and works directly with DXF files. It has an attractive but idiosyncratic interface. Once I got the sense of how it works, I found it much easier to use than competing programs. It read the DXF file I got from the customer and split the arc with no complaint. Most important, it produces strictly-correct DXF files and has been tested to work with Mesh. In fact, it is a good idea to use QCAD as a prefilter. The program can read DXF files from a variety of sources and write output files in a clean format.

You can get a working basic copy of QCAD for free at

http://source\forge.net/projects/qcadbin-win/

Better yet, get the professional version and help support the work that’s been put into the program. The cost is only €24. It’s available at:

http://www.ribbonsoft.com/qcad.html

For more information on Mesh, please use this link: http://www.fieldp.com/mesh.html.

Dual voltage modulations in OmniTrak

November 16th, 2008

In the Track mode (single-particle orbits), OmniTrak has long had the capability of including temporal modulations of electric and magnetic fields to approximate RF fields in the long-wavelength limit. For electric fields, the procedure has been to multiply potential values by a modulation function M(t). Recently, I have worked on an application to design an RF ion extractor with a biased control electrode. This situation is fundamentally different. When applying a simple modulation, the assumption is that the spatial field distribution is self-similar. The only change with time is the normalization of the field solution. This type of field solution involves a reference potential (ground) and one independent value of the time-varying voltage.

With two independent time-varying electrode voltages, the spatial distribution of the field changes at each instant. Clearly, it would be impractical to solve for the three-dimensional electric field at each integration step of a particle orbit. Fortunately, there is a simple way to find the time-varying field when there are two independent voltages. We can understand the method with reference to the field solution illustrated in the first figure below. The simple three-electrode system has a ground plane at the bottom. Independent voltages may be applied to the electrode at the top left (V1) and right (V2). We can construct two normalized base solutions: solution S10 has V1 = 1.0 V and V2 = 0.0 V while solution S01 has V1 = 0.0 V and V2 = 1.0 V. In the absence of nonlinear materials, the set of all possible electrostatic solutions with arbitrary voltages V1 and V2 may be generated by a linear combination of the base functions:

S = V1*S10 + V2*S01.

To illustrate, the bottom solution in the first figure is the sum of the base functions. The same solution would follow from a direct HiPhi solution with V1 = V2 = 1.0 V.

The following procedure is used for modulated dual-voltage solutions in OmniTrak:

  • Prepare two base electrostatic solutions with HiPhi using the same mesh. One or more reference electrodes in both solutions are grounded (Φ = 0.0 V). In the first solution, one electrode (or set of electrodes) has V1 = 1.0 V and the other has V2 = 0.0 V. The voltages levels are reversed in the second solution.
  • Load the first solution with the EFIELD3D command. The program reads the mesh characteristics as well as the potential values at all nodes, Φ1(i,j,k). A normalization factor may be included in the command to set the amplitude V1 in solution S10.
  • Load the second solution with the new EFIELD3D2 command. In this case, OmniTrak checks that the mesh is identical to the previous one and stores the potential values Φ2(i,j,k). Again, a normalization factor may be used to set the amplitude V2 for S01.
  • The command MODFUNC E is used to define a modulation function M1(t) for S10, while the command MODFUNC E2 sets the modulation function M2(t) for S01.

During orbit tracking, the program uses electrostatic potential values of the form

Φ = M1(t)*S10 + M2(t)*S01,

as input to the electric field interpolation routine. Because much of the computational work involves identification of the element occupied by the particle, there is little change in the orbit tracking time penalty for a dual-voltage solution.

We can track a proton through the solution shown in the first figure to demonstrate the procedure. The Field section of the OmniTrak script includes the following commands:

EFIELD3D: ThreeElect01.HOU 100.0
MODFUNC(E) > sin(1.2566E7*$t)
EFIELD3D2: ThreeElect02.HOU 200.0
MODFUNC(E2) > sin(3.1416E7*$t)

The left-hand electrode has a sinusoidal variation at 2.0 MHz with amplitude 100 V. The peak electric field far from the gap is Ex = -2000 V/m. The voltage on the right-hand side varies at 5.0 MHz with amplitude 200 V (Ex = -4000.0 V/m). A 250 eV proton moving in z is injected near the left-hand boundary. The transit time over the 20.0 cm distance is about 1.0 μs. The commands

LISTON 1
LISTTYPE EField

specify an electric-field listing along the particle trajectory. The second figure shows the resulting electric field experienced by particle as a function of axial position.

For more information on OmniTrak, please use this link: http://www.fieldp.com/omnitrak.html.

What computer to buy

November 7th, 2008

I often have inquiries about the best computer to buy to run our software. A related issue is the maximum block of memory that can be allocated to a single task. This is a particularly vexing issue that I discussed in a previous article. With accumulating patches and security fixes, 32-bit Windows-XP has devolved to a state where it won’t allocate more than 1.2 GB to a single task, independent of the installed memory. This limit is constricting for the 3D AMaze programs and any technical software with extensive RAM requirements.

Fortunately, a economical solution is at hand. Most new computers have come with 64-bit processors for a year or two, and we are on the cusp of a shift to 64-bit operating systems. We have tested 64-bit compilations of our programs under both XP64 and Vista64 with the following results:

  • They are completely compatible.
  • They can address the full installed memory of the machines.

I recently purchased an HP desktop computer for one of our offices. Although the price was only about $900 (u.s.), it is close to ideal for large technical computations:

  • The system has a dual-core Intel processor with a respectable clock speed of 3.1 GHz and 4 GB of memory.
  • A few months ago, Microsoft was adding a premium of over $100 for 64-bit Vista. Now they are so eager to push the system, you can get the 64-bit operating system at no extra charge.
  • My experience is that Vista works as well as XP when you turn off the geegaws. The only difference is that the coasting operating system consumes about twice as much memory (~1 GB). Hard to imagine what it’s doing. Nonetheless, with 4.0 GB physical memory and 6.9 GB of virtual memory, the loss is not critical.
  • The major drawback of an HP computer is that you will have to spend about a half hour removing the junkware. Not too bad, except for the HP Games where you have to individually check 31 boxes to confirm that you are not an adolescent.

I am recommending that customers who are purchasing a computer get a 64-bit operating system. We are giving free 64-bit updates to users who have purchased a new software package or an update in the last two years. On new purchases, you can download both the 32 and 64-bit programs during the transition period.

Example library improvements

November 3rd, 2008

Learning technical programs can be difficult. There are many details to enter correctly and many potential pitfalls. My belief is that working examples are best way to help new users get a quick start. Over the years, the growth of our example libraries has been a bit haphazard. New examples reflecting current consulting projects could overlap existing ones. With too many choices, it would be difficult for a user to identify relevant examples.

This week we started a complete overhaul of the example libraries. We are making the following improvements:

  1. Elimination of redundant or non-essential entries.
  2. Complete retesting with the latest program versions and conversion to a consistent format.
  3. Creation of an example index for each program with short descriptions of the techniques employed.
  4. Production of a PNG illustration for each example. Using an image viewer, a user can quickly get a sense of the nature of the calculation.

With regard to last item, I highly recommend installing the FastStone Image Viewer, available at

http://www.faststone.org/index.htm

Finally, we appreciate any application examples you would like to contribute, and we welcome suggestions for useful examples.