<?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; Educational</title>
	<atom:link href="http://fieldp.com/myblog/category/educational/feed/" rel="self" type="application/rss+xml" />
	<link>http://fieldp.com/myblog</link>
	<description>Effective finite-element modeling of electromagnetic fields</description>
	<lastBuildDate>Thu, 17 May 2012 12:45:46 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Coil force integrals in Magnum</title>
		<link>http://fieldp.com/myblog/2012/coil-force-integrals-in-magnum/</link>
		<comments>http://fieldp.com/myblog/2012/coil-force-integrals-in-magnum/#comments</comments>
		<pubDate>Tue, 24 Apr 2012 20:39:18 +0000</pubDate>
		<dc:creator>shumphries</dc:creator>
				<category><![CDATA[Educational]]></category>
		<category><![CDATA[NewFeatures]]></category>

		<guid isPermaLink="false">http://fieldp.com/myblog/?p=1312</guid>
		<description><![CDATA[<p>The magnetic force on a vector current element dl carrying current I in a magnetic field with flux density B is</p>
<p>dF = I dl × B    (1)</p>
<p>In Magnum applied currents are represented by a collection of filamentary elements, so you might think that it would be straightforward to implement automatic routines to find forces on drive coils. [...]]]></description>
			<content:encoded><![CDATA[<p>The magnetic force on a vector current element <strong>dl</strong> carrying current <em>I</em> in a magnetic field with flux density <strong>B</strong> is</p>
<p><strong>dF</strong> = <em>I</em> <strong>dl</strong> × <strong>B</strong>    (1)</p>
<p>In <strong>Magnum</strong> applied currents are represented by a collection of filamentary elements, so you might think that it would be straightforward to implement automatic routines to find forces on drive coils. The problem is one of accuracy when the drive coils are the primary source of the field. The field varies rapidly around the filamentary elements so a simple integral using Eq. 1 may give misleading values.</p>
<p>On the other hand, there are situations where such an integral would be very useful. I recently had a consulting project where a strong permanent-magnet assembly exerts a force on a current loop. The loop carries less than an ampere and makes only a small contribution to the field. Accordingly, I recently added a routine for automatic coil-force integrals to <strong>MagView</strong>. The new command <em>Coil force</em> is in the <em>File operations</em> menu. Here&#8217;s how it works:</p>
<div class="wp-caption aligncenter" style="width: 510px"><img title="Magnet assembly with diagnostic coil paths" src="http://www.fieldp.com/myblog/images/coil_force.png" alt="Magnet assembly with diagnostic coil paths" width="500" height="424" /><p class="wp-caption-text">Figure 1. Magnet assembly with diagnostic coil paths</p></div>
<p>1) Suppose you have a solution for a permanent-magnet assembly or an electromagnet and want to find the force on a coil inserted in the magnet volume. Load the solution into <strong>MagView</strong> with the <em>File operations/Load solution file</em> command.</p>
<p>2) Use <strong>Magwinder</strong> to define the sensor coil. It may be a simple rectangle (as in Fig. 1) or multi-turn shape of any complexity like a <a title="Create a coil box with Magwinder" href="http://fieldp.com/myblog/2012/creating-a-coil-box-with-magwinder/" target="_blank">coil box</a>. Assign a coil current of 1.0 A.</p>
<p>3) If you want to check the force at multiple positions, define multiple <em>Coils</em> in the <em>CDF</em> file with different values for the <em>Shift</em> and <em>Rotate</em> operations, as in Fig. 1.</p>
<p>4) Export an element file (<em>WND</em>).</p>
<p>5) Load the element file into <strong>MagView</strong> with the <em>File operations/Load coils command</em>.</p>
<p>6) Click on the <em>Coil force</em> command (note that the command functions only when both a solution and coil file have been loaded). The command shows a dialog with force components for each coil in the <em>WND</em> file and also write values to a data file if one is open. Here is an example listing:</p>
<pre>--- Coil forces  ---
 NCoil         Fx          Fy         Fz
 ===========================================
 1   9.4794E-03   1.2813E-09  -3.9264E-06
 2   8.9958E-03  -2.5137E-04   9.6336E-07
 3   8.9808E-03   3.3423E-04  -2.9572E-06</pre>
