|
Input files
|
FieldSearch0.MIN,FieldSearch0.EIN,FieldSearch.MIN,FieldSearch.EIN,FieldSearch.SCR,FieldSearch.pl,FieldSearch.txt
EStatAuto.zip
|
|
Description
|
This example illustrates how to automate EStat calculations using a Perl script to control program operation and to organize output data. The top figure shows the test geometry. The boundaries at the left and right have applied potential 9.0 kV and 0.0 kV respectively while the central electrode has potential 4.0 kV. The goal is to determine the on-axis values of electric field on the left and right electrodes as a function of the central electrode position and to find the position where the fields are equal. The central electrode is shifted axially to 40 positions using the XSHIFT command in Mesh. The shift distance is a pass parameter set by a controlling Perl script. The script FieldSearch.pl illustrates several useful Perl techniques:
- Opening a text output file and writing formatted results.
- A do loop to run multiple instances of Mesh and EStat.
- How to launch Field Precision programs in the background mode with pass parameters.
- Opening a data file for input.
- Searching the file for a line with a specified string.
- Extracting values from data lines with multiple entries.
|
|
Results
|
The following conditions are assumed: 1) a version of Perl is installed, 2) the input files are collected in a working directory and 3) the Data folder command in FPController is set to that location. The Command line button opens a terminal window. The full set of calculations is initiated by typing perl FieldSearch.pl ENTER. The run set takes only a few seconds and produces the text file FieldSearch.txt with the content:
Shift E(0.0) E(9.0)
============================================
-2.00 1.86850715E+05 7.12800559E+04
-1.90 1.82649225E+05 7.22545037E+04
-1.80 1.78416083E+05 7.32583356E+04
-1.70 1.74166404E+05 7.42902406E+04
...
1.50 7.94972675E+04 1.23251880E+05
1.60 7.79212042E+04 1.25256469E+05
1.70 7.64095072E+04 1.27289344E+05
1.80 7.49515226E+04 1.29347230E+05
1.90 7.35505372E+04 1.31429018E+05
2.00 7.22028915E+04 1.33537682E+05
The results are plotted in the lower figure. The fields amplitudes are equal with a displacement of 0.36 cm.
|
|
Comments
|
In each step, the EStat calculation requires the completed Mesh output file FieldSearch.MOU and the analysis controlled by FieldSearch.SCR requires the EStat output file FieldSearch.EOU. Fortunately, the Perl system command has the useful property that script operation is suspended until a subtask is complete. Hence, there is no problem of synchronization.
|