Define the Simulation Model

After creating a blank Dakota project, generally the first step is to define the simulation model that Dakota will be studying.  To get started, click on the New Simulation Model link underneath the Simulation Models table:


This will cause the Simulation Model Wizard to appear.


The general idea behind this wizard is to tell the Dakota GUI how to communicate with your simulation model executable.  The controls on this wizard page are as follows:

  • Simulation Model Name – Provide a custom name for your simulation model to identify it later.
  • Simulation Model Executable – Provide the path to your external simulation model that Dakota will run.
  • Input – Provide one (or more) template input files for your simulation model.  This will be needed by the Parameters page of the wizard to identify which portions of text will be replaced by Dakota in your template input file at runtime.
  • Output – Provide one (or more) template output files for your simulation model.  This will be needed by the Responses page of the wizard to know how to parse your output and extract quantities of interest from the text.  You may specify that a generated file should be expected after the simulation has finished running, or that console output should be expected instead of a file.
  • Console Syntax for This Model – The exact command-line text that should be executed in order to launch your simulation model.

If you are using the provided cantilever example files, this is what the wizard should look like once populated:


When you are ready to proceed, click Next.


The Parameters page is used for defining your simulation model’s parameters according to text replacements in the input file template.  For instance, suppose you want to define a “length” parameter for this model.  You can see “length = 10.0” in the input file.  At runtime, we would want Dakota to replace “10.0” with whatever value it is currently using.  Highlight the text that you want to have replaced by Dakota (in this case, “10.0”) and click “Add Parameter.”


Provide a name and default value for your parameter and click OK.

You will notice that a new parameter definition has been added to the table on the right:


If you make a mistake while defining parameters, click on the parameter in this table and then click Remove Parameter to start over.

When you're done, the page should look something like this:


When you are ready to proceed, click Next.


The Responses page is used for defining your simulation model’s responses based on expected text output.  To do this, you can define simple expressions that tell the Dakota GUI what to look for.  You can use either template output files (which will provide more of a guideline) or expected console output (in which case you need to know in advance what you’re looking for).  For the cantilever example problem, we will only expect console output to be generated.

To get started, click on the Add Response button and define a response:


You will be presented with the Response Location dialog, which gives you several controls for identifying a quantity of interest:


Generally speaking, while output from a simulation model can vary, quantities of interest will occur in the same place with relation to labels (or “key text”) that describe those quantities.  For instance, you might expect the following text in your output:

MASS = 0.001

To think about this dialog correctly, ask yourself how you would instruct another person to find this quantity of interest in a stream of output.  In extremely verbose terms, you might say to that person “First, locate the word MASS in the output, and then get the value that appears two fields after the word MASS.” 

We can convey the same sort of expression to the Dakota GUI using this dialog.  In the case of the cantilever example problem shown so far in these screenshots, the quantity of interest is one field that appears two lines after the word MASS.  So your sentence would be “Get 1 field that is 2 lines after the key text MASS.”  Thus, you would select “1”, “field(s)”, “2”, “line(s)”, and “after” in the appropriate controls, and set the key text to “MASS.”


Notice that the Result field doesn’t populate.  If you’re expecting console output, the GUI can’t display in advance what field will be grabbed from the output.  However, if you’re using a template output file that you expect to be generated (for instance, a log file), the Result field will populate with whatever field will get grabbed, based on the expression you define.  You can use this feature to fine-tune your expression and hone in on the quantity of interest.

After you have finished defining responses for your simulation model, you may click Finish and close the wizard.

You should see your simulation model in the Simulation Models table in the main settings editor.