Engineering Software: INTEGRATED API - Simple Insulator Example using Excel

Uploaded by IntegratedEngSoft on 02.02.2012

The ELECTRO quick insulator model, one of the Excel samples provided for the INTEGRATED
API, produces a quick calculation of the maximum fields on an insulator at multiple positions
in between two electrodes. When we activate Excel and run the sample, you see how the
script draws lines representing two planar electrodes, and a circle representing a long
rod of insulator in between them. The script will redraw and re-solve the model with the
rod in as many positions as are specified, apply material and voltages to the geometry,
and then calculate the maximum field on the insulator at every position. It will then
record the positions in the spreadsheet and make up a plot of the maximum electric field
versus insulator position. The plot peak occurs when the rod is at the center and the field
becomes lower as the rod moves further away.
Like the Geometry Tools example, the quick insulator example functions by invoking an
Excel macro which manipulates ELECTRO via the INTEGRATED API. From the developer tab
within Excel, click the visual basic icon in order to open up the actual macro. The
macro is written in visual basic. It begins by defining a bunch of variables that will
be needed and then invokes IES dot document as OBJ, and then waits a few seconds in order
to be sure that ELECTRO is running before it begins sending commands. We invoke any
API function by typing OBJ dot then give an API function name for ELECTRO, then in brackets
put the parameters needed by the function. Next we create the names “Insulator, Voltage1
and Voltage2”. We read a value out of the worksheet cell B1, in the case shown here
a value of ten. Then for ten steps, we perform the same operation: delete any existing geometry;
then create a line and add it to the reference “Voltage1”; create another line and add
it to “Voltage2”; create a circle out of a 360 degree arc and add it to “Insulator”;
then assign physics properties to the geometry. We set the material property of the insulator
as glass, and the voltages as 0 and 1000 volts. Next invoke the solver, then a function which
reports the maximum value of the field on the selected segment. A reference is created
to the successive cells A4, A5, etc as we cycle through for different “i” numbers.
The macro writes the values of the position, then of the maximum field into the cells A4,
B4, then on to the next iteration A5, B5, and so on. So long as we have no yet reached
the maximum number, we always cycle back in the loop and create another pair of segments
and another circle, and the circle is moved in increments of “i” at every step. When
the macro has finished the loop, the worksheet will automatically update the plot for the
new data.