<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Field Precision software tips &#187; Techniques</title>
	<atom:link href="http://fieldp.com/myblog/category/techniques/feed/" rel="self" type="application/rss+xml" />
	<link>http://fieldp.com/myblog</link>
	<description>Effective finite-element modeling of electromagnetic fields</description>
	<lastBuildDate>Thu, 05 Jan 2012 15:24:37 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Popup menus in RealBasic</title>
		<link>http://fieldp.com/myblog/2011/popup-menus-in-realbasic/</link>
		<comments>http://fieldp.com/myblog/2011/popup-menus-in-realbasic/#comments</comments>
		<pubDate>Sat, 03 Dec 2011 13:58:10 +0000</pubDate>
		<dc:creator>shumphries</dc:creator>
				<category><![CDATA[Educational]]></category>
		<category><![CDATA[Techniques]]></category>

		<guid isPermaLink="false">http://fieldp.com/myblog/?p=1224</guid>
		<description><![CDATA[<p>Popup (or contextual) menus appear when you right-click the mouse. They are a part of almost every Windows program. Nonetheless, it took me some effort to find out how to create popup menus in RealBasic with all the features that I needed. The examples supplied by Real Studio were either out-of-date or simplistic. The only other [...]]]></description>
			<content:encoded><![CDATA[<p>Popup (or contextual) menus appear when you right-click the mouse. They are a part of almost every Windows program. Nonetheless, it took me some effort to find out how to create popup menus in <strong>RealBasic </strong>with all the features that I needed. The examples supplied by Real Studio were either out-of-date or simplistic. The only other alternative was the user forum. I find it difficult to get useful information from forum threads, and I wish search engines didn&#8217;t include them. Many of the answers are off-the-point or even totally wrong. Spelling is iffy and grammar is almost non-existent. The layout is often confusing (<em>i.e.,</em> each answer often shows all the previous correspondence), so it&#8217;s difficult to gauge where you are on the path to a solution. Finally, the worst case is when you have to register to see the answer. Registering gets old after the first 1500 sites.</p>
<div class="wp-caption aligncenter" style="width: 610px"><img title="Example of a popup menu in RealBasic" src="http://www.fieldp.com/myblog/images/popup_menu.jpg" alt="Example of a popup menu in RealBasic" width="600" height="335" /><p class="wp-caption-text">Example of a popup menu in RealBasic</p></div>
<p>This article shows how to set up a popup menu using the current routines of <strong>RealBasic</strong>. An important feature is setting the enable status of menu entries. Except in the simplest programs, entries must be disabled depending on the program context to avoid illegal operations (<em>i.e.</em>, save a entity that hasn&#8217;t yet been created).</p>
<p>The example produces the popup menu shown in Fig. 1. Notice that some entries are grayed because rulers do not exist when the program opens. The code listed below is included in the <strong>MouseDown </strong>event of the associated window. Note the comment numbers added to the <em>Append </em>statement documenting the order of entries (separators don&#8217;t count). These indices are used in the code lines that set the enable status. It&#8217;s important to include the test</p>
<pre>if (HitItem &lt;&gt; nil) then
end if</pre>
<p>to avoid an error if the user clicks on a disabled menu entry.</p>
<pre>if IsContextualClick then
// ===============================
// Define menu extries
// ===============================
dim base as new MenuItem
base.Append( new MenuItem( "Create ruler" ) )  '1
base.Append( new MenuItem( "Analyze graph" ) )  '2
base.Append( new MenuItem( "Analyze drawing" ) )  '3
base.Append( new MenuItem( MenuItem.TextSeparator ) )
base.Append( new MenuItem( "Flip ruler" ) )  '4
base.Append( new MenuItem( "Hide/show rulers" ) )  '5
base.Append( new MenuItem( "Close ruler" ) )  '6
base.Append( new MenuItem( "Save ruler" ) )  '7
base.Append( new MenuItem( "Load ruler" ) )  '8
base.Append( new MenuItem( MenuItem.TextSeparator ) )
base.Append( new MenuItem( "Instruction manual" ) )  '9
base.Append( new MenuItem( "About FP UniScale" ) )  '10
base.Append( new MenuItem( MenuItem.TextSeparator ) )
base.Append( new MenuItem( "Exit program" ) )  '11

// ===============================
// Set the enabled status
// ===============================
if (RulersHidden) then
base.item(4).enabled = False   'Flip ruler
base.item(5).enabled = True    'Hide/show rulers
base.item(6).enabled = False   'Close ruler
base.item(7).enabled = False   'Save ruler
base.item(8).enabled = False   'Load ruler
else
// Ruler1 closed, Ruler2 closed
if ((not RulerOpen1) and (not RulerOpen2)) then
base.item(4).enabled = False  'Flip ruler
base.item(5).enabled = False  'Hide/show rulers
base.item(6).enabled = False  'Close ruler
base.item(7).enabled = False  'Save ruler
base.item(8).enabled = True   'Load ruler
// Ruler1 open, Ruler2 closed
elseif (RulerOpen1 and (not RulerOpen2)) then
base.item(4).enabled = True   'Flip ruler
base.item(5).enabled = True   'Hide/show rulers
base.item(6).enabled = True   'Close ruler
base.item(7).enabled = True   'Save ruler
base.item(8).enabled = True   'Load ruler

// Ruler1 closed, Ruler2 open
elseif ((not RulerOpen1) and RulerOpen2) then
base.item(4).enabled = True   'Flip ruler
base.item(5).enabled = True   'Hide/show rulers
base.item(6).enabled = True   'Close ruler
base.item(7).enabled = True   'Save ruler
base.item(8).enabled = True   'Load ruler
// Ruler1 open, Ruler2 open
else
base.item(4).enabled = True   'Flip ruler
base.item(5).enabled = True   'Hide/show rulers
base.item(6).enabled = True   'Close ruler
base.item(7).enabled = True   'Save ruler
base.item(8).enabled = False  'Load ruler
end if
end if

// ===============================
// Carry out actions
// ===============================
dim hitItem as MenuItem
hitItem = base.PopUp
if (HitItem &lt;&gt; nil) then
select case (HitItem.Text)
case("Analyze graph")
// Action code
case("Analyze drawing")
// Action code
case("Create ruler")
// Action code
case ("Flip ruler")
// Action code
case ("Load ruler")
// Action code
case ("Save ruler")
// Action code
case ("Close ruler")
// Action code
case("Instruction manual")
// Action code
case("About FP UniScale")
// Action code
case("Exit program")
// Action code
end select
end if
return true
end if</pre>
]]></content:encoded>
			<wfw:commentRss>http://fieldp.com/myblog/2011/popup-menus-in-realbasic/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Measure anything on your computer screen</title>
		<link>http://fieldp.com/myblog/2011/measure-anything-on-your-computer-screen/</link>
		<comments>http://fieldp.com/myblog/2011/measure-anything-on-your-computer-screen/#comments</comments>
		<pubDate>Fri, 25 Nov 2011 17:30:37 +0000</pubDate>
		<dc:creator>shumphries</dc:creator>
				<category><![CDATA[Educational]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Techniques]]></category>

		<guid isPermaLink="false">http://fieldp.com/myblog/?p=1200</guid>
		<description><![CDATA[<p>One of my all-time treasured possessions is a Gerber Variable Scale [1] (Fig. 1). It was an absolute must-have if you were doing science in the 60s and 70s. The idea was straightforward — the device was a ruler consisting of a precision spring that you could adjust to any length to match graphs or oscillographs [2]. [...]]]></description>
			<content:encoded><![CDATA[<p>One of my all-time treasured possessions is a Gerber Variable Scale [1] (Fig. 1). It was an absolute must-have if you were doing science in the 60s and 70s. The idea was straightforward — the device was a ruler consisting of a precision spring that you could adjust to any length to match graphs or oscillographs [2]. Simple but remarkably useful!</p>
<div class="wp-caption aligncenter" style="width: 610px"><img class=" " title="Figure 1. The Gerber Variable Scale (circa 1970)" src="http://www.fieldp.com/myblog/images/gerber_scale_s.jpg" alt="Figure 1. The Gerber Variable Scale (circa 1970)" width="600" height="226" /><p class="wp-caption-text">Figure 1. The Gerber Variable Scale (circa 1970)</p></div>
<p>Nowadays, practically everything I measure is on a computer screen. For this application, it&#8217;s almost impossible to use my old Gerber scale, although I have tried many times. For a couple decades, my dream has been to make something I could use on the computer that would be as useful and (hopefully) as simple. I tried several freeware screen rulers, but the results were disappointing. They were designed to measure <em>literal </em>distances on the computer screen (in pixels, mm, &#8230;) rather than the lengths of objects <em>displayed </em>on the screen. The situation was analogous to having a ruler that could measure the size of a sheet of paper, but not the dimensions of data  printed on the paper.</p>
<p>I am happy to announce that I have just completed my vision of the ideal screen measurement system, the Field Precision <strong>Universal Scale</strong>. With it, you can create custom rulers calibrated to graphical objects displayed on your computer screen by any program. The <strong>Universal Scale</strong> has other analysis features that extend well beyond simple rulers. The program is available for free download as a service of Field Precision to the science and engineering communities. The official release date is January 1, 2012. You can get a beta copy now at <a href="http://www.fieldp.com/fpuniscale.html" target="_blank">http://www.fieldp.com/fpuniscale.html</a>.</p>
<div class="wp-caption aligncenter" style="width: 610px"><img title="Figure 2. Universal Scale main window and sample ruler." src="http://www.fieldp.com/myblog/images/main_window_ruler.png" alt="Figure 2. Universal Scale main window and sample ruler." width="600" height="316" /><p class="wp-caption-text">Figure 2. Universal Scale main window and sample ruler.</p></div>
<p>Figure 2 shows the main window with a ruler displayed. Note that the program comes in a nice leather case. The push buttons on the left call up the three main functions:</p>
<ul>
<li>Create custom rulers that may be moved around the screen over other applications.</li>
<li>Measure points and digitize curves of graphs in publications and reports.</li>
<li>Measure dimensions on drawings and diagrams in documents.</li>
</ul>
<p>Figure 3 shows a screenshot of a drawing analysis. In the remainder of this article, I&#8217;ll describe some interesting features of the program.</p>
<div class="wp-caption aligncenter" style="width: 610px"><img title="Figure 3. Set up to analyze dimensions of a diagram in a publication." src="http://www.fieldp.com/myblog/images/measure_drawing.png" alt="Figure 3. Set up to analyze dimensions of a diagram in a publication." width="600" height="290" /><p class="wp-caption-text">Figure 3. Set up to analyze dimensions of a diagram in a publication.</p></div>
<ul>
<li>My Gerber Variable Scale may lie in a drawer for months between uses. When I take it out, I never have doubts about how it works. I tried to maintain the same user-friendliness in the <strong>Universal Scale</strong>. The challenge is that the program does a lot more than slide back-and-forth. I limited the program to few well-defined functions with minimal bells-and-whistles. Contextual instructions are displayed at each step, so it&#8217;s not necessary for users to memorize procedures.</li>
<li>Measurements with physical devices used to be fun in the old days, so I gave the program a retro look.</li>
<li>Calibration sheets are the key to program operation. They are translucent windows that act like tracing paper that can be moved over any displayed graphical material on the computer screen. Mouse clicks in the measurement sheet are used to calibrate rulers, graphs and drawings and to measure points.</li>
<li>I applied my experience with normal coordinates in finite-element analysis to measurements on graphs. The program uses a generalized trapezoid coordinate system. This means that you can obtain good measurements from badly-scanned graphs (rotations, distortions,&#8230;).</li>
</ul>
<p><strong>Footnotes</strong></p>
<p>[1] Unfortunately, it appears that the Gerber Variable Scale is no longer available for purchase. As a matter of historical interest, here is a link to the original manual: <a href="http://www.fieldp.com/myblog/examples/GerberVariableScale.pdf" target="_self">GerberVariableScale.pdf</a>.</p>
<p>[2] Oscillographs were Polaroid photographs of oscilloscope traces, the only way to record fast transient data before digitizers.</p>
]]></content:encoded>
			<wfw:commentRss>http://fieldp.com/myblog/2011/measure-anything-on-your-computer-screen/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Counter-intuition in permanent magnet circuits</title>
		<link>http://fieldp.com/myblog/2011/counter-intuition-in-permanent-magnet-circuits/</link>
		<comments>http://fieldp.com/myblog/2011/counter-intuition-in-permanent-magnet-circuits/#comments</comments>
		<pubDate>Tue, 13 Sep 2011 21:31:41 +0000</pubDate>
		<dc:creator>shumphries</dc:creator>
				<category><![CDATA[Educational]]></category>
		<category><![CDATA[Techniques]]></category>

		<guid isPermaLink="false">http://fieldp.com/myblog/?p=1181</guid>
		<description><![CDATA[<p>On average, physical intuition is useful half the time and misleading the other half. As a case in point, a trial user set up what he felt was the most basic magnet problem to test Magnum. The program returned results that differed from his expectation by about a factor of five. He contacted me to find [...]]]></description>
			<content:encoded><![CDATA[<p>On average, physical intuition is useful half the time and misleading the other half. As a case in point, a trial user set up what he felt was the most basic magnet problem to test <strong>Magnum</strong>. The program returned results that differed from his expectation by about a factor of five. He contacted me to find what was wrong with his calculation. As it turned out, his setup was perfectly correct and the program was returning the right answer. The expectation was wrong.</p>
<p>The concept of a magnetic circuit is often useful to estimate achievable magnetic flux density in a laboratory magnet (<em>i.e.</em>, a system with an iron flux conductor, a small air gap and a drive coil). The theory is described in Sect. 5.7 of my book <strong>Principles of Charged Particle Acceleration</strong> (available for free download at <a href="http://www.fieldp.com/cpa.html" target="_blank">http://www.fieldp.com/cpa.html</a>. The relationships follow from Ampere&#8217;s law and the conservation of magnetic flux. The issue is clouded for circuits driven by permanent magnets. In fact, I have to admit that Sect. 5.8 in my book is misleading. In reality, the gap field in a permanent magnet circuit depends on how the assembly is constructed.</p>
<div class="wp-caption aligncenter" style="width: 560px"><img title="Figure 1. Permag calculations of permanent magnetic circuits." src="http://www.fieldp.com/myblog/images/pmagposition_blines.png" alt="Figure 1. Permag calculations of permanent magnetic circuits." width="550" height="706" /><p class="wp-caption-text">Figure 1. Permag calculations of permanent magnetic circuits.</p></div>
<p>The issue can best be understood with an example. Figure 1 shows a cylindrical magnetic circuit for a <strong>PerMag </strong>calculation. The air gap and permanent magnet are cylindrical with 2.0 cm radius. The gap length is <em>Lg</em> = 1.0 cm and the magnetic length is <em>Lm</em> = 2.0 cm. The ideal permanent magnet has <em>Br</em> = 1.0 tesla and the iron has μr = 500. The intuitive view of a magnetic circuit is that the lines of <strong>B</strong> are forced to flow in the high-reluctance iron (<em>i.e.</em>, the iron is a magnetic conductor). In this case, the behavior of the circuit should not depend on the relative position of the permanent magnet and we expect the same gap field for the two geometries illustrated in Fig. 1. Under the assumption of contained flux, the theory in Sect. 5.8 predicts an average gap field:</p>
<p><em>Bg</em> = <em>Br</em>/(1 + <em>Lg</em>/<em>Lm</em>)</p>
<p>For parameters of calculation, formula implies <em>Bg</em> = 0.67 tesla.</p>
<p>The <strong>PerMag </strong>calculation gives a gap field of about <em>Bg</em> = 0.57 tesla for case <em>a</em>. The result is consistent with theory if we consider that there are flux losses from leakage and fringing flux. On the other hand, the gap field for the bottom configuration is only 0.15 tesla, a significant difference. Clearly, the idea that <strong>B</strong> lines are &#8220;<em>contained</em>&#8221; by the iron is wrong. We need a better understanding of the psychology of flux lines.</p>
<p>A line of magnetic flux density emerging from the left-hand side of the permanent magnet wants to find its way to the right hand side the easiest way possible (<em>i.e.</em>, the path of least reluctance). For case <em>a</em>, the <strong>B</strong> lines emerge directly into the air gap. Most of them follow the easiest path — cross the short gap and return through the iron. A fraction of the lines take a shortcut to the outer iron piece or return directly through air to the upstream side of the magnet.</p>
<p>In contrast, the <strong>B</strong> lines in case <em>b</em> must travel a relatively long distance through the iron stalk before reaching the air gap. The reluctance of the radial gap between the inner and outer iron pieces is less than that of the working gap. The result is that <strong>B</strong> lines cut out early and most of the flux never reaches the working gap. The example has an important practical implication. If the goal is to produce the maximum flux in an air gap of a permanent magnet circuit, the magnets should be adjacent to the gap.</p>
]]></content:encoded>
			<wfw:commentRss>http://fieldp.com/myblog/2011/counter-intuition-in-permanent-magnet-circuits/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Automatic 3D meshing of printed circuits</title>
		<link>http://fieldp.com/myblog/2011/automatic-3d-meshing-of-printed-circuits/</link>
		<comments>http://fieldp.com/myblog/2011/automatic-3d-meshing-of-printed-circuits/#comments</comments>
		<pubDate>Mon, 08 Aug 2011 14:22:26 +0000</pubDate>
		<dc:creator>shumphries</dc:creator>
				<category><![CDATA[NewFeatures]]></category>
		<category><![CDATA[Techniques]]></category>

		<guid isPermaLink="false">http://fieldp.com/myblog/?p=1144</guid>
		<description><![CDATA[<p>A recent trial user had an application that required creation of a three-dimensional mesh of a printed circuit. Such an object is thin in z with relatively complex spatial variations in x-y. The user attempted to represent the full complement of conductors as a single, thin STL solid object with thousands of facets. It would have [...]]]></description>
			<content:encoded><![CDATA[<p>A recent trial user had an application that required creation of a three-dimensional mesh of a printed circuit. Such an object is thin in <em>z</em> with relatively complex spatial variations in <em>x</em>-<em>y</em>. The user attempted to represent the full complement of conductors as a single, thin STL solid object with thousands of facets. It would have been astronomically difficult for <strong>MetaMesh </strong>to analyze such a structure. The task is equivalent to deciding whether a point is inside or outside a thread of a spider web.</p>
<p>In reviewing the application, it occurred to me that there was a much easier approach to model such a structure, based on technology that we had already incorporated in the two-dimensional <strong>Mesh </strong>program. The idea is to assign elements in a plane to regions according to values in a photographic image. The advantages are easy setup and high reliability. In this article, I will describe new <strong>MetaMesh </strong>capabilities for analyzing photographs and illustrate them with an example of a layer in a printed circuit.</p>
<div class="wp-caption aligncenter" style="width: 510px"><img title="Figure 1. Sample printed circuit, PNG format." src="http://www.fieldp.com/myblog/images/printed_circuit_01.png" alt="Figure 1. Sample printed circuit, PNG format." width="500" height="439" /><p class="wp-caption-text">Figure 1. Sample printed circuit, PNG format.</p></div>
<p>Figure 1 is a photograph of the test geometry. The image has only two colors — white represents thin conductors. In the benchmark example, conductors (Region 2) are mapped to a 1.0 mm layer in a uniform solution volume (air, Region 1). The first step is to set the interpretation of photographs. The following entries appear in the <em>GLOBAL</em> section of the <strong>MetaMesh </strong>script:</p>
<pre>INTERVALS  Lightness
  50.0  100.0  2
END</pre>
<p>The construct states that photographs will be interpreted in terms of lightness values (0.0 to 100.0 percent). Lighter areas will be assigned to Region 2. An <em>INTERVAL </em>section may contain up to 250 data lines — in this case, only one interval is needed. Alternatively, assignment may be via hue values (0.0 to 360.0 degrees) in the image.</p>
<p>Parts are basic building blocks in <strong>MetaMesh</strong>. The concept is flexible — parts range from simple geometric solids to complex STL shapes. We have added a new <em>PHOTO </em>part type. The following section defines a photo part in the example:</p>
<pre>PART
  Type Photo PC01.PNG 0.00  0.00  50.00  50.00
  Name PC
  Fab 1.00
END</pre>
<p>In the workbench frame, the photograph image is mapped into an <em>x</em>-<em>y</em> plane centered at <em>z</em> = 0.0 with thickness Δ<em>z</em> set by the fabrication parameter. The resulting solid can be moved to any position or orientation with optional <em>SHIFT </em>and <em>ROTATE </em>commands. In the example, the photographic image is contain in the file <em>PC01.PNG</em>. (<strong>MetaMesh </strong>also handles BMP and PCX formats.) The information is mapped to an area with spatial dimensions <em>xmin</em> = 0.0, <em>ymin </em>= 0.0, <em>xmax </em>= 50.0 and <em>ymax </em>= 50.0, independent of the image pixel dimensions. Figure 2 shows the resulting mesh in the slice plane <em>z</em> = 0.0, while Figure 3 shows a three view with perspective. The entire structure was created with the two simple statements listed above.</p>
<div class="wp-caption aligncenter" style="width: 560px"><img title="Figure 2. MetaMesh screen shot, slice in the plane z = 0.0." src="http://www.fieldp.com/myblog/images/printed_circuit_02.png" alt="Figure 2. MetaMesh screen shot, slice in the plane z = 0.0." width="550" height="450" /><p class="wp-caption-text">Figure 2. MetaMesh screen shot, slice in the plane z = 0.0.</p></div>
<div class="wp-caption aligncenter" style="width: 560px"><img title="Figure 3. Three dimensional view, printed-circuit example." src="http://www.fieldp.com/myblog/images/printed_circuit_03.png" alt="Figure 3. Three dimensional view, printed-circuit example." width="550" height="500" /><p class="wp-caption-text">Figure 3. Three dimensional view, printed-circuit example.</p></div>
<p>Photographic analysis is a powerful new feature of <strong>MetaMesh</strong>. It greatly simplifies the representation of multi-layer printed circuits and striplines for electromagnetic analysis. Complex printed-circuit assemblies can be built in two steps:</p>
<ol>
<li>Set up a foundation mesh with element layers of the appropriate thicknesses.</li>
<li>Use photographic layouts to set conductors or dielectrics in each layer. If there are different components in a single layer, they can be represented with different colors in the photograph.</li>
</ol>
<p>The photographic method has unlimited applications. Information from up to 250 photographs may be included in a <strong>MetaMesh </strong>script. The technique applies to any three-dimensional structure with photographic slice data, such as MRI scans.</p>
]]></content:encoded>
			<wfw:commentRss>http://fieldp.com/myblog/2011/automatic-3d-meshing-of-printed-circuits/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Modeling a cathode/focus-electrode gap with OmniTrak</title>
		<link>http://fieldp.com/myblog/2011/modeling-a-cathodefocus-electrode-gap-with-omnitrak/</link>
		<comments>http://fieldp.com/myblog/2011/modeling-a-cathodefocus-electrode-gap-with-omnitrak/#comments</comments>
		<pubDate>Mon, 01 Aug 2011 20:10:40 +0000</pubDate>
		<dc:creator>shumphries</dc:creator>
				<category><![CDATA[Educational]]></category>
		<category><![CDATA[Techniques]]></category>

		<guid isPermaLink="false">http://fieldp.com/myblog/?p=1129</guid>
		<description><![CDATA[<p>High-current electron-beam guns typically have the geometry of Fig. 1. The flat or concave cathode operates in the space-charge limited mode. A shaped focusing electrode compensates for the effect of beam-generated electric fields to generate a parallel or converging beam. The heated cathode is composed of a high-temperature material like tungsten. The focusing electrode is composed [...]]]></description>
			<content:encoded><![CDATA[<p>High-current electron-beam guns typically have the geometry of Fig. 1. The flat or concave cathode operates in the space-charge limited mode. A shaped focusing electrode compensates for the effect of beam-generated electric fields to generate a parallel or converging beam. The heated cathode is composed of a high-temperature material like tungsten. The focusing electrode is composed of a more easily-machined material like molybdenum. The narrow gap between the components prevents conductive heat loss and melting of the focusing electrode.</p>
<div class="wp-caption aligncenter" style="width: 560px"><img class=" " title="Figure 1. Two-dimensional Trak model of a high-current electron-beam gun" src="http://www.fieldp.com/myblog/images/cathodegap01.png" alt="Figure 1. Two-dimensional Trak model of a high-current electron-beam gun" width="550" height="327" /><p class="wp-caption-text">Figure 1. Two-dimensional Trak model of a high-current electron-beam gun</p></div>
<p>It is relatively easy to set a narrow gap in a two-dimensional <strong>Trak </strong>mesh. The task is more challenging for three-dimensional <strong>OmniTrak </strong>meshes, where large numbers of elements lead to long run times. One purpose of this article is to demonstrate how to a create a cathode surface with good facets by optimizing the fitting logic for parts of the cathode assembly. A second activity is to confirm that <strong>Trak </strong>and <strong>OmniTrak </strong>generate almost identical results for a test geometry.</p>
<p>The benchmark electron gun of Fig. 1 has a flat cathode with 2.0 mm  radius. The applied voltage on the cathode and focusing electrode is -54  kV. The focusing electrode shape gives some beam convergence in the  acceleration gap and a modest divergence after passing through the  extraction aperture. The combined effects of the focusing electrode  profile and the 0.2 mm gap give a beam with good current-density  uniformity and low emittance. A <strong>Trak </strong>calculation gives current density <em>je</em> = 16.4 ± 0.8 A/cm² at the cathode and total current 2.062 A.  The top plot in Fig. 2 shows the phase-space distribution  (<em>r, r&#8217;</em>) at <em>z</em> = 30.0 mm. Over-focusing at the edge is relatively  small.</p>
<div class="wp-caption aligncenter" style="width: 560px"><img title="Figure 2. Phase-space distributions (r,r') for the extracted beam at z = 30.0 mm" src="http://www.fieldp.com/myblog/images/cathodegap02.png" alt="Figure 2. Phase-space distributions (r,r') for the extracted beam at z = 30.0 mm" width="550" height="820" /><p class="wp-caption-text">Figure 2. Phase-space distributions (r,r&#39;) for the extracted beam at z = 30.0 mm</p></div>
<p>To minimize run time in <strong>OmniTrak</strong>, the calculation is performed in the first quadrant of the <em>x-y</em> plane (<em>x</em> ≥ 0.0 mm, <em>y</em> ≥ 0.0 mm) with symmetry boundaries at <em>x</em> = 0.0 mm and <em>y</em> = 0.0 mm for both the fields and electron trajectories. The element sizes near the emission surface have the same dimensions as those in the <strong>Trak </strong>calculation (Δ<em>x</em> = Δ<em>y</em> = 0.050 mm, Δ<em>z</em> = 0.125 mm). The mesh had 1.63 million elements. Figure 3 shows a slice view of the mesh geometry near the cathode surface.</p>
<div class="wp-caption aligncenter" style="width: 560px"><img title="Figure 3. Detail of the mesh for the OmniTrak calculation in the plane y = 0.0 mm" src="http://www.fieldp.com/myblog/images/cathodegap03.png" alt="Figure 3. Detail of the mesh for the OmniTrak calculation in the plane y = 0.0 mm" width="550" height="422" /><p class="wp-caption-text">Figure 3. Detail of the mesh for the OmniTrak calculation in the plane y = 0.0 mm</p></div>
<p>The cathode assembly is formed from three parts:</p>
<ul>
<li>A turning to represent the cathode, with outline specifications taken from the <strong>Trak </strong>input file. The part is associated with the <em>CATHODE </em>region (fixed potential equal to -54 kV) in the <strong>HiPhi </strong>and <strong>OmniTrak </strong>calculations.</li>
<li>A turning to represent the focusing electrode, again with outline vectors from the <strong>Trak</strong> input file (<em>FOCUS</em> region with -54 kV fixed potential).</li>
<li>A turning to represent the gap, with inner radius 2.0 mm and outer radius 2.2 mm. As shown, the shape extends a few elements past the cathode surface. The part is assigned to the <em>GAP</em> region, which has the same physical properties in the electrostatic calculation as the <em>VACUUM</em> region (εr = 1.0).</li>
</ul>
<p>I employed two techniques to ensure that the facets on the cathode surface were flat and well-formed. The first is simple: pick a foundation mesh that minimizes the work that <strong>MetaMesh</strong> must perform. In this case, I made sure that a foundation element boundary occurred at <em>z</em> = 0.0 mm, the position of the cathode surface. Here is the complete mesh specification in <em>z</em>:</p>
<pre>ZMesh
-2.00  -0.25   0.250
-0.25   0.50   0.125
0.50  30.00   0.250
End</pre>
<p>If the element boundary were at an arbitrary position (z ≠ 0.0 mm), then it would be necessary for <strong>MetaMesh </strong>to perform thousands of needless operations to shift facets.</p>
<p>The second technique is to plan fitting operations carefully. Fitting of a part is controlled by the commands:</p>
<pre>SURFACE REGION RegNo
SURFACE PART PartNo</pre>
<p>In response to the first command, <strong>MetaMesh </strong>collects all facets of the part that are shared with elements that have region number <em>RegNo</em>. The program them shifts the facet nodes toward the theoretical outer surface of the part.  The second command form has similar function, except that <strong>MetaMesh </strong>picks facets adjacent to elements with part number <em>PartNo</em>.</p>
<p>Let&#8217;s consider how fitting works for the cathode assembly. Here is a summary of fitting commands for the contiguous parts of the cathode assembly:</p>
<pre>PART
  Region: Gap
  Name: Gap
  Surface Region Cathode
  Surface Region Focus
END
PART
  Region: Cathode
  Name: Cathode
  Coat Vacuum Emission
END
PART
  Region: Focus
  Name: Focus
  Surface Region Vacuum
END</pre>
<p>To begin, note the order of parts. The dielectric part appears before parts with fixed potential. With this order, any shared nodes are assigned the region number of the \textttCATHODE or \textttFOCUS parts, giving the correct fixed-potential condition on the electrode surfaces.</p>
<p>I will point out some features of the fitting list and then explain how they work. The <em>GAP</em> part has its own region assignment and contains commands for fitting to both the <em>CATHODE</em> and <em>FOCUS</em>. The <em>CATHODE</em> part has no <em>SURFACE</em> command, while the <em>FOCUS</em> part has a single command for surfaces in contact with elements of the <em>VACUUM</em> region. The order is chosen to ensure that facets on the front and side faces of the cathode are shifted only in the <em>x-y</em> plane, not in <em>z</em>. Here is the logic:</p>
<ul>
<li>Fitting parts with sharp edges (like a cylinder or the annular shape of the <em>GAP</em>) involves ambiguity. Should the facet be moved toward one edge or the other? This is the reason why I extended the <em>GAP</em> past the <em>CATHODE</em> and <em>FOCUS</em>. The end is far enough away to ensure that <strong>MetaMesh </strong>moves facets to the inner and outer cylindrical surfaces when fitting the <em>GAP</em>. In other words, node displacements are purely in the <em>x-y</em> plane.</li>
<li>There are two reasons why there is no <em>SURFACE </em>command for the <em>CATHODE</em>: 1) nodes on the front surface already lie at <em>z</em> = 0.0 and 2) the side surfaces have already been positioned through fitting of the <em>GAP</em>.</li>
<li>The inner surface of the <em>FOCUS </em>has already been set by fitting of the <em>GAP</em>. The single <em>SURFACE </em>command specifies that front-surface facets (adjacent to <em>VACUUM </em>elements) should be adjusted. The <em>GAP </em>was defined as a separate region to ensure that only nodes on front surface facets are moved.</li>
<li>The <em>COAT </em>command for the <em>CATHODE </em>resets the region number of the nodes of facets adjacent to <em>VACUUM </em>elements. The new region number has the emission property in <strong>OmniTrak</strong>. Because the <em>GAP</em> has its own region number, only facets on the front face of the <em>CATHODE </em>are set as emitters.</li>
</ul>
<p>Figure 4 is a three-dimensional view of the completed cathode assembly. Facets on the front cathode face are flat and well-formed. The <strong>OmniTrak </strong>calculation gives a quadrant current of 0.512 A, corresponding to a total current 2.046 A. The bottom plot of Fig. 2 shows the phase-space distribution at <em>z</em> = 30.0 mm for 5024 model electrons. A comparison at this distance provides a sensitive test of correspondence. The distributions are almost identical. The beam is slightly larger in the <strong>OmniTrak </strong>calculation.</p>
<p>Trak and OmniTrak users can use this link to download input files for the calculations:</p>
<p><a href="http://www.fieldp.com/myblog/examples/cathodegapdemo.zip" target="_self">http://www.fieldp.com/myblog/examples/cathodegapdemo.zip</a></p>
<div class="wp-caption aligncenter" style="width: 560px"><img title="Figure 4. Three-dimensional view of the completed cathode and focus electrode." src="http://www.fieldp.com/myblog/images/cathodegap04.png" alt="Figure 4. Three-dimensional view of the completed cathode and focus electrode." width="550" height="474" /><p class="wp-caption-text">Figure 4. Three-dimensional view of the completed cathode and focus electrode.</p></div>
]]></content:encoded>
			<wfw:commentRss>http://fieldp.com/myblog/2011/modeling-a-cathodefocus-electrode-gap-with-omnitrak/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Identifying a proxy server</title>
		<link>http://fieldp.com/myblog/2011/identifying-a-proxy-server/</link>
		<comments>http://fieldp.com/myblog/2011/identifying-a-proxy-server/#comments</comments>
		<pubDate>Thu, 28 Jul 2011 16:53:27 +0000</pubDate>
		<dc:creator>shumphries</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Techniques]]></category>

		<guid isPermaLink="false">http://fieldp.com/myblog/?p=1107</guid>
		<description><![CDATA[<p>As part of the license management system, our main technical programs make an Internet check of the computer activation status. Setting up an activation setup is largely automatic on most computers, requiring little user effort. Some manual operations are necessary if the user&#8217;s computer is on a company network with a proxy server. This posting reviews [...]]]></description>
			<content:encoded><![CDATA[<p>As part of the license management system, our main technical programs make an Internet check of the computer activation status. Setting up an activation setup is largely automatic on most computers, requiring little user effort. Some manual operations are necessary if the user&#8217;s computer is on a company network with a proxy server. This posting reviews the procedure.</p>
<p>1) If the installed programs give an activation error message, the first step is to check whether you are on a proxy server. You can check this with your browser (the browser must have a record of proxy settings to communicate with the Internet).</p>
<p><strong>Firefox</strong>: Click on <em>Tools/Options</em> and then the <em>Advanced </em>tab. Activate the <em>Network </em>tab, In the <em>Connection </em>box, click on the <em>Settings </em>button. If you are on a proxy server, the settings will be listed in the dialog. Note the IP and port values for the HTTP proxy.</p>
<p><strong>Internet Explorer</strong>: Click on <em>Tools/Internet</em> options. Choose the <em>Connections </em>tab and then click on the <em>LAN settings</em> button. The proxy settings are listed in the dialog.</p>
<p>2) Field Precision programs will recognize the proxy server if you set the environmental variable <em>HTTP_PROXY</em>. To set a temporary value for testing, use the <em>Set</em> command from the command prompt (<strong>cmd.exe</strong>):</p>
<pre>set http_proxy=value</pre>
<p>If the proxy server does not require a user name and password, the value of <em>HTTP_PROXY</em> has the following form:</p>
<pre>http://proxyname:port
Example: set http_proxy=http://proxy.myprovider.net:8080</pre>
<p>Use the following form if the proxy server requires a user name and password:</p>
<pre>http://user:password@host:port
Example: set http_proxy=http://jsmith:ghRt334@proxy.company.com:8001/</pre>
<p>Check whether you can launch <strong>mesh.exe</strong> or <strong>metatmesh.exe</strong>.</p>
<p>3) If the programs run, you should set a permanent environmental variable. Procedures vary slightly in different versions of Windows — here is the one for NT. Run the <em>Control Panel </em>and click on <em>System</em>. Activate the <em>Advanced </em>tab to bring up the dialog shown in the figure. Click the button <em>Environmental variables </em>to show the second dialog. Click the appropriate <em>New </em>button to set a system-wide variable or one that will apply only to your user name. Fill in the variable name <em>HTTP_PROXY</em> and add a value as above.</p>
<div class="wp-caption aligncenter" style="width: 671px"><img class=" " title="Setting an environmental variable in Windows" src="http://www.fieldp.com/myblog/images/proxy.png" alt="Setting an environmental variable in Windows" width="661" height="398" /><p class="wp-caption-text">Setting an environmental variable in Windows</p></div>
]]></content:encoded>
			<wfw:commentRss>http://fieldp.com/myblog/2011/identifying-a-proxy-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Large FTP uploads</title>
		<link>http://fieldp.com/myblog/2011/large-ftp-uploads/</link>
		<comments>http://fieldp.com/myblog/2011/large-ftp-uploads/#comments</comments>
		<pubDate>Sat, 16 Jul 2011 20:51:13 +0000</pubDate>
		<dc:creator>shumphries</dc:creator>
				<category><![CDATA[Educational]]></category>
		<category><![CDATA[Techniques]]></category>

		<guid isPermaLink="false">http://fieldp.com/myblog/?p=1095</guid>
		<description><![CDATA[<p>An update of our software installation packages involves uploading 42 files with sizes that range from 20-120 MB. Each file must be placed in a different directory on our server. An FTP program like FileZilla is useful for day-to-day file updating, but lacks script operation features. In this case, an update would involve a tedious process [...]]]></description>
			<content:encoded><![CDATA[<p>An update of our software installation packages involves uploading 42 files with sizes that range from 20-120 MB. Each file must be placed in a different directory on our server. An FTP program like <strong>FileZilla </strong>is useful for day-to-day file updating, but lacks script operation features. In this case, an update would involve a tedious process of identifying 42 files and 42 destinations. The  situation is worse if we need to update programs from one of our secondary offices. Local Internet providers severely limit upload speed — the figure is 122 kB/s at our Colorado office.</p>
<p>One solution is to automate the process (<em>i.e.</em>, prepare the update files and then let the computer upload autonomously for several hours). <strong>WinSCP </strong>is a good freeware utility to help implement automated FTP transfers. It is available at <a href="http://winscp.net/eng/index.php" target="_self">http://winscp.net/eng/index.php</a>.</p>
<p>The documentation for <strong>WinSCP </strong>is a little convoluted, so I prepared an example based on my experience to help you set things up. To begin, download and install <strong>WinSCP</strong>. For convenience, put <em>c:\program files\winscp</em> on the path. Alternatively, copy the relatively small executable files to a location that is already on the path. I use a general directory <em>c:\batch</em>.</p>
<p>As an example, suppose you have the files</p>
<p>c:\distfiles\program01.exe<br />
c:\distfiles\program02.exe<br />
c:\distfiles\program03.exe<br />
c:\distfiles\program04.exe<br />
c:\distfiles\program05.exe</p>
<p>that should be copied to the directories</p>
<p>public_html/download/site01<br />
public_html/download/site02<br />
public_html/download/site03<br />
public_html/download/site04<br />
public_html/download/site05</p>
<p>on your server, automatically replacing any existing files with the same names. Suppose your site has the URL <em>mycompany.com</em>. The user name and password for FTP transfers is <em>myuser </em>and <em>mypassword</em>.</p>
<p>1) Use a text editor to create a file <em>FTPUpload.bat</em> in the directory <em>c:\distfiles</em> with the following single-line content:</p>
<pre>winscp.exe /console /script=FTPUpload.txt</pre>
<p>The batch file runs <strong>WinSCP </strong>in the console mode and calls up the script for instructions.</p>
<p>2) Create another file in the directory called <em>FTPUpload.txt</em> with the following content :</p>
<p>open ftp://myuser:mypassword@mycompany.com/public_html/download<br />
option confirm off<br />
cd site01<br />
put program01.exe<br />
cd ../site02<br />
put program02.exe<br />
cd ../site03<br />
put program03.exe<br />
cd ../site04<br />
put program04.exe<br />
cd ../site05<br />
put program05.exe<br />
exit</p>
<p>The first line opens a password-protected FTP session and transfers to a convenient directory. The second line ensures that the script will not pause for confirmation when replacing the old files. The subsequent lines migrate to directories and copy the appropriate files. Simply run the batch file and everything happens automatically. <strong>WinSCP </strong>maintains a console window to show the status of operations.</p>
<p><strong>Note</strong>: If you are bothered by world-class hackers breaking into your office, be careful about storing the file <em>FTPUpload.txt</em> with your site password.</p>
]]></content:encoded>
			<wfw:commentRss>http://fieldp.com/myblog/2011/large-ftp-uploads/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using Magnum to calculate flux coupling</title>
		<link>http://fieldp.com/myblog/2011/using-magnum-to-calculate-flux-coupling/</link>
		<comments>http://fieldp.com/myblog/2011/using-magnum-to-calculate-flux-coupling/#comments</comments>
		<pubDate>Tue, 12 Jul 2011 19:22:02 +0000</pubDate>
		<dc:creator>shumphries</dc:creator>
				<category><![CDATA[Educational]]></category>
		<category><![CDATA[Techniques]]></category>

		<guid isPermaLink="false">http://fieldp.com/myblog/?p=1081</guid>
		<description><![CDATA[<p>A customer working with RFID devices asked me about finding magnetic flux inside a detector coil surrounded by an array of drive coils. The drive coils may move around or rotate. There are no iron structures. The calculations are fast and easy using the free-space mode of Magnum. In this post, I&#8217;ll review the required techniques.</p>
<p [...]]]></description>
			<content:encoded><![CDATA[<p>A customer working with RFID devices asked me about finding magnetic flux inside a detector coil surrounded by an array of drive coils. The drive coils may move around or rotate. There are no iron structures. The calculations are fast and easy using the free-space mode of <strong>Magnum</strong>. In this post, I&#8217;ll review the required techniques.</p>
<div class="wp-caption aligncenter" style="width: 610px"><img title="Detector coil position and current elements of the drive coil" src="http://www.fieldp.com/myblog/images/magneticflux01.png" alt="Detector coil position and current elements of the drive coil" width="600" height="494" /><p class="wp-caption-text">Detector coil position and current elements of the drive coil</p></div>
<p>The first figure shows a test geometry. The detector coil has a rectangular cross section (Δ<em>x</em> = 6.0 cm, Δ<em>y</em> = 3.5 cm). For convenience, I located it in the plane <em>z</em> = 0.00 cm. I included one circular drive coil of radius 5.0 cm with center at (<em>x</em> = 5.0 cm, <em>y</em> = 5.0 cm and <em>z</em> = 5.0). To illustrate parameter variations, I rotated it 45° around the <em>x</em> axis. Here is the coil definition file created in <strong>MagWinder</strong>:</p>
<p>GLOBAL<br />
  DUnit:   1.0000E+02<br />
END<br />
COIL<br />
  Name: RotatingCoil<br />
  Current:   1.0000E+00<br />
  Ds:   2.5000E-01<br />
  Shift:   5.0000E+00  5.0000E+00  5.0000E+00<br />
  Part<br />
    Name: RotatingCoil<br />
    Type: Circle<br />
    Fab:   5.0000E+00<br />
* Change ThetaX to rotate the coil<br />
    Rotate:    45.000    0.000    0.000  XYZ<br />
  End<br />
END<br />
ENDFILE</p>
<p>The coil can be rotated by editing the part in <strong>Magwinder </strong>or simply changing the value 45.000 with a text editor. The coil definition file is processed with <strong>Magwinder </strong>to create a list of 126 short current elements to calculate the applied field at the position of the diagnostic coil.</p>
<p>In a <strong>Magnum </strong>free space solution, the computational mesh defines a set of node points to calculate the applied field. The field at other points is determined by interpolation. All elements have μr = 1.0. Usually, the mesh is a single-region box that surrounds the volume of interest. In this case, I used a special region division to enable automatic flux calculations. The figure below shows the mesh, extending over a range that encloses the detector coil (-5.0 ≤ <em>x</em> ≤ 5.0, -5.0 ≤ <em>y</em> ≤ 5.0, -1.0 ≤ <em>z</em> ≤ 1.0). The upper and lower spaces in <em>z</em> are divided into Region 1 and 2. Region 3 occupies the lower space in <em>z</em> and has the cross-section dimensions of the detector coil (Δ<em>x</em> = 6.0 cm, Δ<em>y</em> = 3.5 cm). The important point is that the surface between Region 3 and 1 corresponds to the area enclosed by the detector coil.</p>
<div class="wp-caption aligncenter" style="width: 610px"><img title="Computational mesh with special diagnostic regions" src="http://www.fieldp.com/myblog/images/magneticflux02.png" alt="Computational mesh with special diagnostic regions" width="600" height="215" /><p class="wp-caption-text">Computational mesh with special diagnostic regions</p></div>
<p>The <strong>Magnum </strong>solution takes only a few seconds. <strong>MagView </strong>is then used to analyze the solution. To calculate the flux integral, click on A<em>nalysis/Surface integral</em> to show the dialog illustrated below. We want to find the flux out of Region 3 into Region 1 (<em>i.e.</em>, a positive value corresponds to <em>Bz</em> &gt; 0.0). Therefore, we set the dialog so that Region 3 is internal and Region 1 is external. The program determines integrals over the defined surface and records the results in a data file (shown below):</p>
<div class="wp-caption aligncenter" style="width: 538px"><img title="Dialog to define surface integrals" src="http://www.fieldp.com/myblog/images/magneticflux03.png" alt="Dialog to define surface integrals" width="528" height="303" /><p class="wp-caption-text">Dialog to define surface integrals</p></div>
<p>&#8212;&#8212;&#8212;- Surface Integrals &#8212;&#8212;&#8212;-<br />
Region status<br />
RegNo   Status    Name<br />
===================================<br />
1  External   AIRUPPER<br />
3  Internal   COILOUTLINE<br />
Surface area of region set (m2):   2.100000E-03<br />
MagFlux:  -2.537678E-09</p>
<p>As a check, we confirm that the area equals 0.060 m × 0.035 m. The flux implies an average flux density &lt;<em>Bz</em>&gt; = 1.208E-6 tesla. Inspection of a plot of <em>Bz</em> in the plane <em>z</em> = 0.0 cm shows that this is a reasonable value.</p>
<div class="wp-caption aligncenter" style="width: 610px"><img title="Plot of Bz over the plane z = 0.0 cm" src="http://www.fieldp.com/myblog/images/magneticflux04.png" alt="Plot of Bz over the plane z = 0.0 cm" width="600" height="454" /><p class="wp-caption-text">Plot of Bz over the plane z = 0.0 cm</p></div>
<p>For <strong>Magnum </strong>users, here are links to the example input files:</p>
<p><a href="http://www.fieldp.com/myblog/examples/MagneticFlux.CDF">http://www.fieldp.com/myblog/examples/MagneticFlux.CDF</a><br />
<a href="http://www.fieldp.com/myblog/examples/MagneticFlux.MIN">http://www.fieldp.com/myblog/examples/MagneticFlux.MIN</a><br />
<a href="http://www.fieldp.com/myblog/examples/MagneticFlux.GIN">http://www.fieldp.com/myblog/examples/MagneticFlux.GIN</a></p>
]]></content:encoded>
			<wfw:commentRss>http://fieldp.com/myblog/2011/using-magnum-to-calculate-flux-coupling/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to use saved views</title>
		<link>http://fieldp.com/myblog/2011/how-to-use-saved-views/</link>
		<comments>http://fieldp.com/myblog/2011/how-to-use-saved-views/#comments</comments>
		<pubDate>Thu, 09 Jun 2011 20:42:43 +0000</pubDate>
		<dc:creator>shumphries</dc:creator>
				<category><![CDATA[NewFeatures]]></category>
		<category><![CDATA[Techniques]]></category>

		<guid isPermaLink="false">http://fieldp.com/myblog/?p=1069</guid>
		<description><![CDATA[<p>We recently added the capability to save and to load plot views (discussed in a previous post) to our two-dimensional TriComp field programs (EStat, PerMag, EMP, Nelson, TDiff, Pulse, RFE2 and WaveSim). In the interactive environment, the Save view command generates a formatted text file FPrefix.FPV where FPrefix is a descriptive name assigned by the user. [...]]]></description>
			<content:encoded><![CDATA[<p>We recently added the capability to save and to load plot views (discussed in a <a href="http://fieldp.com/myblog/2010/saved-views-in-metamesh-and-the-amaze-postprocessors/" target="_blank">previous post</a>) to our two-dimensional <strong>TriComp </strong>field programs (<strong>EStat</strong>, <strong>PerMag</strong>, <strong>EMP</strong>, <strong>Nelson</strong>, <strong>TDiff</strong>, <strong>Pulse</strong>, <strong>RFE2 </strong>and <strong>WaveSim</strong>). In the interactive environment, the <em>Save view</em> command generates a formatted text file <em>FPrefix.FPV</em> where <em>FPrefix </em>is a descriptive name assigned by the user. The file contains the complete set of plotting parameters. This excerpt illustrates the format:</p>
<pre>Program: TriComp
PlotStyle: Spatial
Outline: ON
Grid: ON
Scientific: OFF
FixedPoint: OFF
Vectors: OFF
XGMin:  3.500000E+00
XGMax:  9.000001E+00
...</pre>
<p>The file contains all necessary parameters to reconstruct spatial plots (in the <em>z-r</em> or <em>x-y</em> planes). The file includes the following information for spatial plots:</p>
<ul>
<li>Style information, like whether to display a reference grid, element outlines or field vectors.</li>
<li>Boundaries of zoomed views</li>
<li>The plot type (e.g., mesh, filled contour, contour lines,&#8230;)</li>
<li>The plotted quantity.</li>
</ul>
<p>You can also save information to reconstruct scan plots:</p>
<ul>
<li>Style information (number of scan points, symbol display,&#8230;)</li>
<li>Coordinates of the scan start and end Limits of the scan.</li>
<li> Plotted quantity.</li>
</ul>
<div class="wp-caption aligncenter" style="width: 640px"><img title="Spatial versus scan plots in TriComp programs" src="http://www.fieldp.com/myblog/images/saved_view.png" alt="Spatial versus scan plots in TriComp programs" width="630" height="309" /><p class="wp-caption-text">Spatial versus scan plots in TriComp programs</p></div>
<p>The simplest application of saved views is to restore a complex plot when you reload the solution at a later time. We have included several features in our implementation to enable a higher level of data analysis:</p>
<ul>
<li>A saved view works even if a completely different solution than one use to create the view in loaded. In fact, views can be reloaded even if the user is running a different <strong>TriComp </strong>program. The current program analyzes the parameters and uses only ones that are relevant. For example, if a view-boundary or scan point is outside the current solution volume, the point is moved to the boundary. If a plot quantity is undefined, the first valid quantity  is used.</li>
<li>A free-form parser is employed when a view is loaded. Therefore, a file need not contain a complete set of parameters. Changes are made only to the quantities listed in the file.</li>
<li>Users can modify entries in the view file, either directly with an editor or via a Perl or Python script. You can include comments, change parameter values or remove parameter lines.</li>
</ul>
<p>Another important feature is related to the fact that analysis functions of all <strong>TriComp </strong>postprocessors may be controlled by a text script. We have added the following  script command:</p>
<pre>PLOT FSaveView FOutput Nx Ny
PLOT (DiodeRegion VIEW001 800 600)</pre>
<p>The string <em>FSaveView </em>is the prefix of a saved view file. The string <em>FOutput </em>is the prefix of a plot file in BMP format. The integer parameters give the image resolution in pixels. In response to the command, the program loads the saved view file, applies the parameters to create a plot for the currently-loaded solution and saves it as a graphics file.</p>
<p>Here are some possible scenarios:</p>
<ul>
<li>You have a set of electric field solutions with different applied voltage and possibly different boundaries and you want to check electric field levels in a critical region (<em>e.g.</em>, an electron source). Use the <em>Zoom</em> command to create the desired plot and save a view file. Remove all information lines except the view boundaries and load the view when you load a different solution.</li>
<li>You have a set of magnetic field solutions and want precision plots of field lines passing through specific points. Add a field line interactively in <strong>PerMag </strong>and save a template view file. Then edit the view file to remove unnecessary information, change the number of field lines and add coordinates for the desired points.</li>
<li>You want to create a large set of radial temperature scans moving along the axis of a probe assembly. In <strong>TDiff</strong>, create a template view file for one scan. Write a Python or Perl script with a loop of axial positions that modifies the axial scan coordinates in the view file and then runs <strong>TDiff </strong>in the analysis mode. The set of BMP files could then be stitched into an AVI movie with our <strong>Cecil_B</strong> utility.</li>
<li>A sequence of annotated view files could be employed in a training session or educational demonstration.</li>
<li>You want to show how the levels of magnetic flux induction change with changing coil currents, preserving magnitude scaling in the plots. After creating a set of solutions, load one of them adjust the view, plot style and plot quantity. Turn off autoscaling, specify values for <em>BMin </em>and <em>BMax </em>and then save a view file. Load the view for the other solutions.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://fieldp.com/myblog/2011/how-to-use-saved-views/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Modeling laminated cores in Magnum and PerMag</title>
		<link>http://fieldp.com/myblog/2011/modeling-laminated-cores-in-magnum-and-permag/</link>
		<comments>http://fieldp.com/myblog/2011/modeling-laminated-cores-in-magnum-and-permag/#comments</comments>
		<pubDate>Mon, 25 Apr 2011 15:25:53 +0000</pubDate>
		<dc:creator>shumphries</dc:creator>
				<category><![CDATA[Educational]]></category>
		<category><![CDATA[Techniques]]></category>

		<guid isPermaLink="false">http://fieldp.com/myblog/?p=1055</guid>
		<description><![CDATA[<p>Although Magnum and PerMag are magnetostatic codes, they can often be used to find AC magnetic field distributions (e.g., transformers and motors). A static field calculation provides a good approximation when the electromagnetic wavelength is much larger than the system scale length. The issue is complicated by the presence of iron and steel, because the speed [...]]]></description>
			<content:encoded><![CDATA[<p>Although <strong>Magnum </strong>and <strong>PerMag </strong>are magnetostatic codes, they can often be used to find AC magnetic field distributions (<em>e.g.</em>, transformers and motors). A static field calculation provides a good approximation when the electromagnetic wavelength is much larger than the system scale length. The issue is complicated by the presence of iron and steel, because the speed of light is reduced by a factor 1/Δr, where Δr is the relative magnetic permeability. The quantity is defined as the ratio of the total magnetic flux density inside the iron compared to the applied value:</p>
<p>Δr = <em>B</em>/<em>B0</em>.    [1]</p>
<p>The permeability characterizes the contribution of material currents to the total magnetic field.</p>
<p>An AC magnetic field at frequency <em>f0</em> (Hz) can penetrate a block of iron or steel to a distance given by the skin depth:</p>
<p>δ= √[ρ/(π*μr*Δr*<em>f0</em>)].    [2]</p>
<p>where ρ is the volume resistivity in Ω-m. The steels used in transformers have high μr (several thousand) and low resistivity. For example, nickel steel has μr = 8000 and ? = 45 × 10[-7] Ω-m. At <em>f0</em> = 1.0 KHz, the skin depth is only δ = 0.12 mm (4.7 mil). Therefore, steel structures used for AC magnets are <em>laminated</em>, fabricated from thin sheets separated by insulators. The orientation of the laminations follows the direction of the magnetic field in the magnetic circuit, as in the figure below. If the lamination thickness is smaller than δ, the field penetrates each lamination so that the magnetic properties are almost the same as for static fields.</p>
<div class="wp-caption aligncenter" style="width: 610px"><img title="Laminated core" src="http://www.fieldp.com/myblog/images/fill_factor.png" alt="Laminated core" width="600" height="167" /><p class="wp-caption-text">Laminated core</p></div>
<p>In a practical finite-element calculation of a macroscopic device, we approximate cores with many thin lamina as a homogeneous object. In principle, a laminated core has an anisotropic permeability, with μr » 1 along the lamina and μr ~ 1 perpendicular to them. In practice, the field lines and lamina are generally in the same direction in the yokes and poles of magnetic circuits. In consequence, we can neglect the normal field component and use a single value of μr for the component parallel to the lamina.</p>
<p>The relative magnetic permeability of the insulating layers of a laminated core is μr ≈ 1.0. The fill fraction <em>f</em> is defined as the fraction of the core cross-section occupied by steel. In magnet calculations, we must account for the missing core material. To begin, suppose the system operates with magnetic flux density <em>B</em> in the lamina well below the saturation value. In this case, we can use a fixed value of μr throughout the core material. The effective magnetic permeability of the laminated core is defined as average magnetic flux density inside the core compared to the applied value.</p>
<p>&lt;μr&gt; = &lt;<em>B</em>&gt;/<em>B0</em> = [μr*<em>B0</em>*<em>f</em> + <em>B0</em>*(1-<em>f</em>)]/<em>B0</em> = μr*<em>f</em> + (1-<em>f</em>).     [3]</p>
<p>The second term on right-hand side is usually small compared to first. To include the effect of the fill fraction, we use a reduced value of relative permeability for the core. For example, if μr = 2000 and <em>f</em> = 0.80, then &lt;μr&gt; = 1600.</p>
<p>Next, consider a core represented by a magnetization curve. The curve has the form μr(<em>B0</em>) in <strong>Magnum </strong>and μr(&lt;<em>B</em>&gt;) in <strong>PerMag</strong>. For <strong>Magnum </strong>calculations, the code determines a local value of μr for a known value of <em>B0</em>. To represent a laminated core, we prepare a table where no changes are made to the independent values (<em>B0</em>) and μr values are adjusted according to Eq. [3]. For a <strong>PerMag </strong>calculation, must make two changes to the table. First, if the calculation were expressed as μr(<em>B</em>) (where <em>B</em> is the magnetic flux density <em>inside </em>the lamination), the dependent values of μr would be reduced according to Eq. [3]. On the other hand, the code uses the value of &lt;<em>B</em>&gt; for the interpolation, where</p>
<p>&lt;<em>B</em>&gt; = <em>B</em>*<em>f</em> + (<em>B</em>/μr)*(1-<em>f</em>)  μr<em>B</em>*<em>f. </em>[4]<em><br />
</em></p>
<p>Therefore, we should multiply values along the abscissa by <em>f</em>. Forexample, if a material saturates at a field of 2.0 tesla inside the lamination, saturation would occur at an average magnetic flux density &lt;<em>B</em>&gt; = 1.5 tesla for f = 0.75.</p>
<p>In summary, here is how to modify magnetization tables when there is a fill fraction <em>f</em>:</p>
<ul>
<li>For <strong>Magnum </strong>tables of μr(<em>B0</em>), multiply μr values by <em>f</em>.</li>
<li>For <strong>PerMag </strong>tables of μr(<em>B</em>), multiply both μr and <em>B</em> values by <em>f</em>.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://fieldp.com/myblog/2011/modeling-laminated-cores-in-magnum-and-permag/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

