Changes

Using Python to Create Functions, Models & Scripts

2,813 bytes removed, 04:24, 6 September 2016
/* What Can You Do with Your Python Models? */
* Monte Carlo Simulation
As mentioned earlierFor single-variable Python functions, all the arguments of a model are added automatically to the Variables List, and can be used as regular independent variables. You can run a parametric sweep of a model in the same way you run a parametric sweep using any of [[EM.Cube]]'s modes dialog provides an easy way of performing a sweep, optimization of Monte Carlo simulation engines. In this processThree buttons labeled {{key|Sweep}}, successive evaluations of the model {{key|Optimize}} and {{key|Monte Carlo}} are made intended for all samples this purpose. In the case of the sweep variable(s). The results are written to an ASCII data file with a , you must enter '''.DATMin''' file extension that bears and '''Max''' values for the sweep variable. Select and highlight the same name as of your model. To run a parametric sweep of a model, first select it Python function from the Model dialog's list and then click the {{key|Sweep}} button of this dialog. This opens up to run the Parametric Sweep Settings Dialog, just as you will see in a regular parametric sweep in any of [[EM.Cube]]'s computational modules. Follow the same typical sweep procedure and define your sweep variables from the list of available independent variables, which in this case must be the arguments of your model. At the end completion of the sweep simulation, open the '''Data Manager''' to view or plot sweep data are saved in the output data file"Function_Name. [[Image:Info_icon.png|40px]] Click here to learn more about '''[[Parametric_ModelingDAT",_Sweep_%26_Optimization#Running_Parametric_Sweep_Simulations_in_EMa graph of your data is plotted in EM.Cube | Running Parametric Sweep Simulations]]'''Grid.
In a similar way, you can perform an optimization on your models. In this case you have to define a objective that includes the name of your model (as an output parameter) or any expression of it. You define your objectives in the '''Objectives Dialog'''. To run a optimization of a model, first select it from the Model dialog's list and then click the {{key|Optimize}} button of this dialog. This opens up the Optimization Settings Dialog, just as you will see in a regular optimization in any of [[EM.Cube]]'s computational modules. In this dialog, you need to define your optimization variables from the list of available independent variables, which in this case must be the arguments of your model. Note that your model can have several arguments and you can run a multivariable optimization. At the end of the optimization process, assuming that the optimizer algorithm converges, the current value of the optimization variable in the Variables List will be updated with its computed optimal value.
 
[[Image:Info_icon.png|40px]] Click here to learn more about '''[[Parametric_Modeling,_Sweep_%26_Optimization#Optimization | Running Optimization Simulations]]'''.
 
You can also generate an HDMR model from the numerical evaluations of any of your models. To run a HDMR sweep of a model, first select it from the Model dialog's list and then click the {{key|HDMR}} button of this dialog. This opens up the HDMR Settings Dialog, just as you will see in a regular HDMR sweep in most of [[EM.Cube]]'s computational modules. In this way you can create a new compact HDMR model for your model of a different type.
 
[[Image:Info_icon.png|40px]] Click here to learn more about '''[[Running_HDMR_Simulations_in_EM.Cube | Running HDMR Sweep Simulations]]'''.
 
{{Note|Running an optimization of your structure using one of [[EM.Cube]]'s simulation engines can be a very time consuming and memory-intensive task. Instead, you may consider developing a model for a certain response or quantity of interest in your structure as a function of one or more structure parameters and then run an optimization of that model far more efficiently.}}
<p>&nbsp;</p>
28,333
edits