<?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, 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>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>Sharing dimensions of Mesh setups</title>
		<link>http://fieldp.com/myblog/2012/sharing-dimensions-of-mesh-setups/</link>
		<comments>http://fieldp.com/myblog/2012/sharing-dimensions-of-mesh-setups/#comments</comments>
		<pubDate>Fri, 30 Mar 2012 16:38:31 +0000</pubDate>
		<dc:creator>shumphries</dc:creator>
				<category><![CDATA[Techniques]]></category>

		<guid isPermaLink="false">http://fieldp.com/myblog/?p=1282</guid>
		<description><![CDATA[<p>My consulting projects involve beam optics studies for a variety of devices: electron guns, transport solenoids, beam collectors,&#8230;.. Typically, I develop optimal shapes for cathodes and internal electrodes and then send the information to the customer&#8217;s engineers who worry about external matters (power supplies, vacuum seals, high-voltage insulation, cooling,&#8230;). This process involves communicating dimensions.</p>
<p>In principle, all [...]]]></description>
			<content:encoded><![CDATA[<p>My consulting projects involve beam optics studies for a variety of devices: electron guns, transport solenoids, beam collectors,&#8230;.. Typically, I develop optimal shapes for cathodes and internal electrodes and then send the information to the customer&#8217;s engineers who worry about external matters (power supplies, vacuum seals, high-voltage insulation, cooling,&#8230;). This process involves communicating dimensions.</p>
<p>In principle, all dimensions for calculations with <strong>EStat</strong>, <strong>PerMag </strong>and <strong>Trak </strong>are contained in the <strong>Mesh </strong>input script (<em>MIN</em>). On the other hand, it&#8217;s an imposition to expect the engineers to figure out the format. You could create a mechanical drawing, but there&#8217;s a quicker way to send full dimensional information: the <em>DXF</em> export function in the <strong>Mesh </strong><em>Drawing Editor</em>. It&#8217;s documented in the <strong>Mesh </strong>manual, but people (including myself) tend to forget about it.</p>
<p>To create a <em>DXF </em>file, first load your <em>MIN </em>file into <strong>Mesh</strong>. Next, choose the <em>Edit script (graphics) </em>command to open the <em>Drawing Editor</em>. Then use the <em>Export DXF</em> command. It produces a standard <em>DXF </em>file that can be opened with the engineer&#8217;s favorite CAD program (<strong>AutoCAD</strong>, <strong>DraftSight</strong>,&#8230;). In a familiar environment, it&#8217;s easy to find dimensions.</p>
<p>The vectors for mesh regions are organized in layers with the names &#8220;0&#8243;, &#8220;1&#8243;, &#8220;2&#8243;,&#8230;. The &#8220;0&#8243; layer is for reference lines. You can omit writing information from the region (or any other region) to the <em>DXF </em>file. Before exporting the file, click on <em>Settings/Region properties</em> and turn off the visibility of the regions to be excluded.</p>
]]></content:encoded>
			<wfw:commentRss>http://fieldp.com/myblog/2012/sharing-dimensions-of-mesh-setups/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>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>
	</channel>
</rss>

