Figure 2: Defining a new custom output using the available standard output [[parameters]].
Â
===Running A Parametric Sweep===
Â
Parametric sweep is [[EM.Cube]]'s most versatile sweep type. During a parametric sweep, the values of one or more sweep [[variables]] are varied over their specified ranges, and the FDTD simulation is run for each combination of variable samples. If you define two or more sweep [[variables]], the process will then involve nested sweep loops that follow the order of definition of the sweep [[variables]]. The topmost sweep variable in the list will form the outermost nested loop, and the sweep variable at the bottom of the list will form the innermost nested loop. Note that you can alternatively run either a frequency sweep or an angular sweep as parametric sweeps, whereby the project frequency or the angles of incidence of a plane wave source are designated as sweep [[variables]]. Unlike [[optimization]] which will be discussed next, parametric sweeps are simple and straightforward and do not require careful advance planning.
Â
Before you can run a parametric sweep, first you have to define one or more [[variables]] in your [[EM.Cube]] project. A variable is a mathematical entity that has a numeric value. This numeric value can be changed at your discretion at any time. You can define a variable either directly as a number or as a mathematical expression that may involve other previously defined [[variables]]. Even in the latter case, an "expression" variable has a numeric value at any time. You can designate almost any numeric quantity or parameter in [[EM.Cube]] as a variable. Or alternatively, you can associate a variable with almost anything in [[EM.Cube]]. This includes all the geometrical properties of CAD objects like coordinates, rotation angles, dimensions, etc. as well as material properties of object groups and background structure, source [[parameters]], project frequency, mesh density, and unit cell periods in the case of a periodic structure. You can define a variable either in a formal manner using [[EM.Cube]]'s Variable Dialog or directly from the project workspace or from the Navigation Tree. In the former "formal" manner, first you open the [[Variables]] Dialog by clicking the '''[[Variables]]''' [[Image:variable_icon_tn.png]] button of the '''Simulate Toolbar''' or selecting '''Menu > Simulate > [[Variables]]... '''or using the keyboard shortcut '''Ctrl+B'''. By default, the variable list is initially empty. To add a new variable, click the '''Add''' button to open the "Add Variable Dialog". Choose a '''Name '''for your new variable. In the box labeled '''Definition''', define your new variable either as an independent variable with a numeric value or as a dependent variable using a mathematical expression that involves previously defined [[variables]].
Â
[[Image:PMOM146(1).png]]
Â
Figure 1: [[EM.Cube]]'s [[Variables]] dialog.
Â
[[Image:PMOM145(2).png]]
Â
Figure 2: Defining a new independent variable.
Â
Once you finish the definition of a new variable, its name and syntax (Definition) are added to the "Variable List". You can also see the '''Current Value''' of every variable at any time in the [[Variables]] dialog. Note that at this stage, you have simply defined one or more [[variables]], but you have not yet associated them with actual objects or project properties. Wherever you see a numeric value for a parameter in a dialog, e.g. the length of a rect strip object in its property dialog, you can replace the numeric value with a variable name or a mathematical expression using the names of the currently available [[variables]]. From this moment on, that parameter or quantity becomes tied up with the associated variable. This means that every time you change the value of that variable, the value of the associated object parameter or project property will change accordingly. You can change the value of a variable directly from the [[Variables]] Dialog using the '''Edit '''button or indirectly during a parametric sweep. In the former case, you have to click the '''Update '''button of the [[Variables]] dialog to make the changes effective. Alternatively, you can define new [[variables]] directly from the property dialogs of CAD objects, material group dialogs, source dialogs or many other [[EM.Cube]] dialogs. If you replace the numeric value of a parameter with a text-string name that has not already been defined as a variable, then a new variable by that name is created and added to the "Variable List". The numeric value of the associated parameter at the time of replacement is taken as the "current Value" of the newly created variable. In this way, you can easily and quickly define [[variables]] associated with the design [[parameters]] that you intend to sweep in your project.
Â
In a parametric sweep, you can vary the values of one or more "Independent" project [[variables]]. In other words, you designate one or more independent [[variables]] as sweep [[variables]] and specify how they should vary (be sampled) during the sweep simulation process. In [[EM.Cube]] you can define three types of sweep [[variables]]: '''Uniform''', '''Discrete '''and '''Random'''. Each sweep [[variables]] can be defined as one of these three types, and you can mix sweep [[variables]] of different types in a multivariable parametric sweep. A uniform sweep variable is defined by a "Start" and "End" value and is incremented by a predetermined "Step" value during a sweep. A discrete sweep variable is defined by a discrete set of values and takes on these values by the order of their list during a sweep. A random sweep variable, on the other hand, takes on random values during a sweep according to a specified probability distribution. [[EM.Cube]] currently offers two random distribution types. '''Uniform Distribution '''is defined by "Minimum" and "Maximum" values, while '''Normal (Gaussian) Distribution '''is defined by a "Mean" and "Standard Deviation". You need to specify the "Number of Samples" for both random variable types.
Â
To define sweep [[variables]] and run a parametric sweep, open the '''Simulation ''''''Run Dialog''', and select the '''Parametric Sweep''' option from the dropdown list labeled '''Simulation Mode'''. When you choose the parametric sweep option, the '''Settings''' button next to the simulation mode dropdown list becomes enabled. Clicking this button opens the '''Parametric Sweep Settings''' dialog. The '''Sweep [[Variables]] List '''is initially empty. On the left side of the dialog you see the "'''Independent [[Variables]] Table'''", which lists all the available independent [[variables]] of your project. Select an independent variable from the table and use the right arrow ('''-->''') button of the dialog to move it to the Sweep [[Variables]] List. Before moving the variable to the new location, the "Define Sweep Variable Dialog" opens up, where you have to define the attributes of your new sweep variable. In this dialog, you need to choose the type of the sweep variable using the three radio buttons labeled '''Uniform''', '''Discrete '''and '''Random'''. Depending on your choice, the proper section of the dialog becomes enabled, where you can define the range of your sweep variable and other relevant [[parameters]].
Â
Once you finish the definition of a sweep variable, its name and attributes are added to the Sweep [[Variables]] List. Note that you can change your mind and remove a sweep variable from the list. To do so, select its name or row from the list and use the left arrow (<--) button to move it back to the Independent [[Variables]] Table. You can also change the type or relevant values of a sweep variable after it has been defined. Select the variable and click the '''Edit '''button of the dialog. As mentioned earlier, the order of the sweep [[variables]] in the list determined the structure of the nested sweep loops in a multivariable sweep process. When you have two or more sweep [[variables]] in the list, you can change their order using the '''Move Up '''and '''Move Down '''buttons.
Â
The Parametric Sweep Settings dialog also features another useful button labeled '''Dry Run''', which runs a "fake" sweep [[animation]]. During a dry run, the sweep [[variables]] are varied sample by sample and all of their associated [[parameters]] in the project workspace are updated at each run. However, the simulation engine is not called during a dry run, and no numerical computations take place at all. Also, the Variable Dry Run dialog appears on the screen which shows the changing values of all the [[variables]] at all times. This dialog works in a similar way as the [[Animation]] Controls Dialog described earlier. You can change the speed of the updates or control them manually using the motion buttons. The dry run process continues forever until to stop it by clicking the close (X) button of the Dry Run dialog of simply hitting the keyboard's '''Esc Key'''. At ach update of a dry run, you can see how the CAD objects in your planar structure change. This is very useful to inspect the integrity of your structure and your defined [[variables]] before an actual simulation run. Once you are satisfied with the choice and definition of your sweep [[variables]], close the Parametric Sweep Settings dialog to return to the Simulation Run dialog, where you can start the planar MoM parametric sweep simulation by clicking the '''Run '''button.
Â
[[Image:PMOM148.png]]
Â
Figure 3: [[EM.Cube]]'s Parametric Sweep Settings dialog.
Â
[[Image:PMOM147.png]]
Â
Figure 4: Defining the type and range of a sweep variable.
Â
[[Image:PMOM149.png]]
Â
Figure 5: [[EM.Cube]]'s Variable Dry Run dialog.
===3D Near & Far Field Animation===