<p>If the diagnostic coils carry 1.0 A, the units of force are newtons/A.</p>
]]></content:encoded>
			<wfw:commentRss>http://fieldp.com/myblog/2012/coil-force-integrals-in-magnum/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Universal curves for high-frequency wire losses</title>
		<link>http://fieldp.com/myblog/2012/universal-curves-for-high-frequency-wire-losses/</link>
		<comments>http://fieldp.com/myblog/2012/universal-curves-for-high-frequency-wire-losses/#comments</comments>
		<pubDate>Sat, 31 Mar 2012 19:41:26 +0000</pubDate>
		<dc:creator>shumphries</dc:creator>
				<category><![CDATA[Educational]]></category>
		<category><![CDATA[Techniques]]></category>

		<guid isPermaLink="false">http://fieldp.com/myblog/?p=1293</guid>
		<description><![CDATA[<p>My original intent was to write an article to show when it is necessary to use an eddy-current code to find time-varying magnetic fields and when a static field code like Magnum is sufficient. As a preliminary, I thought it would be useful to review how eddy currents affect magnetic fields in single wires. This tutorial [...]]]></description>
			<content:encoded><![CDATA[<p>My original intent was to write an article to show when it is necessary to use an eddy-current code to find time-varying magnetic fields and when a static field code like <strong>Magnum </strong>is sufficient. As a preliminary, I thought it would be useful to review how eddy currents affect magnetic fields in single wires. This tutorial has two purposes:</p>
<ul>
<li>Document useful general results on the effective resistance and ohmic losses in wires at high frequency.</li>
<li>Show how to set up calculations of magnetic field distributions in wires with the two-dimensional code Nelson.</li>
</ul>
<p>To start, let&#8217;s review some basic equations for a long wire with cross-section area <em>Aw</em> (m2) and conductivity σ (S/m). At low frequency, the current density is uniformly distributed across the wire and the resistance per length given by Eq. 1. If the wire carries an alternating current <em>I0</em> cos(2π<em>f t</em>) at frequency <em>f</em>, Eq. 2 gives the time-averaged power dissipation.At high values of <em>f</em>, the magnetic field associated with the current flow is inhibited from penetrating the metal wire, concentrating the current density near the wire surface. The effective effective cross-section area of the wire is therefore smaller than <em>Aw</em>, increasing the resistance per length and the ohmic power loss for a given current. The penetration distance for magnetic fields, called the <em>skin depth</em>, is given Eq. 3. The quantity μ is the magnetic permeability, given by μ = (1.257E-6) μr, where μr is the relative magnetic permeability. The relative permeability equals 1.0 for most wire metals.</p>
<p><img class="aligncenter" title="Wireloss equations" src="http://www.fieldp.com/myblog/images/wireloss_equations.png" alt="Wireloss equations" width="509" height="281" /></p>
<p>The skin depth allows us to define the high and low-frequency regimes. For a circular wire of radius <em>rw</em>, Eq. 4 gives the condition for enhanced ohmic losses. In the following calculation, we&#8217;ll use the example of a circular copper wire 1.0 mm in radius. The conductivity of copper is σ = 5.814E7 S/m. Using Eq. 3, the frequency corresponding to δ = 0.5 mm is 17.4 kHz. For a wire area <em>Aw</em> = 3.142E-6 m2, Eq. 1 gives the steady-state resistance <em>R</em> = 5.474E-3 Ω/m. For a drive current amplitude <em>I0</em> = 1.0 A, the low-frequency power loss is P = 2.738E-3 W/m.</p>
<p>The program <strong>Nelson </strong>finds field magnetic distributions in the frequency domain — all quantities (including drive currents) vary harmonically at the same frequency. The input files to define the mesh and to control the calculation are <a href="http://www.fieldp.com/myblog/examples/circular.min" target="_self">circular.min</a> and<a href="http://www.fieldp.com/myblog/examples/circular.nin" target="_self"> circular.nin</a>. Figure 1 shows the mesh with dimensions in millimeters. The wire extends an infinite distance out of the page. The large air region was included so that the calculation could easily be modified for non-circular wires &#8212; the distant boundary has little effect on the magnetic fields inside a wire.</p>
<div class="wp-caption aligncenter" style="width: 610px"><img title="Nelson mesh" src="http://www.fieldp.com/myblog/images/wireloss_mesh.png" alt="Nelson mesh" width="600" height="582" /><p class="wp-caption-text">Figure 1. Mesh for the Nelson circular wire calculation.</p></div>
<p>In the <strong>Nelson </strong>control script circular.nin, the boundary is a surface of fixed vector potential (flux conserving boundary) and the air region has μr = 1.0 and σ = 0.0 S/m. The copper wire has μr = 1.0, σ = 5.814E7 S/m and a drive current <em>I0</em> = 1.0 A at a phase of 0.0°. The calculation of eddy currents in the wire uses the multistage, self-consistent method described in Chap. 4 of the <strong>Nelson </strong>manual. Figure 2 shows lines of <strong>B</strong>. At low frequency, |<strong>B</strong>| inside the wire increases linearly with distance from the axis, consistent with uniform current density. At high frequency, the magnetic flux density is concentrated on the surface.</p>
<div class="wp-caption aligncenter" style="width: 510px"><img class=" " title="Magnetic field lines" src="http://www.fieldp.com/myblog/images/wireloss_bline.png" alt="Magnetic field lines" width="500" height="930" /><p class="wp-caption-text">Figure 2. Lines of magnetic flux density in and around a circular copper wire at low and high frequency.</p></div>
<p>To make a quantitative comparison, we can use the automatic volume integral in the <strong>Nelson </strong><em>Analysis </em>menu to find the total power dissipation per length along <em>z</em>. Results of calculations at several frequencies are plotted in Fig. 3. The theoretical steady-state value is shown as a dashed line. As expected, power losses increase significantly in the range 10-20 kHz. At high frequency, the current is confined to a thin layer on the wire surface. In this case. the power loss increases approximately as √<em>f</em>, proportional to 1/δ.</p>
<div class="wp-caption aligncenter" style="width: 610px"><img title="Power loss" src="http://www.fieldp.com/myblog/images/wireloss_power.png" alt="Power loss" width="600" height="455" /><p class="wp-caption-text">Figure 3. Power dissipation per meter in a copper wire of radius 1.0 mm as a function of frequency with a drive current amplitude of 1.0 A.</p></div>
<p>It is important to recognize that the numerical results for the 1.0 mm copper wire may be applied to circular wires of any diameter or composition. It is not necessary to repeat the calculation for each special case. The strategy is to recognize scaling laws and to incorporate them into a universal curve. As an example, the green line of Fig. 4 plots the power level relative to the steady-state value as a function of the ratio of the wire dimension to the skin depth. There are two advantages to applying scaling laws:</p>
<ul>
<li>Generality – the graphed data may used to determine the effective resistance of any circular wire.</li>
<li>Identification of trends – it&#8217;s evident that the power loss is proportional to 1/δ at high frequency.</li>
</ul>
<div class="wp-caption aligncenter" style="width: 610px"><img title="Universal curve" src="http://www.fieldp.com/myblog/images/wireloss_universal.png" alt="Universal curve" width="600" height="458" /><p class="wp-caption-text">Figure 4. Universal curve for high-frequency wire resistance, power relative to the steady-state value plotted as a function of the wire dimension normalized by the skin depth. Circular and square wire cross sections.</p></div>
<p>As an example, suppose we have a 1/8&#8243;&#8216; diameter stainless steel rod and we want to find the frequency limit such that the power loss is no more than 50% of the low-frequency value. An inspection of Fig. 4 shows that δ must be greater than <em>rw</em>/2.5. With σ = 1.240E6 S/m and <em>rw</em> = 1.59 mm, the frequency corresponding to δ = 0.636 mm is <em>f</em> = 503.7 kHz. To check the result, I set up another <strong>Nelson </strong>calculation with modified wire radius and conductivity. For <em>I0</em> = 1.0 A, the predicted steady-state power dissipation is 50.77 mW/m. The Nelson calculation gives 50.77 mW/m at f = 1.0 Hz and 76.28 mW/m at 503.7 kHz. The ratio of the two power levels is 1.50.</p>
<p>The results for circular wires could have been derived analytically with some effort. The true advantage of a numerical approach is that complex shapes are no more difficult to handle than simple shapes. To illustrate, I set up a run for square copper wires by changing the shape of the wire region in the <strong>Mesh </strong>input file. I used a wire with side lengths <em>D</em> = 2.0 mm. Figure 5 shows lines of <strong>B</strong> at high frequency. The universal power dissipation curve for square wires is plotted as the blue line in Fig. 4.</p>
<p style="text-align: center;">
<div class="wp-caption aligncenter" style="width: 610px"><img class=" " title="Square wire" src="http://www.fieldp.com/myblog/images/wireloss_square.png" alt="Square wire" width="600" height="565" /><p class="wp-caption-text">Figure 5. Lines of magnetic flux density in and around a square copper wire at 40 kHz.</p></div>
]]></content:encoded>
			<wfw:commentRss>http://fieldp.com/myblog/2012/universal-curves-for-high-frequency-wire-losses/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Creating a coil box with MagWinder</title>
		<link>http://fieldp.com/myblog/2012/creating-a-coil-box-with-magwinder/</link>
		<comments>http://fieldp.com/myblog/2012/creating-a-coil-box-with-magwinder/#comments</comments>
		<pubDate>Sat, 25 Feb 2012 17:09:56 +0000</pubDate>
		<dc:creator>shumphries</dc:creator>
				<category><![CDATA[Educational]]></category>
		<category><![CDATA[Techniques]]></category>

		<guid isPermaLink="false">http://fieldp.com/myblog/?p=1252</guid>
		<description><![CDATA[<p>Many designs for electromagnets include a coil of the shape shown in Figure 1 wrapped around an iron mandrel with a rectangular cross section. The utility program Magwinder is used to define drive current elements for three dimension magnetic field calculations with the Field Precision Magnum program. In Magwinder, a coil box like Fig. 1 is [...]]]></description>
			<content:encoded><![CDATA[<p>Many designs for electromagnets include a coil of the shape shown in Figure 1 wrapped around an iron mandrel with a rectangular cross section. The utility program <strong>Magwinder </strong>is used to define drive current elements for three dimension magnetic field calculations with the Field Precision <strong>Magnum </strong>program. In <strong>Magwinder</strong>, a coil box like Fig. 1 is constructed of four <em>BAR </em>type parts connected by four <em>ELBOWR </em>(elbow with a rectangular cross section) parts. The boxes must be rotated and translated from the their standard configurations to generate current in the correct position and direction, and the elbows must be shifted to the connecting positions. This involves some concentration and much busy work. Furthermore, the chances of error increase when there are multiple operations. In this article, I&#8217;ll describe resources that I created to automate the process and review the plotting capabilities in <strong>Magwinder </strong>to check the results.</p>
<div class="wp-caption aligncenter" style="width: 610px"><img class=" " title="Definition of coil box parameters" src="http://www.fieldp.com/myblog/images/CoilBox01.png" alt="Definition of coil box parameters" width="600" height="400" /><p class="wp-caption-text">Figure 1. Definition of coil box parameters</p></div>
<p>Figure 1 defines the geometric parameters of the coil box:</p>
<ul>
<li>The coil cross section has width <em>W1</em> in the <em>x-y</em> plane and <em>W2</em> in <em>z</em>.</li>
<li>The coil is approximated by <em>N1</em> current filaments in the <em>x-y</em> plane and <em>N2</em> filaments in <em>z</em>.</li>
<li>The <em>BAR </em>models have length <em>D1</em> in <em>x</em> and <em>D2</em> in <em>y</em>.</li>
<li>The <em>ELBOWR </em>models have inner radius <em>R1</em> and outer radius <em>R2</em> and extend 90°.</li>
<li><em>I</em> is the total current carried by the filaments.</li>
</ul>
<p>In the standard position, the current flows in the <em>x-y</em> plane in the direction of positive θ (counterclockwise) when view from the <em>+z</em> direction. You can download the <strong>Magwinder </strong>sample input file <a href="http://www.fieldp.com/myblog/examples/coilbox_example.cdf" target="_self">coilbox_example.cdf</a> which creates the structure for a specific set of parameters. The equations for the model parameters are listed as comment lines.</p>
<div class="wp-caption aligncenter" style="width: 599px"><img class=" " title="Spreadsheet for automatic calculation of coil box parameters" src="http://www.fieldp.com/myblog/images/CoilBox02.png" alt="Spreadsheet for automatic calculation of coil box parameters" width="589" height="779" /><p class="wp-caption-text">Figure 2. Spreadsheet for automatic calculation of coil box parameters</p></div>
<p>I have also set up the spreadsheet shown in Fig. 2. To use it, fill in the parameter values and then copy and paste the cells starting at <em>GLOBAL </em>as text into a <strong>MagWinder </strong>script (<em>CDF</em>). Here is a link for a file for the OpenOffice spreadhsheet <a href="http://www.fieldp.com/myblog/examples/coil_box.ods">(coil_box.ods</a>). If you enjoy purchasing office software, here is a link to an Excel file (<a href="http://www.fieldp.com/myblog/examples/coil_box.xls">coil_box.xls</a>).</p>
<div class="wp-caption aligncenter" style="width: 451px"><img class=" " title="Resulting current elements with polarity indicators projected to the x-y plane" src="http://www.fieldp.com/myblog/images/CoilBox03.png" alt="Resulting current elements with polarity indicators projected to the x-y plane" width="441" height="600" /><p class="wp-caption-text">Figure 3. Resulting current elements with polarity indicators projected to the x-y plane (N1 = 3)</p></div>
<p>Figure 3 shows the resulting assembly projected in the <em>x-y</em> plane. The plot illustrates the new <strong>Magwinder </strong>capability to display the polarity of current elements. They are represented as sperm cells swimming in the direction of the head. There are two ways to reverse the current direction.</p>
<ul>
<li>Use a negative coil current, <em>I</em> → <em>-I</em>.</li>
<li> Rotate the <em>COIL </em>90° about the <em>x</em> or <em>y</em> axis.</li>
</ul>
<div class="wp-caption aligncenter" style="width: 610px"><img title="Quadrupole assembly with four coil boxes" src="http://www.fieldp.com/myblog/images/CoilBox04.jpg" alt="Quadrupole assembly with four coil boxes" width="600" height="518" /><p class="wp-caption-text">Figure 4. Quadrupole assembly with four coil boxes</p></div>
<p>You can use the basic assembly multiple times in a <strong>Magwinder </strong>script. For example, Fig. 4 shows a quadrupole magnet. The standard text from the spreadsheet was pasted into four <em>COIL </em>sections, and then each coil was assigned a specific rotation and translation.</p>
]]></content:encoded>
			<wfw:commentRss>http://fieldp.com/myblog/2012/creating-a-coil-box-with-magwinder/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<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>Website introduction video</title>
		<link>http://fieldp.com/myblog/2011/website-introduction-video/</link>
		<comments>http://fieldp.com/myblog/2011/website-introduction-video/#comments</comments>
		<pubDate>Thu, 13 Oct 2011 15:32:03 +0000</pubDate>
		<dc:creator>shumphries</dc:creator>
				<category><![CDATA[Educational]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[NewFeatures]]></category>

		<guid isPermaLink="false">http://fieldp.com/myblog/?p=1196</guid>
		<description><![CDATA[<p>We&#8217;ve added a lot of content to our website at www.fieldp.com in 13 years. In fact, there&#8217;s so much material that the site might intimidating to first-time visitors looking for software or educational resources. To help, we&#8217;ve added a short overview video on the home page. Here it [...]]]></description>
			<content:encoded><![CDATA[<p>We&#8217;ve added a lot of content to our website at www.fieldp.com in 13 years. In fact, there&#8217;s so much material that the site might intimidating to first-time visitors looking for software or educational resources. To help, we&#8217;ve added a short overview video on the home page. Here it is:</p>
<p><!-- copy and paste. Modify height and width if desired. --> <object id="scPlayer" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="640" height="498" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="data" value="http://content.screencast.com/users/Field_Precision_LLC/folders/Default/media/e265c5e2-5bdb-4ec0-ba3c-76c49d23c2be/company_profile_choosing_controller.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#FFFFFF" /><param name="flashVars" value="containerwidth=640&amp;containerheight=498&amp;showstartscreen=true&amp;showendscreen=true&amp;loop=false&amp;autostart=false&amp;color=000000,000000&amp;thumbscale=45&amp;content=http://content.screencast.com/users/Field_Precision_LLC/folders/Default/media/e265c5e2-5bdb-4ec0-ba3c-76c49d23c2be/Company_Profile_Choosing.mp4&amp;blurover=false" /><param name="allowFullScreen" value="true" /><param name="scale" value="showall" /><param name="allowScriptAccess" value="always" /><param name="base" value="http://content.screencast.com/users/Field_Precision_LLC/folders/Default/media/e265c5e2-5bdb-4ec0-ba3c-76c49d23c2be/" /><param name="src" value="http://content.screencast.com/users/Field_Precision_LLC/folders/Default/media/e265c5e2-5bdb-4ec0-ba3c-76c49d23c2be/company_profile_choosing_controller.swf" /><embed id="scPlayer" type="application/x-shockwave-flash" width="640" height="498" src="http://content.screencast.com/users/Field_Precision_LLC/folders/Default/media/e265c5e2-5bdb-4ec0-ba3c-76c49d23c2be/company_profile_choosing_controller.swf" base="http://content.screencast.com/users/Field_Precision_LLC/folders/Default/media/e265c5e2-5bdb-4ec0-ba3c-76c49d23c2be/" allowscriptaccess="always" scale="showall" allowfullscreen="true" flashvars="containerwidth=640&amp;containerheight=498&amp;showstartscreen=true&amp;showendscreen=true&amp;loop=false&amp;autostart=false&amp;color=000000,000000&amp;thumbscale=45&amp;content=http://content.screencast.com/users/Field_Precision_LLC/folders/Default/media/e265c5e2-5bdb-4ec0-ba3c-76c49d23c2be/Company_Profile_Choosing.mp4&amp;blurover=false" bgcolor="#FFFFFF" quality="high" data="http://content.screencast.com/users/Field_Precision_LLC/folders/Default/media/e265c5e2-5bdb-4ec0-ba3c-76c49d23c2be/company_profile_choosing_controller.swf"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://fieldp.com/myblog/2011/website-introduction-video/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
<enclosure url="http://content.screencast.com/users/Field_Precision_LLC/folders/Default/media/e265c5e2-5bdb-4ec0-ba3c-76c49d23c2be/Company_Profile_Choosing.mp4&amp;amp" length="14288650" type="video/mp4" />
		</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>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>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>
	</channel>
</rss>

