Changes

/* Verifying Your Simulation Results */
*Mesh Generation
*Field Sensor Observable
*Electric Field
*Electric Scalar Potential
*Field Visualization
*Data Manager
*EM.Grid
|All versions|{{download|http://www.emagtech.com|EM.Ferma Lesson 1|[[EM.Cube]] 14.9}} }}
<tr>
<td>
[[Image:STATTUT1_3A.png|thumb|490px400px|Sphere's property dialog.]]
</td>
<td>
[[Image:STATTUT1_3.png|thumb|330px320px|The drawn Sphere object and the default domain box enclosing it.]]
</td>
</tr>
{{Note|If you have a mouse with a scroll wheel, you can use the scroll wheel to zoom in or zoom out while you draw the line. You can also rotate the view using the right mouse button, or pan the view using the right mouse button while holding the keyboard’s Shift Key down.}}
Once your drawing is complete, you can zoom to fit your structure into the screen using the keyboard shortcut {{key|Ctrl+E}} or by clicking the Zoom Extents [[Image:fdtd_zoomextents.png]] button of View Toolbar. After you have rotated or panned the view, you can always restore [[EM.Ferma]]’s standard perspective view using the keyboard’s{{key|Home}} key or by clicking the <b>Perspective View</b> [[Image:fdtd_perspective.png]] button of View Toolbar.
==Grid Settings & Mesh Generation==
[[EM.CubeFerma]]’s Static Module solves Poisson's equation using the Finite Difference (FD) method. In this numerical method, the computational domain is discretized into a large number of elementary cells, whereby Poisson's differential equation is reduced to a finite difference equation. [[EM.Ferma]] uses a fixed-cell grid to discretize the computational domain. You can control the mesh cell size and therefore the total number of cells along the X-, Y- and Z-axes independently. It The mesh properties can be accessed by clicking the <b>Mesh Settings</b> [[Image:fdtd_meshsettings.png]] button of the Simulate Toolbar or using the keyboard shortcut {{key|Ctrl+G}} or selecting the menu item <b>Simulate > Discretization > Mesh Settings</b>. The default mesh cell size is important 1 project unit along all three principal directions. For this tutorial, set the cell size along all the three directions X, Y and Z to pay attention 0.5mm to the generate a finer mesh cell sizes especially when dealing with elongated domain boxes.
The mesh properties can be accessed by clicking the <b>Mesh Settings</b> [[Image:fdtd_meshsettings.png]] button of the Simulate Toolbar (or using the keyboard shortcut <b>Ctrl+G</b> or via the menu <b>Simulate &rarr; Discretization &rarr; Mesh Settings</b>). For this tutorial, set the number of cells along all the three directions X, Y and Z to 50 to generate a rather fine mesh.  To view the mesh, click the <b>Show/Generate Mesh</b> [[Image:fdtd_meshshow.png]] button of the Simulate Toolbar (or alternatively use the keyboard shortcut <b>{{key|Ctrl+M</b>)}}. In general, the mesh view shows how the simulation engine sees your physical structure. You can also display the three mesh grid planes by right -clicking on one of the three items XY Grid Plane, YZ Grid Plane, or ZX Grid Plane in the “Discretization” section of the Navigation Tree navigation tree and selecting <b>Show</b> from the contextual menu. To remove the grid planes from the project workspace, open the same contextual menu and select <b>Hide</b>. You can move the grid planes across the computational domain using {{key|PageUp}} or {{key|PageDown}} buttons.
<table>
<tr>
<td>
[[Image:STATTUT1_4.png|thumb|center|350px320px|Static EM.Ferma's Mesh Settings dialog.]]
</td>
<td>
==Defining Project Observables==
Project observables are output quantities that you would like to compute at the end of an electrostatic simulation. Field sensors are used to visualize the near fields of your structure and the electric potential on a plane parallel to one of the three principal planes. The field sensor planes extend across the entire computational domain. To define a field sensor, right click on the <b>Field Sensors</b> item in the “Observables” section of the Navigation Tree navigation tree and select <b>Insert New Observable…</b> In the Field Sensor Dialog, enter the point (0, 0, 0) for <b>Coordinates</b> and select <b>Z</b> from the dropdown drop-down list labeled "'''Direction"'''. This means that your field sensor plane will be the XY plane, which passes through the center of the sphere. Accept the other default settings in the dialog box, and select <b>OK</b> to continue. A new entry Sensor_1 is added to the Navigation Treenavigation tree, and the field sensor is now represented in the project workspace by a purple plane across the computational domain. Next, define a second field sensor observable, this time parallel to the YZ Plane. Repeat the same procedure, and in the Field Sensor Dialog, enter the point (0, 0, 0) for <b>Coordinates</b> and select <b>X</b> from the dropdown drop-down list labeled "Direction".
<table>
<tr>
<td>
[[Image:STATTUT1_6.png|thumb|center|350px360px|Field Sensor dialog.]]
</td>
<td>
[[Image:STATTUT1_7.png|thumb|center|400px360px|The two defined field sensor planes in the XY and YZ planes.]]
</td>
</tr>
==Running the Electrostatic Simulation==
[[Image:STATTUT1_8.png|thumb|380px|The Static Module's Run dialog.]]At this time, your project is ready for electrostatic simulation. Click the <b>Run</b> [[Image:fdtd_runb.png]] Button of the Simulate Toolbar to open up the Simulation Run Dialog. Or alternatively, use the keyboard shortcut <b>{{key|Ctrl+R</b>}}, or select the menu item <b>Simulate &rarr; > Run…</b> The simplest simulation mode in [[EM.CubeFerma]] is “Analysis”. In this mode, your physical structure is taken “As Is” , and its mesh is passed to the electrostatic simulation engine, along with the necessary information regarding the sources and observables.
Before you run your first electrostatic simulation in [[EM.CubeFerma]], let’s take a closer look at the static engine’s settings. Click the <b>Settings</b> button next to the “Select Engine” dropdown drop-down list to bring up the Static Engine Settings Dialog box. Currently, there is only one numerical solvers and it is "GaussStabilized Bi-SeidelCG". The convergence error '''Convergence Error''' by default is set to 1e-6 3 and the maximum number of iterations is set to 10,000. These settings usually suffice for most simulations, and you will keep them intact for this tutorial lesson.
To run the simulation, click the <b>{{key|Run</b> }} button of the Simulation Run Dialog. A separate window pops up displaying messages from the simulation engine. Once the simulation has been completed, you can close the message window and return to the project workspace. The Navigation Tree navigation tree is now populated with simulation results, most notably under in its "Field Sensors"" section.
==Visualizing the <table><tr><td> [[Image:STATTUT1_8.png|thumb|390px|EM.Ferma's Run dialog.]] </td><td> [[Image:STATTUT1_9.png|thumb|330px|EM.Ferma's Simulation Data==Engine Settings dialog.]] </td></tr></table>
[[Image:STATTUT1_9A.png|thumb|400px|EM.Cube's Navigation Tree showing ==Visualizing the field sensor components.]] [[EM.Cube]]’s computational modules usually generate two types of data: 2D and 3D. 2D data are graphed in <b>EM.Grid</b>. 3D data are visualized in [[EM.Cube]]’s project workspace and the plots are usually overlaid on the physical structure.Simulation Data==
[[Image:STATTUT1_9A.png|thumb|300px|The field sensor component plots shown in the "Observables" section of EM.Ferma's navigation tree.]] [[EM.Cube]]’s computational modules usually generate two types of data: 2D and 3D. 2D data are graphed in <b>EM.Grid</b>. 3D data are visualized in [[EM.Cube]]’s project workspace, and the plots are usually overlaid on the physical structure. The field sensor section of the Navigation Tree navigation tree has a list of twelve amplitude and phase plots for all the six field components: E<sub>x</sub>, E<sub>y</sub>, E<sub>z</sub>, and H<sub>x</sub>, H<sub>y</sub>, H<sub>z</sub>. There are also two additional plots for the magnitude of total electric field and total magnetic field as well as the electric scalar potential and the magnitude of the magnetic vector potential. In an electrostatic simulation, the magnetic field is assumed to be zero. Therefore, you will only have electric field and electric potential plots. Moreover, both the field and potential are real-valued. To be consistent with [[EM.Cube]]'s other modules, the field components are plotted in magnitude and phase plots. The electric potential is plotted on a color-coded intensity plots that may involve both negative and positive values. Click on any of these plots to display them in the project workspace. You can use the standard view operations such as dynamic zoom, rotate view, pan view, etc. to better examine these plots.
<table>
<tr>
<td>
[[Image:STATTUT1_10_newSTATTUT1_10_newA.png|thumb|center|400px360px|Electric The X-component of electric field distribution in the XY plane.]]
</td>
<td>
[[Image:STATTUT1_11_newSTATTUT1_10_newB.png|thumb|center|400px360px|Electric potential The Y-component of electric field distribution in the XY plane.]]
</td>
</tr>
<tr>
<td>
[[Image:STATTUT1_12_newSTATTUT1_10_new.png|thumb|center|400px360px|Electric Total electric field distribution in the YZ XY plane.]]
</td>
<td>
[[Image:STATTUT1_11_new.png|thumb|center|360px|Electric potential distribution in the XY plane.]]</td></tr><tr><td>[[Image:STATTUT1_12_newA.png|thumb|center|360px|The Y-component of electric field distribution in the YZ plane.]]</td><td>[[Image:STATTUT1_12_newB.png|thumb|center|360px|The Z-component of electric field distribution in the YZ plane.]]</td></tr><tr><td>[[Image:STATTUT1_12_new.png|thumb|center|360px|Total electric field distribution in the YZ plane.]]</td><td>[[Image:STATTUT1_13_new.png|thumb|center|400px360px|Electric potential distribution in the YZ plane.]]
</td>
</tr>
==Verifying Your Simulation Results==
[[Image:STATTUT1_14.png|thumb|250px|The contents of the data file Sensor_1_X_ETotal.DAT viewed in Data Manager.]]
Using Gauss' law one can derive the following relationships for the electric field of a uniform spherical charge distribution:
[[Image:STATTUT1_15A.png|thumb|500px|EM.Cube's Data Manager showing a list of available 2D graphs and data files.]]
<math> E_r(r) = \frac{\rho}{3\epsilon_0}r, \ \ \ \ \ \ \ r\le a </math>
<math> E_r(r) = \frac{a^3\rho}{3\epsilon_0} \frac{1}{r^2}, \ \ \ \ \ r>a </math>
where a is the radius of the sphere, &rho; is the charge density, and &epsilon;<sub>0</sub> = 8.8542e8542&times;10<sup>-12 </sup> F/m is the permittivity of the free space. For the spherical charge object you built earlier, at r = 5mm, you will find:
<math> E_r(r = 0.005m) = \frac{1e(10^{-8 })(5\times 5e10^{-3})}{3 \times 8.8542e8542 \times 10^{-12}} = 1.882 V/m </math>
Besides the color-coded electric field distribution maps, [[EM.CubeFerma]] also generated generates 2D Cartesian graphs of the total electric fields along the crosshairs of the field sensor plane. You can move the crosshairs around by changing the "Coordinate" '''Coordinates''' values in the field sensor dialog. By default, the crosshairs of both Sensor_1 and Sensor_2 which you defined earlier are set at X = Y = 0. The 2D graphs are listed in [[EM.Cube]]'s Data Manager.
A list of all the 2D output data files generated at the end of a simulation can be viewed in [[EM.CubeFerma]]’s Data Manager. To open this dialog, click the <b>Data Manager</b> [[Image:fdtd_datamanagerb.png]] button of Simulate Toolbar, or use the keyboard shortcut <b>{{key|Ctrl+D</b>}}, or access the menu item <b>Simulate &rarr; > Data Manager</b>, or right -click on the Data Manager item in the “Observables” section of the Navigation Tree navigation tree and select <b>Open Data Manager…</b> Select the data file “Sensor_1_X_ETotal.DAT” and double-click on it or click the View button of Data Manager to see its contents. You will find a spreadsheet with two columns, one for the X values in the project units and the other for the total electric field along the X-axis in V/m. While “Sensor_1_X_ETotal.DAT” is selected in the Data Manager, click the <b>Plot</b> button to open "EM.Grid". For multiple file selection, use the keyboard’s <b>Ctrl Key</b>, or use the <b>Shift Key</b> to select a range of rows in the list. The total E-field is plotted as functions of the coordinate X on a Cartesian graph in EM.Grid. Note that the field increases linearly from r = 0 to r = 5mm, where it reaches a value of 1.88V/m as we calculated earlier, and it then drops down as 1/r<sup>2</sup>.
<table>
<tr>
<td>
[[Image:STATTUT1_14STATTUT1_15A.png|thumb|300px500px|The contents of the data file Sensor_1_X_ETotalEM.DAT viewed in Ferma's Data Manager.]]</td><td>[[Image:STATTUT1_15.png|thumb|500px|A Cartesian graph of the electric field along the X-axis.]]</td></tr></table> ==Analyzing Two Spheres of Opposite Charges== [[Image:STATTUT1_16.png|thumb|400px|The two Sphere objects of opposite charges and the default domain box enclosing them.]]In the first part of this tutorial lesson, you examined showing a spherical charge distribution with a uniform positive charge density list of &rho; = 1e-8 C/m<sup>3</sup>. In this part, you will add another charge sphere of the same dimensions but with opposite charge, or more specifically, with a uniform negative charge density of &rho; = -1e-8 C/m<sup>3</sup>. However, in order to create the new charge sphere, you have to define a new charge group because it has a different charge density available 2D graphs and cannot belong to CS_1. Follow the same procedure as in the previous part and define a new charge group called CS_2 in the Navigation Tree with a charge density of -1e-8 C/m<sup>3</sup>. While CS_2 is the active group in the Navigation Tree, draw a new sphere of radius 5mm with its center located at the coordinates (20mm, 0, 0). As soon as you draw the second sphere, you will notice that the domain box expands automatically to enclose both objects. Since the X dimension of the computational domain has increased substantially, you need to refine the mesh accordingly. Open the mesh settings dialog and set the number of cells along the X direction to 100. Leave the number of cells along the other two directions at 50. Next, open the property dialog of the second field sensor Sensor_2 by right-clicking on its name in the Navigation Tree and selecting <b>Properties...</b>. Change the X-coordinate of the sensor plane to 10mm, placing it midway between the two spheres. Finally, add a third sensor plane called Sensor_3, along the Y directions and with the coordinates (0, 0 , 0). This one will be in the ZX plane.  Run an electrostatic simulation of your new structure. This simulation will take longer than the previous one as you increased the volume of the computational domain by a factor of 2. The figures below show that electric fields and electric potentials on the three sensor planes:  <table><tr><td>[[Image:STATTUT1_17_new.png|thumb|center|400px|Electric field in the XY plane.]]</td><td>[[Image:STATTUT1_18_new.png|thumb|center|400px|Electric potential in the XY plane.]]</td></tr><tr><td>[[Image:STATTUT1_22_new.png|thumb|center|400px|Electric field in the YZ plane.]]</td><td>[[Image:STATTUT1_23_new.png|thumb|center|400px|Electric potential in the YZ plane.]]</td></tr><tr><td>[[Image:STATTUT1_24_new.png|thumb|center|400px|Electric field in the ZX plane.]]</td><td>[[Image:STATTUT1_25_new.png|thumb|center|400px|Electric potential in the ZX planedata files.]]
</td>
</tr>
</table>
Besides color-coded intensity plots, [[EMSelect the data file “Sensor_1_X_ETotal.Cube]] can also visualize field distributions in a vectorial format that often proves DAT” and double-click on it or click the {{key|View}} button of Data Manager to be very insightfulsee its contents. Open You will find a spreadsheet with two columns, one for the property dialog of X values in the YZ field sensor called Sensor_3 project units and the other for the "total electric field along the X-axis in V/m. While “Sensor_1_X_ETotal.DAT” is selected in the Data Manager, click the {{key|Plot Type}} button to open " EM.Grid". For multiple file selections, use the keyboard’s {{key|Ctrl}} key, or use the {{key|Shift}} key to select a range of rows in the "Vector" optionlist. Set The total E-field is plotted as a function of the "Maxcoordinate X on a Cartesian graph in EM. Size" (Grid. Note that the field increases linearly from r = 0 to r = 5mm, where it reaches a value of 1.9V/m (very close to the vector arrow conesvalue we calculated earlier) to and it then drops down as 1/r<sup>2</sup>. You should get a Next, plot like the one below: data file "Sensor_1_X_EPotential.DAT" and see the variation of the electric potential as a function of distance.
<table>
<tr>
<td>
[[Image:STATTUT1_19STATTUT1_15.png|thumb|center360px|350px|The property dialog A Cartesian graph of the total electric field sensoralong the X-axis.]]
</td>
<td>
[[Image:STATTUT1_20STATTUT1_15B.png|thumb|center360px|600px|Vectorial visualization A Cartesian graph of the electric field in potential along the YZ plane. The highlighted sphere carries positive chargeX-axis.]]
</td>
</tr>
28,333
edits