Changes

EM.Tempo

449 bytes added, 17:37, 10 June 2013
/* Computational Domain Settings */
The FDTD simulation time depends directly on the size of the computational domain. For free space radiation or scattering problems, the computational domain must be extended to infinity, which means an infinite number of cells in the computational domain. The solution to this problem is to truncate the domain by a set of artificial boundaries at a certain distance from the objects in the computational domain. The absorbing boundaries should be such that the field propagates through them without any back reflection. Different methods have been used to simulate an absorbing boundary condition in FDTD simulations. The most common ones are Mur, Liao, and the perfectly match layer (PML). The Mur boundary condition calculates the boundary field values from the three dimensional scalar wave equations, while the Liao boundary condition is based on extrapolation of the fields in space and time. In 1994, Berenger proposed a new boundary condition called the perfectly matched layer (PML), which provides a much better performance than the Liao and Mur boundary conditions. The PML medium properties surrounding the computational domain are chosen to effectively absorb all the outgoing waves propagating towards the boundaries. In PML regions, an artificial conductivity is introduced such that it starts with very small values at the free space-PML interfaces and gradually increases until it reaches its maximum value at the last layer of the PML region.
The PML boundary condition is not effective in absorbing evanescent waves, and it suffers from late-time reflections when simulating fields with very long time signatures. This is partly due to the weakly causal nature of the PML. A strictly causal form of the PML, known as the complex frequency-shifted PML (CFS-PML), was later developed by simply shifting the frequency dependent pole off the real axis and into the negative-imaginary half of the complex plane. It has been shown that the CFS-PML is highly effective at absorbing evanescent waves and signals with a long time signature. Therefore, using the CFS-PML, the boundaries can be placed closer to the objects in the computational domain, and considerable time and memory savings can be achieved. The convolutional PML (CPML) is an efficient implementation of the CFS-PML based on a stretched coordinate formulation in conjunction with recursive convolution. It has been shown that CPML requires only two auxiliary [[variables ]] per discrete field point and absorbs waves in isotropic, homogeneous, inhomogeneous, lossy, dispersive, anisotropic or non-linear media without any further generalization.
The CPML is formulated in the stretched coordinate space. The CPML layers are assumed to terminate the FDTD computational domain. The X components of Maxwell's frequency-domain curl equations can then be written in the following form:
* Click the '''Domain''' [[Image:domain_icon.png]] button of the '''Simulate '''Toolbar or select '''Menu > ''''''Simulate ''''''> Computational Domain > Domain Settings...''' or right click on the '''FDTD Domain''' item of the Navigation Tree and select '''Domain Settings...''' from the contextual menu, or use the keyboard shortcut '''Ctrl+A'''. The Domain Settings Dialog opens up, showing the current domain type selection.
* Select one of the two options for '''Domain Type'''<nowiki>: </nowiki>'''Default''' or '''Custom'''.
* If you select the "Default" domain type, the domain box is defined in terms of the offsets along the X, Y and Z directions from the largest extents of your physical structure. Select one of the two options for '''Offset Units: Grid''' and '''Wavelength'''. In the section titled '''"Domain Size"''', enter the amount of domain extension beyond the largest extents of the structure along the ±X, ±Y and ±Z directions. Note that in the case of a default-type domain box, the offset values based on your current project settings (frequency and units).
# Dispersion Sweep
# Huygens Sweep
# [[Optimization]]
# HDMR
===Defining Custom Output Parameters===
At the end of an FDTD simulation, a number of computed quantities are designated as "Standard Output" parameters and can be used for various post-processing data operations. For example, you can define design objectives based on them, which you need for [[optimization]]. The table below gives a list of all the currently available standard output parameters in EM.Cube's [[FDTD Module]]:
{| border="1" cellspacing="1" cellpadding="1"
All the radiation- and scattering-related standard outputs are available only if you have defined a radiation pattern far field observable or an RCS far field observable, respectively. The standard output parameters DGU and ARU are the directive gain and axial ratio calculated at the certain user defined direction with spherical observation angles (&theta;, &phi;). These angles are specified in degrees as '''User Defined Azimuth & Elevation''' in the "Output Settings" section of the '''Radiation Pattern Dialog'''. The standard output parameters HPBWU, SLLU, FNBU and FNLU are determined at a user defined f-plane cut. This azimuth angle is specified in degrees as '''Non-Principal Phi Plane''' in the "Output Settings" section of the '''Radiation Pattern Dialog''', and its default value is 45°. The standard output parameters BRCS and MRCS are the total back-scatter RCS and the maximum total RCS of your planar structure when it is excited by an incident plane wave source at the specified &theta;<sub>s</sub> and &phi;<sub>s</sub> source angles. FRCS, on the other hand, is the total forward-scatter RCS measured at the predetermined &theta;<sub>o</sub> and &phi;<sub>o</sub> observation angles. These angles are specified in degrees as '''User Defined Azimuth & Elevation''' in the "Output Settings" section of the '''Radar Cross Section Dialog'''. The default values of the user defined azimuth and elevation are both zero corresponding to the zenith.
If you are interested in calculating certain quantities at the end of a simulation, which you do not find among EM.Cube's standard output data, you can define your own custom output. EM.Cube allows you to define new custom output as any mathematical expression that involves the available standard output parameters, numbers, [[variables ]] and all of EM.Cube's mathematical functions. For a list of legitimate mathematical functions, click the '''Functions [[Image:functions_icon.png]] '''button of the '''Simulate ''''''Toolbar''' or select '''Simulate > Functions... '''from the menu bar, or use the keyboard shortcut '''Ctrl+I''' to open the Function Dialog. Here you can see a list of all the available EM.Cube functions with their syntax and a brief description. To define a custom output, click the '''Custom Output [[Image:custom_icon.png]] '''button of the '''Simulate ''''''Toolbar''' or select '''Simulate > Custom Output... '''from the menu bar, or use the keyboard shortcut '''Ctrl+K''' to open the Custom Output Dialog. This dialog has a list of all of your custom output parameters. Initially, the list empty. You can define a new custom output by clicking the '''Add '''button of the dialog to open up the '''Add Custom Output Dialog'''. In this dialog, first you have to choose a new label for your new parameter and then define a mathematical expression for it. At the bottom of the dialog you can see a list of all the available standard output parameters, whose number and variety depends on your project's source type as well as the defined project observables. When you close the Add Custom Output dialog, it returns you to the Custom Output dialog, where the parameter list now reflects your newly defined custom output. You can edit an existing parameter by selecting its row in the table and clicking the '''Edit '''button, or you can delete any parameter from the list using the '''Delete '''button.
[[Image:PMOM141.png]]
===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]]
===Running An Optimization With FDTD Simulator===
[[Optimization ]] is a process in which the values of one or more [[variables ]] are varied in a systematic way until one or more design objectives are met. The design objectives are typically defined based on the output simulation data and are mathematically translated into an error (objective) function that is to be minimized. Running a successful [[optimization ]] requires careful advance planning. First you have to make sure that your [[optimization ]] problem does have a valid solution within the range of your [[optimization ]] [[variables]]. In other words, the design objectives must be achievable for at least one combination of the [[optimization ]] variable values within the specified ranges. Otherwise, the [[optimization ]] process will not converge or will exhaust the maximum allowed number of iteration cycles and exit unsuccessfully.
An [[optimization ]] process in EM.Cube involves several steps as follows:
# Define project (design) [[variables ]] and designate one or more [[optimization ]] [[variables ]] with respective ranges.
# Define project (design) objectives using a combination of standard and custom output parameters.
# (<u>Optional but Highly Recommended</u>) Run a parametric sweep of your [[optimization ]] [[variables ]] within their specified ranges and see if your design objectives have any chance of ever being met.# Choose the [[optimization ]] algorithm type and set its relevant parameters.
# If you have more than one design objective, define weights for the goals.
# Run the [[optimization ]] process and wait until it is completed.# Examine the optimal values of the participating [[variables ]] and the updated values of their associated parameters.# Run an analysis using the optimal variable values and validate the [[optimization ]] results.
A design objective is a logical expression that consists of two mathematical expressions separated by one of the logical operators: ==, <, <=, > or >=. These are called the left-hand-side (LHS) and right-hand-side (RHS) mathematical expressions and both must have computable numerical values. They may contain any combination of numbers, constants, variables, standard or custom output parameters as well as EM.Cube's legitimate functions. Objectives that involve the logical operator "'''<nowiki>==</nowiki>'''" are regarded a "'''Goals'''". The RHS expression of a goal is usually chosen to be a number, which is often known as the "'''Target Value'''". In the logical expression of a goal, one can bring the two RHS and LHS expressions to one side establish an equality of the form "(LHS - RHS) == 0". Numerically speaking, this is equivalent to minimizing the quantity | LHS - RHS |. During an [[optimization ]] process, all the project goals are evaluated numerically and they are used collectively to build an error (objective) function whose value is tried to be minimized. Objectives that involve "non-Equal" logical operators are regarded a "'''Constraints'''". Unlike goals which lead to minimizable numerical values, constraints are rather conditions that should be met while the error function is being minimized.
To define an objective, open the '''Objectives Dialog''' either by clicking the '''Objectives''' [[Image:objective_icon.png]] button of the '''Simulate Toolbar''', or by selecting '''Menu > Simulate > ''''''Objectives...''' from the Menu Bar, or using the keyboard shortcut '''Ctrl+J'''. The objectives list is initially empty. To add a new objective, click the '''Add''' button to open up the '''Add Objective Dialog'''. At the bottom of this dialog, you can see a list of all the available EM.Cube output parameters including both standard and custom output parameters. This list may vary depending on the types of sources and observables that you have already defined in your project. You can enter any mathematical expressions in the two boxes labeled '''Expression 1''' and '''Expression 2'''. The Available Output Parameter List simply helps you remember the syntax of these parameters. You should also select one of the available options in the dropdown list labeled '''Logical Operator'''. The default operator is '''"== (Equal To)"'''. As soon as you finish the definition of an objective, its full logical expression is added to the Objective List. You can always modify the project objectives after they have been created. Select a row in the Objective List and click the '''Edit '''button of the dialog and change the expressions or the logical operator. You can also remove an objective from the list using the '''Delete '''button.
Figure 2: Defining a new objective using a list of available output parameters.
Just like sweep [[variables]], [[optimization ]] [[variables ]] are chosen from the list of available independent [[variables ]] already defined in your project. Dependent [[variables ]] do not participate directly in an [[optimization ]] process, although their values continuously change in accordance with their associated independent [[variables]]. In fact, dependent [[variables ]] let you envision and formulate very complicated constrained [[optimization ]] scenarios.
To define [[optimization ]] [[variables ]] and perform an [[optimization]], open the '''Simulation ''''''Run Dialog''', and select the '''[[Optimization ]] '''option from the dropdown list labeled '''Simulation Mode'''. When you choose the [[optimization ]] option, the '''Settings''' button next to the simulation mode dropdown list becomes enabled. Clicking this button opens the '''[[Optimization ]] ''''''Settings''' dialog. This is a large dialog with several distinct sections. In the section titled "'''[[Optimization ]] Algorithm'''", you can choose one of EM.Cube's three currently available optimizers: '''Powell's Method''', '''Basic Genetic Algorithm '''and '''Fast Pareto Genetic Algorithm'''. For all three optimizers you have to set the '''Maximum Number of Iterations''', which has a default value of 5. For the two genetic algorithms, basic GA and Pareto, you also need to set the '''Population Size '''as a multiple of 5. The default population size is 50.
In the [[Variables ]] section of the dialog, you designate the [[optimization ]] [[variables]]. This is very similar to how you assign sweep [[variables ]] in a parametric sweep as discussed earlier. The '''[[Optimization ]] [[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 [[Optimization ]] Variable List. Before moving the variable to the new location, the "Define [[Optimization ]] Variable Dialog" opens up, where you have to set the '''Minimum '''and '''Maximum '''values of your new [[optimization ]] variable. Once you finish the definition of an [[optimization ]] variable, its name and Min/Max values are added to the [[Optimization ]] [[Variables ]] List. Note that you can change your mind and remove an [[optimization ]] 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 Min/Max values of an [[optimization ]] variable after it has been defined. Select the variable and click the '''Edit '''button of the dialog to change those value. If you check the box labeled "'''Update [[Variables ]] with Optimal Values'''" (as it is always checked by default), EM.Cube will automatically replace the definitions (and current values) of all the participating [[optimization ]] [[variables ]] in the '''[[Variables ]] Dialog''' with their computed optimal values and will update all the associated parameters in the project workspace. This, of course, will happen only if the [[optimization ]] process successfully converges. Sometimes, the [[optimization ]] process may get trapped in a local minimum. You may encounter this problem primarily when using the Powell method. You will notice that the values of the [[optimization ]] [[variables ]] soon get "saturated" and remain constant afterwards. EM.Cube lets you exit such local traps if you check the box labeled "'''Exit Local Min Trap'''". There is a box underneath, labeled '''Tolerance''', that becomes enabled and has a default value of 0.01. This means that exit a local minimum trap when the value of the [[optimization ]] variable stays within 1% error after successive [[optimization ]] runs. In that case, the [[optimization ]] process ends forcibly before having achieved convergence.
Finally, in the section titled "'''Error Function'''" of the [[Optimization ]] Dialog you build the mathematical form of your objective function. Keep in mind that EM.Cube's [[optimization ]] is a numerical process. Therefore, you can rarely minimize your error function to zero literally. You need to set a "'''Maximum Error'''" value for the objective function, which terminates the process as "converged" when it is reached. The default value of Maximum Error is 0.01. In two tables labeled '''Goals '''and '''Constraints''', you see a list of all the project objectives that have been split between the two tables according to their types. Many [[optimization ]] problems involve a single, straightforward goal. Others may involve multiple goals subject to multiple constraints. In those case, you have assign weights to your goals and constraints. If all of your goals and constraints have the same level of importance, then you assign equal weights to them. You can do this easily by clicking the '''Distribute '''button of the dialog. Or you may assign individual weights manually. However, you have to make sure that all the weight adds up to unity. The objective function of the [[optimization ]] problem is constructed from the goals and constraints using the specified weights. This can be done in two different ways: as '''Linearly Weighted Goals '''or as '''Mean Square Weighted Goals.''' You set these options from the dropdown list labeled '''Weight Type'''. Once you are satisfied with the choice and definition of your [[optimization ]] [[variables]], [[optimization ]] algorithms and goals weights, close the [[Optimization ]] dialog to return to the Simulation Run dialog, where you can start the planar MoM [[optimization ]] process by clicking the '''Run '''button.
[[Image:PMOM152.png]]
Figure 3: EM.Cube's [[Optimization ]] dialog.
==Modeling 3D Periodic Structures Using FDTD==
Administrator
613
edits