variable set
Allows you to set the value of an existing Adams View variable.
An Adams View variable is analogous to a variable in a programming language. It represents a typed storage location that can contain data (e.g. real numbers, integer numbers, text strings, etc.).
Format:
variable set |
Variable_name = | .model_name.var_name |
Comments = | string |
Real_value = | real |
Units = | string |
Range = | real |
Allowed_values = | yes/no |
Delta_type = | ABSOLUTE/RELATIVE/PERCENT_RELATIVE |
Use_range = | Yes/No |
Use_allowed_values = | Yes/No |
Integer_value = | integer |
String_value = | string |
Object_value = | existing entity |
Index = | integer |
Example:
variable set & |
variable_name = | integer_numbers & |
comments = | "Integer variable" & |
integer_value = | 12 & |
range = | 10,20 & |
use_range = | yes & |
allowed_values = | 11,15 & |
index = | 1 |
Description:
Parameter | Value Type | Description |
|---|
Variable_name | String | Specifies an existing Adams View variable. You may identify an Adams View variable by typing its name. |
Comments | String | Allows you to store a multi-line comment describing the Adams View variable. |
Real_value | Real | Assigns a real number to be stored in this Adams View variable. |
Units | String | Allows you to specify the type of units to be used if the variable is defined to be an object only. |
Range | Real, Real | Specifies range of values allowed for this variable. |
Allowed_values | Real, Real | Specifies allowed values for this variable. |
Delta_type | ABSOLUTE/RELATIVE/PERCENT_RELATIVE | ABSOLUTE default value will be used if this parameter is omitted. |
Use_range | Yes/No | Specifies whether the range specified above should be applied on the variable. |
Use_allowed_values | Yes/No | Specifies whether the allowed values specified above should be applied on the variable |
Integer_value | Integer | Assign an integer number to be stored in this Adams VIEW variable |
String_value | String | Assign a string to be stored in this Adams View variable. |
Object_value | Existing entity | Assign an existing object to be stored in this Adams View variable. |
Index | Integer | Specifies the location at which to store the values in the variable. |
Extended Definition:
1. You may identify an Adams View variable by typing its name. if the default model contains any variable you may identify them by entering the Adams View variable name only. You must enter the full name of the variable if its not contained in the default model. For example, if the default model is “pendulum”, you must identify the variable “friction_coeff” in the model “fourbar” by entering “.fourbar.friction_coeff”. You must separate multiple Adams View variable names by commas.
2. The type of an Adams View variable is inferred by the initial value stored in the variable when the variable was crated. The type of an Adams View variable may not be changed after it has been created. For example, if an Adams View variable was created with the REAL_VALUE parameter it mat not contain any other type of data (e.g. integer, string).
3. The range is inclusive, that is if a range of 0,10 is specifies, value of the variable can be 0 through 10. A range can be unset by setting the range values both to the expression (NONE), as in:
Variable modify variable_name = VAR1
Range= (NONE),(NONE)
4. Allowed_Values parameter is mutually exclusive with the RANGE parameter. ALLOWED_VALUES may be unset by setting the allowed values to the expression (NONE), as in:
Varible modify variable_name = VAR1 allowed_values=(NONE),(NONE)
5. You may specify an index value from 1 to N+1, where N is the current number of values in the variable created.
Variable create variable_name = numbers real_value=3,2,1
You can do the following:
Variable modify variable_name = numbers real_value=4,5 index=4 to get the values “3,2,1,4,5” in the variable. Indexing also allows you to replace specific values in the variable as in:
Variable modify variable_name=numbers real_value=10 index=3 to get “3,2,10,4,5” as the resulting contents for “numbers”
6. Since objects can be used in a variety of contexts, Adams View cannot determine what type of units it should have. By telling Adams View what the unit type for this object is Adams View can perform the proper conversions on the values you specify.
Cautions:
1. Adams View variables are not the same as ADAMS variables accessed with the command DATA_ELEMENT CREATE VARIABLE.