### Where To Find This Example

Select **Help > Open Examples...** from the menus and type either the example name listed above or one of the keywords below.

Or in Version 13 or higher you can open the project directly from this page using this button. Make sure to select the **Enable Guided Help** before clicking this button.

### Design Notes

**Double Stub EM Optimization Example**

This example demonstrates MWO's ability to perform optimization on an EM structure. In the interest of simulation speed and simplicity, and relatively basic structure, a double stub microstrip filter, is being optimized.

__Setup Details__

There are two schematics in this project, "New_Discrete_Optimization" and "Old_Discrete_Optimization". The "Old_Discrete_Optimization" schematic uses the old optimization method for EM which is more complicated and time consuming. In the old method, you had to define a variable in the schematic and then optimize the variable. As you can see in the "Old_Discrete_Optimization" schematic, there are two different variables, **L1** and **L2**. These variables have been assigned to the length parameters of the MLEF elements. The reason for using variables instead of simply choosing those two parameters to be optimizable is so we can use discrete optimization. The benefit of using discrete optimization when optimizing an EM structure is that we can set the step size of the discrete variable list to be the same as the cell size of the extracted EM structure. The "L_VECT" vector is defined to set up for discrete optimization. Finally you set L1 and L2 to be optimized.

However in the new method, using the Discrete Local Search Optimizer, all the set up can be done in the Variable Browser. Go to **View > Variable Browser** and look at the **L** values for MLEF elements in the "New_Discrete_Optimization" schematic. The **Lower**, **Upper**, and **Step Size **columns are set and the **Constrained** box is checked.

An optimization goal has been set so that S21 must be less than -10 dB from 4.5 GHz to 8.5 GHz.

__Simulation and Optimization__

After simulating the schematic, it is clear the filter in its current state is not meeting the optimization goal. At this point the circuit can either be optimized to achieve the goal.

To optimize the circuit, bring up the Optimization window and click the "Start" button. Note that the optimization method is set to "Discrete Local Search". Unlike other optimizers, this optimizer will only search over the discrete set of values determined by the Lower, Upper, and Step Size properties of the optimization variables. While the circuit is being optimized, you can see the layout of the extracted portion of the filter (2D and 3D) changing. Because of the number of frequency points and the nature of EM simulation, it may take up to a minute for the optimizer to reach its goal.

__ACE Optimization__

*Note: In order to utilize this feature, the user must have a license that includes ACE*

To change the solver from AXIEM to ACE, simply change the **Simulator** parameter of the EXTRACT block to "ACE". Also, disable the **EM_MESH** annotation and enable the **EXT_CKT3D** annotation.

In the Optimizer window, click on **Revert > Initial** to reset the dimensions of the filter. Now click "Start" in the Optimizer window or use the tuner to manually tune the circuit. ACE simulation will be much faster than using a standard EM solver.

__Tuning on Dielectric Height__

One other feature to try is tuning on the dielectric height. In the Global Definitions window, you can see that the parameter for the substrate height in the STACKUP has been defined as a variable, **T**, which is tunable. If you tune this variable, you can see the change in the filter response and see the dielectric height change in the 3D view of "EM_Extract_Doc".