Difference between revisions of "Running HDMR Simulations in EM.Cube"

From Emagtech Wiki
Jump to: navigation, search
(Running an HDMR Sweep)
 
(16 intermediate revisions by the same user not shown)
Line 4: Line 4:
 
In the HDMR method, you run successive evaluations of a given function of one or more [[variables]] for a number of [[variables]] samples. Then you create an optimal monomial surface representation of the computed data as a function of those [[variables]]. The resulting simplified function is characterized by a finite number of monomial coefficients. Therefore, its computation is more faster and computationally efficient than the original functions.     
 
In the HDMR method, you run successive evaluations of a given function of one or more [[variables]] for a number of [[variables]] samples. Then you create an optimal monomial surface representation of the computed data as a function of those [[variables]]. The resulting simplified function is characterized by a finite number of monomial coefficients. Therefore, its computation is more faster and computationally efficient than the original functions.     
  
 
+
==Defining the HDMR Variables ==
==Defining HDMR Variables ==
+
  
 
[[Image:Variable32.png|thumb|500px|The HDMR Settings dialog.]]
 
[[Image:Variable32.png|thumb|500px|The HDMR Settings dialog.]]
 
To define the HDMR [[variables]], follow the procedure below:
 
To define the HDMR [[variables]], follow the procedure below:
* Open the '''Run Dialog''' of most of [[EM.Cube]]'s computational modules and select the '''HDMR''' option from the '''Simulation Mode''' dropdown list.  
+
* Open the Simulation '''Run Dialog''' of most of [[EM.Cube]]'s computational modules and select the '''HDMR''' option from the '''Simulation Mode''' dropdown list.  
 
* Click the '''Settings''' button next to the simulation mode dropdown list to open up the HDMR Settings Dialog.  
 
* Click the '''Settings''' button next to the simulation mode dropdown list to open up the HDMR Settings Dialog.  
 
* On the left side of the "[[Variables]]" section 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 "HDMR [[Variables]] Table".  
 
* On the left side of the "[[Variables]]" section 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 "HDMR [[Variables]] Table".  
* Before moving the variable to the new location, the "Define HDMR Variable Dialog" opens up, where you have to define the start and stop values of the variable along with its precision.  
+
* Before moving the variable to the new location, the "Define [[Optimization]] Variable Dialog" opens up, where you have to define the start and stop values of the variable (ignore the precision).  
 
* Once you finish the definition of an HDMR variable, its name and attributes are added to the HDMR [[Variables]] List.  
 
* Once you finish the definition of an HDMR variable, its name and attributes are added to the HDMR [[Variables]] List.  
  
 +
Note that you can change your mind and remove an HDMR variable from the list. To do so, select its name or row from the list and use the {{key|Left Arrow (<--)}} button to move it back to the Independent Variables Table. You can also change the attribute values of an HDMR variable after it has been defined. Select the variable from the list and click the {{key|Edit}} button of the dialog.
  
To define a design objective, follow the procedure below:
+
==Defining the HDMR Models ==
  
* Open the '''Objectives Dialog''' either by clicking the '''Objectives''' [[File:objective_icon.png]] button of the '''Simulate Toolbar''', or by selecting '''Menu > Simulate > Objectives...''' from the Menu Bar, or using the keyboard shortcut {{key|Ctrl+J}}. The objectives dialog is initially empty.
+
To define an HDMR model, follow the procedure below:
* To add a new objective, click the '''Add''' button of the dialog to open up the '''Add Objective Dialog'''. At the bottom of this dialog, you can see a list of all the available [[EM.Cube]] standard output [[parameters]]. This list may vary depending on the types of sources and observables you have defined in your project. 
+
* Type in any mathematical expressions in the boxes labeled '''Expression 1''' and '''Expression 2'''. If you select the name of any standard parameter in the table and double-click on it, it will be reflected in the expression box.
+
* Select one of the available options in the dropdown list labeled '''Logical Operator'''. The default operator is '''&quot;== (Equal To)&quot;'''.
+
* Once the construction of your objective is complete, click the '''OK''' button on the dialog to close it and return to the Objectives dialog.
+
  
You will see your new objective added to the Objective List table. You can modify a design objective using the {{key|Edit}} button of the Objectives dialog. Only design objectives that contain the logical operator &quot;==&quot; can be used as an [[optimization]] goal. All the design objectives that contain a logical operator other than "==" are treated as [[optimization]] constraints. This means that the optimizer algorithm first tries to minimize an error function that is based on the goals solely and then it verifies that the constraints are satisfied additionally.  
+
* click the '''Add''' button in the "Model Definition" section of the dialog to open up the '''Add HDMR Model Dialog'''. At the bottom of this dialog, you can see a list of all the available [[EM.Cube]] standard output [[parameters]]. This list may vary depending on the types of sources and observables you have defined in your project.
 +
* Choose a name for your HDMR model. Make sure that this name is unique and does not conflict with the existing data file names in your project's folder. 
 +
* Type in any mathematical expressions in the boxes labeled '''Expression'''. If you select the name of any standard parameter in the table and double-click on it, it will be reflected in the expression box.
 +
* You can have different names for your HDMR model and its model file with an '''.HDM''' file extension. But it is recommended that you choose the same name.
 +
Select one of the available options in the dropdown list labeled '''Logical Operator'''. The default operator is '''&quot;== (Equal To)&quot;'''.
 +
* Once the definition of your HDMR model is complete, click the '''OK''' button on the dialog to close it and return to the HDMR Settings dialog.
 +
 
 +
You will see your new HDMR added to the HDMR Model List table. You can modify a model definition using the {{key|Edit}} button of this dialog. You can also define more than one HDMR model at a time. Such models will be generated using the same simulation runs. However, it is recommended not to generate unrelated models together. In the example below, we have defined an HDMR model called "Resistance" for the real part of the Z11 [[parameters]] of a dipole antenna as a function of its length defined by an independent variable "L".
  
 
<table>
 
<table>
 
<tr>
 
<tr>
<td> [[Image:Variable31.png|thumb|300px|Defining an objective involving S parameters.]] </td>
+
<td> [[Image:Variable31.png|thumb|300px|Defining an HDMR model involving Z parameters.]] </td>
<td> [[Image:Variable34.png|thumb|300px|Defining an objective involving antenna directivity.]] </td>
+
 
</tr>
 
</tr>
 
</table>
 
</table>
 +
 +
[[Image:Variable34.png|thumb|550px|EM.Cube's Model dialog showing a the HDMR model "Resistance.HDM" generated by EM.Tempo's FDTD simulation engine.]]
 +
== Running an HDMR Sweep ==
 +
 +
After you define all of your HDMR [[variables]] and model(s), close the HDMR Settings dialog to return to the simulation Run dialog. When you click the {{key|Run}} button of the Simulation Run dialog to start the HDMR sweep process, an Output Window pops up that reports the various stages of the sweep loop and displays the progress or percentage of completion. After the sweep process is finished, an HDMR file with a '''.HDM''' file extension is added to your project's folder, which contains all the monomial coefficients of your HDMR model. You can see your new HDMR model [[EM.Cube]]'s Models Dialog, which you can open by clicking the '''Models''' button [[File:Models_icon.png]] of the Simulate Toolbar or selecting '''Menu > Simulate > Models...''' or using the keyboard shortcut {{key|Ctrl+L}}.
 +
 +
Note that once you generate an HDMR model, you can use it everywhere in [[EM.Cube]] just like any standard or library function or like a functional, tabular or Python model. In the above example, the syntax of your new custom function is Resistance(L) or Resistance(x). As you can see from the figure on the right, the current value of "Resistance" is about 115.2&Omega; because the argument of your HDMR function, i.e. "L", has a current value of 150mm, which can be verified in the [[Variables]] dialog.
 +
 +
<p>&nbsp;</p>
 +
[[Image:Back_icon.png|40px]] '''[[Parametric_Modeling,_Sweep_%26_Optimization | Back to Parametric Modeling, Sweep & Optimization]]'''

Latest revision as of 22:53, 27 July 2015

Choosing HDMR sweep as the simulation mode in the Simulation Run dialog.

An Overview of HDMR Method

In the HDMR method, you run successive evaluations of a given function of one or more variables for a number of variables samples. Then you create an optimal monomial surface representation of the computed data as a function of those variables. The resulting simplified function is characterized by a finite number of monomial coefficients. Therefore, its computation is more faster and computationally efficient than the original functions.

Defining the HDMR Variables

The HDMR Settings dialog.

To define the HDMR variables, follow the procedure below:

  • Open the Simulation Run Dialog of most of EM.Cube's computational modules and select the HDMR option from the Simulation Mode dropdown list.
  • Click the Settings button next to the simulation mode dropdown list to open up the HDMR Settings Dialog.
  • On the left side of the "Variables" section 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 "HDMR Variables Table".
  • Before moving the variable to the new location, the "Define Optimization Variable Dialog" opens up, where you have to define the start and stop values of the variable (ignore the precision).
  • Once you finish the definition of an HDMR variable, its name and attributes are added to the HDMR Variables List.

Note that you can change your mind and remove an HDMR 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 attribute values of an HDMR variable after it has been defined. Select the variable from the list and click the Edit button of the dialog.

Defining the HDMR Models

To define an HDMR model, follow the procedure below:

  • click the Add button in the "Model Definition" section of the dialog to open up the Add HDMR Model Dialog. At the bottom of this dialog, you can see a list of all the available EM.Cube standard output parameters. This list may vary depending on the types of sources and observables you have defined in your project.
  • Choose a name for your HDMR model. Make sure that this name is unique and does not conflict with the existing data file names in your project's folder.
  • Type in any mathematical expressions in the boxes labeled Expression. If you select the name of any standard parameter in the table and double-click on it, it will be reflected in the expression box.
  • You can have different names for your HDMR model and its model file with an .HDM file extension. But it is recommended that you choose the same name.

Select one of the available options in the dropdown list labeled Logical Operator. The default operator is "== (Equal To)".

  • Once the definition of your HDMR model is complete, click the OK button on the dialog to close it and return to the HDMR Settings dialog.

You will see your new HDMR added to the HDMR Model List table. You can modify a model definition using the Edit button of this dialog. You can also define more than one HDMR model at a time. Such models will be generated using the same simulation runs. However, it is recommended not to generate unrelated models together. In the example below, we have defined an HDMR model called "Resistance" for the real part of the Z11 parameters of a dipole antenna as a function of its length defined by an independent variable "L".

Defining an HDMR model involving Z parameters.
EM.Cube's Model dialog showing a the HDMR model "Resistance.HDM" generated by EM.Tempo's FDTD simulation engine.

Running an HDMR Sweep

After you define all of your HDMR variables and model(s), close the HDMR Settings dialog to return to the simulation Run dialog. When you click the Run button of the Simulation Run dialog to start the HDMR sweep process, an Output Window pops up that reports the various stages of the sweep loop and displays the progress or percentage of completion. After the sweep process is finished, an HDMR file with a .HDM file extension is added to your project's folder, which contains all the monomial coefficients of your HDMR model. You can see your new HDMR model EM.Cube's Models Dialog, which you can open by clicking the Models button Models icon.png of the Simulate Toolbar or selecting Menu > Simulate > Models... or using the keyboard shortcut Ctrl+L.

Note that once you generate an HDMR model, you can use it everywhere in EM.Cube just like any standard or library function or like a functional, tabular or Python model. In the above example, the syntax of your new custom function is Resistance(L) or Resistance(x). As you can see from the figure on the right, the current value of "Resistance" is about 115.2Ω because the argument of your HDMR function, i.e. "L", has a current value of 150mm, which can be verified in the Variables dialog.

 

Back icon.png Back to Parametric Modeling, Sweep & Optimization