Questions? Feedback? powered by Olark live chat software
Resources Home

Template Variable Formatting

The Rescale "Design of Experiments" (DOE) job type allows you to specify your runs and variables by means of these options:

  • Use a Run Definition File (CSV): each row is a case - also known as a run or Child Run
  • Specify your variables here: variable ranges are specified in your browser

Each of these options provides flexibility in how the variables you specify get transformed for use as input to each run of the DOE. This is done by means of template variable formatting.

Template files contain references to the variables that get substituted, at run- time, with values applicable to each Child Run. The basic placeholder for a variable, such as "x", in a template file looks like this:

${x}

If you use this syntax and specify your variables in a CSV file, then we will replace the placeholder with the value from your CSV without any modification. This is useful if the simulation code you are using has fixed-width text input files. This can be also useful if you would like to include non-numeric data in a file specific to that case. For example, you might include a description of each case as a comment in an input file, which may be more meaningful than the identifier we automatically assign to that case. So if your CSV looks like this:

description, v, z
case 1a, 2.2, 3.4
case 1b, 2.3, 3.4
case 2a, 3.1, 3.2

And your input file template looks like this:

# ${description}
vel: ${v}
z: ${z}

Then the processed template for the first case would look like this:

# case 1a
vel: 2.2
z: 3.4

You may prefer to have a specific consistent number format in the file, regardless of how the variable was specified in the CSV or how you specified it in the browser. For this situation, you can supply an additional format instruction, using a "0" or "#" for a digit, where trailing zeros are absent if the "#" symbol is used. Here are some examples:

x ${x?string("0")} ${x?string(“0.0")} ${x?string("0.00##")}
0.9 1 0.9 0.90
1.49 1 1.5 1.49
-55.123 -55 -55.1 -55.123
9810 9810 9810.0 9810.00

Notice that when the format string has fewer digits to the right of the decimal place than the value, then the value will be rounded accordingly. Scientific notation can be used as shown below:

x ${x?string("0E0")} ${x?string(“000E00")} ${x?string("0.0##E0")}
0.9 9E-1 90E-02 9.0E-1
1.49 1E0 15E-01 1.49E0
-55.123 -6E1 -55E00 -5.512E1
9810 1E4 98E02 9.81E3
Last Updated: Jan 21, 2016 01:19PM PST

Powered by Desk.com
c63bcf49f4eed122cd69ef16269a7198@rescale.desk-mail.com
https://cdn.desk.com/
false
desk
Loading
seconds ago
a minute ago
minutes ago
an hour ago
hours ago
a day ago
days ago
about
false
Invalid characters found
/customer/en/portal/articles/autocomplete