Figure 3: [[Animation]] of total E-field plots and far field radiation patterns at the end of an FDTD sweep simulation.
Â
===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.
Â
[[Image:PMOM151.png]]
Â
Figure 1: [[EM.Cube]]'s Objectives dialog.
Â
[[Image:PMOM150.png]]
Â
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==