Command File
Creating an Adams Solver Command File
This section explains how to create a command file. Learn about
Command File Syntax.
Using a text editor, enter the commands you want to use to control your simulation, using the following guidelines. There are two conventions to write the commands:
First two lines define model dataset name and output prefix
■The first line must contain the name of your dataset file.
■The second line is the prefix name you want assigned to the output files that Adams Solver creates.
■The following lines contain all of the different commands you want Adams Solver to use while performing the simulation.
■The last line in your file contains the STOP command.
You should save the file with the extension .acf, although it is not required.
Example
compressor.adm ! First line: model dataset filename
run1 ! Second line: output prefix.
output/noseparator
simulate/transient, &
end=2, dtout=0.1
deactivate/motion, id=201
simulate/transient, end=5, dtout=0.01
stop
First line is empty
■The first line must be empty (no comments are allowed).
■The next lines must either comments or a FILE command that defines a model.
■Once a model is defined, next lines contain all of the different commands you want Adams Solver to use while performing the simulation.
■The last line in your file contains the STOP command.
You should save the file with the extension .acf, although it is not required.
Example
file/model=compressor.adm, output=run1 ! Second line (first line is empty)
simulate/transient, &
end=2, dtout=0.1
deactivate/motion, id=201
simulate/transient, end=5, dtout=0.01
stop
In this example, the name of the dataset is compressor.adm and the base name that is assigned to all of the output files Adams Solver creates is run1 (run1.msg, run1.out, and so on). The next four lines are identical to the example above. The simulation is finally terminated with the STOP command.
In Adams View, you can create a simulation script, which is analogous to the Adams Solver command file. To do this, select Simulate -> Simulation Script -> New, and then change Script Type to Adams Solver Commands. The only difference is that the model name and output results name (the first two lines of the Adams Solver command file) should not be used.
Command File Syntax
Adams Solver commands generally follow the syntactical rules governing Adams Solver statements.
Exceptions and special cases are:
Angles
Adams Solver generally assumes all angular data in an Adams Solver command is in radians. Therefore, if you want to use degrees as the input value for your angular data instead of the default, use a D after the value to indicate degrees.
Arguments
If Adams Solver finds one of the following syntactical errors in the arguments of a command, then the code issues an error message and ignores the entire command.
■An invalid number of values for an argument.
■An ambiguous argument abbreviation.
■An invalid value type for an argument (for example, you input a character value and the argument requires a numeric value or you input a real number with a nonzero fractional part and the argument requires an integer).
■Omission of a required argument or a required value for an argument.
If you assign an argument value that is not a member of the set of permissible values for that argument, Adams Solver issues an error message and ignores the argument, but executes the rest of the command.
Continuations
Adams Solver allows a command line to be at most eighty characters long. To input a command that is more than one line long, put an ampersand (&) as the last character of the input line. If you are entering commands interactively, Adams Solver responds by asking you to type in the next line. You can enter as many lines of input as you like.
Comments
Comments on any line start with a "!". All characters after the "!" are ignored.