HyperStudy

Expression Builder

Expression Builder

Previous topic Next topic Expand/collapse all hidden text  

Expression Builder

Previous topic Next topic JavaScript is required for expanding text JavaScript is required for the print function  

The Expression Builder allows you to define an output response as a mathematical operation involving vectors (result values), input variables, previously defined output responses, and by extracting from an ASCII file. The Expression Builder consists of the following five tabs:

hmtoggle_plus1greyFunctions

In the Evaluate expression field at the top of the Expression Builder, you can enter a mathematical expression that defines the response. The expression may reference variables, through their Varnames, that are defined in the Design Variables, Responses, File Sources, or Extracts tabs. The expression may also make use of any of the available functions and operators that are listed in the Functions tabs (see Functions and Operators). You can define and add new functions to the existing list of functions through the External Function feature available in the Edit menu.

exp_builder_define

Function Examples

One of the commonly used functions in building an expression is called readsim. The readsim function returns a vector or matrix of values at a given time step; such as stress vector and displacement vector. For a detailed description of the readsim function, refer to the Templex and Math References Guide.

When you select readsim from the list of functions and click Insert Varname, the readsim - Builder dialog opens.

resvector_function

From this dialog, you are able to define the following readsim arguments:

Argument

Description

File

Browse to the location of the file from which to read.

Subcase

Select the subcase to read in the file.

Type

Select the type of data to read in the file.

Request

Select the first and last data request to read in the file.

The end_request must be greater than or equal to the start_request.

Component

Select the data component(s) to read in the file.

Timestep

Specify the timestep to read in the file.

Click Show Preview to display the readsim arguments that you selected above in a scatter 2D plot, textview, or table click show_hide_preview_icon. In Textview arguments display in an explicit numerical index.

resvector_function2

 

Response definitions can require data lookup or the interpolation of curves. When you have a pair of independent and dependent data vectors, v_1 and v_2, you can use the function linintep to evaluate a given value using linear interpolation. In the image below, the independent variable value is 0.2.

linintep_function

 

1.Add a response.
2.In the work area, Expression column of the response you just added, click hs_popupdialogicon.
3.In the Expression Builder dialog, click the Functions tab.
4.Scroll through the list of functions and select readsim.
5.Click Insert Varname.
6.In the readsim - Builder dialog, click foldericon.
7.In the Open File dialog, navigate to your working directory and open the file with the stresses.
8.Define the readsim function by selecting the Subcase and Type options, and then entering the first and last values of the component in the Request field (these are the minimum and maximum element numbers where the stress is of interest).
9.Click OK.
10.Click Evaluate expression. HyperStudy displays the vector in the Evaluate expression field.
11.To find the maximum value, use the max function (ex: max(readsim("C:/study/approaches/nom_1/run_00001/m_1/test.h3d",2,0,9,0,0,0,0))).

 

hmtoggle_plus1greyDesign Variables

The Design Variables tab lists the input variables in the current study with their corresponding Varnames. To reference an input variable in the Response expression field, select the input variable and click Apply. Alternatively, the Varname can be entered manually in the response expression field.

exp_builder_design_variables

 

hmtoggle_plus1greyResponses

The Responses tab lists the previously defined responses in the current study alongside their varnames. To reference a response in the Evaluate expression field, select the response and click Apply. Alternatively, the Varname can be entered manually in the Evaluate expression field.

exp_builder_responses

You can also use Templex statements, mathematical expressions, constants, and variables to create expressions for responses. Refer to the Templex Reference Guide for detailed information.

 

hmtoggle_plus1greyFile Sources

Use the File Sources tab to select result values in result files from solver runs. This process is facilitated through import templates and external readers, which are developed to interpret the format of a given solver output file. Templates and readers for the result files of a number of popular FEA solvers are registered by default. You may register additional templates and readers through the Import Templates and External Readers features available in the Edit menu. For a list of responses that support extraction in HyperStudy, see Result Extraction.

exp_builder_file_sources

1.In the Expression Builder, click the File Sources tab.
2.Click Add File Source.
3.In the HyperStudy - Add dialog, provide a label for the vector in the Label field.
4.Under Select type, select one of the following file source types:
Solver output file - direct results of an analysis. You can find these files in each run directory during a study.
Reference file - files that do not change during the study, such as tangent curves in a curve fitting study.
5.Click OK. HyperStudy adds the vector to the list of vector sources.
6.In the File Sources table, File column, click hs_popupdialogicon.
7.In the Vector Source dialog, navigate to your working directory and open the result file containing the results(s).

vec_source

8.Define the vector by selecting the appropriate Subcase, Type, Request, and Component options.

Note:        Subcase is only available for certain animation result files that actually contain subcases.

9.Click OK.
10.Click Insert Varname. HyperStudy adds the vector to the Evaluate expression field.

Note:        You can also manually enter the varname into the Evaluate expression field.

If the vector references multiple values (a proper vector), when you click Insert Varname, v_# appears in the Evaluate expression field. However, if the vector references a single value (a scalar), then when you click Insert Varname, v_#[0] appears in the Evalaute expression field.  That is, the first entry of the vector is automatically chosen for single entry vectors.

Vectors are defined for the current study, not just for individual responses. That is, Vector 1 refers to the same result for all response definitions.

 

 

hmtoggle_plus1greyASCII Extracts

The ASCII Extracts tab is a parser for ASCII result files. Use the file browser to open the ASCII file. You can search for the location of the response in the ASCII file using a Keyword. With the left mouse button, highlight the number that you would like to define as a response, and then right-click and select Value.  If you select the Keyword option, the position of the value will be determined relative to the keyword. This helps to deal with files of variable file length.  If no keyword is used, the position of the value is determined with respect to the beginning of the file. You can also define keywords by highlighting a string and selecting Keyword from the right-click context sensitive menu.

Note:The Keyword should not contain any blank characters, as they could cause problems with the XML study file upon re-import of the study.

exp_builder_extracts