data_element modify variable
Allows you to modify an existing variable.
Format:
data_element modify variable |
|---|
variable_name = | an existing solvar |
new_variable_name = | a new solvar |
adams_id = | adams_id |
comments = | string |
initial_condition = | real |
function = | function |
user_function = | real |
routine = | string |
Example:
data_element modify variable & |
|---|
variable_name = | variable__10 & |
adams_id = | 5 & |
comments = | "comment string" & |
initial_condition = | 0.121 & |
function = | cos( 10 ) |
Description:
Parameter | Value Type | Description |
|---|
variable_name | An Existing Solvar | Specifies the name of an existing variable |
new_variable_name | A New Solvar | Specifies the name of the new variable. You may use this name later to refer to this variable. |
adams_id | Adams_id | Specifies an integer used to identify this element in the Adams data file. |
comments | String | Specifies comments for the object being created or modified. |
initial_condition | Real | Specifies the initial value of the user_defined differential variable and, optionally, an approximate value of the initial time derivative. |
function | Function | Specifies the function expression definition that is used to compute the value of this variable. |
user_function | Real | Specifies up to 30 values for Adams to pass to a user-written subroutine. |
routine | String |
Extended Definition:
1. You create VARIABLEs to define scalar algebraic equations for independent use, or as part of the PLANT INPUT, PLANT OUTPUT, or ARRAY elements. The computed value of the VARIABLE may depend on almost any Adams system variable. Note that you cannot access reaction forces from user defined, POINT_CURVE, and CURVE_CURVE constraints (Adams UCONs, PTCV, CVCV statements). You can define the computed value of a VARIABLE by either writing a FUNCTION expression in the model or by calling a VARSUB user-written subroutine. The Adams Reference Manual chapter on "Function Expressions," discusses the attributes of FUNCTION expressions, and the chapter on "Subroutines," discusses user-written subroutines and accessible utility subroutines.
2. FUNCTION expressions and user-written subroutines can access the computed value of the VARIABLE with the Adams View function VARVAL(variable_name) to represent the value, where variable_name specifies the name you gave the VARIABLE when it was created.
User-written subroutines access single VARIABLE statement values by calling the subroutine SYSFNC.
Caution should be used when defining VARIABLEs that are dependent on other VARIABLEs or on Adams View elements that contains functions. If a defined system of equations does not have a stable solution, convergence may fail for the entire Adams model. The following example refers to this type of VARIABLE statement:
VARIABLE/1, FUNCTION= VARVAL(1)+1
When looked at as an algebraic equation, it looks like the following:
V=V+1.
However, when Adams tries to solve this equation using the Newton-Raphson iteration, the solution diverges and a message appears on the screen indicating that the solution has failed to converge.
3. Adams View will not allow you to have two variables with the same full name, so you must provide a unique name.
Normally, entity names are composed of alphabetic, numeric, or '_' (underscore) characters, and start with an alphabetic or '_' character. They may be any length. For more information, see
Using Extended Names.
By enclosing the name in double quotes, you may use other printable characters, or start the name with a numeral. If a name contains characters, or starts with a numeral, you must always quote the name when entering it.
Note that you can specify the parentage of an entity (for example, what part "owns" a marker or a geometry element) when you CREATE it by changing the name. If you enter just the entity name, then the default parent will be assigned by Adams View. If you type in the full name, then you may over ride the default parent. In most cases, when creating an entity, Adams View will provide a default name. The default name that Adams View provides will specify the parentage that it has assumed.
You may, or course, delete this name and use your own. The form of a full name is:
"...._NAME.GRAND_PARENT_NAME.PARENT_NAME.ENTITY_NAME"
The number of levels used varies from case to case and the parentage must exist before an entity can be assigned to it.
4. When you use the FILE ADAMS_DATA_SET WRITE command, Adams View writes an Adams data file for your model. Adams requires that each modeling element be identified by a unique integer identifier. If you use this parameter to specify a non-zero identifier, Adams View will use it in the corresponding statement in the Adams data file.
You may also enter zero as an identifier, either explicitly or by default. The next time you write an Adams file, Adams View will replace the zero with a unique, internally-generated identifier.
Adams View will permanently store this identifier with the element just as if you had entered it yourself.
Normally, you would let all identifiers default to zero, and Adams View would generate the identifiers for you. You are never required to enter a non-zero identifier. You only need to specify it if, for some reason, you wish to control the Adams file output.
5. When an Adams Solver data file (.adm) is read into Adams View, all comments associated with a statement (from the end of the previous statement through the end of the current statement) are stored with the object. Comments in the data file can be associated with model.
These comments must follow the title statement and be followed by the comment 'END OF MODEL COMMENTS'. This string must be uppercase.
When an Adams Solver data file is written, the comments for an object are written before the statement corresponding to the object.
6. The first value is the value of the user- defined variable at the start of the simulation. If you have entered an implicit equation, the second value may also need to be specified, which is an approximate value of the time derivative of the user-defined variable at the start of the simulation. Adams may adjust the value of the time derivative when it performs an initial conditions analysis. Entering an initial value for the time derivative may help Adams converge to an initial conditions solution. If you enter an explicit equation, you do not need to supply the second value since Adams can compute the initial time derivative directly from the equation.
7. To enter a function expression you enter a series of quoted strings.
The easiest way to enter a function expression in Adams View is to use the text editor in combination with the function builder. To invoke the text editor for entering a function expression, highlight the function field and then either pick the "EDIT" button at the top of the panel or type a ^t (control-t). The Adams View "function builder" is discussed below.
The syntactical correctness of a function expression can be investigated by using the "VERIFY" button at the upper right of the text editor. If there is a syntax error, a message is printed and the cursor is put near the problem.Proper unit consistency is not checked during function expression verification.
Tips:
■See the Adams User's Manual for information on writing user-written subroutines.