MapleSim
Test
create and run MapleSim tests
Calling Sequence
Parameters
Options
Description
Examples
Test(file1,file2,file3,...,opts)
file1,file2,file3,...
-
string; names of MapleSim files to test
opts
(optional) equation(s) of the form option = value; specify options for Test
create = truefalse
True means create or update the reference file for each file being tested. False means test each file. The default is false.
dir = string
Directory to search when no files are given. The default is the current directory.
logfile = string
Filename into which output is written. The default is test.log in dir.
maxerr = positive
Maximum allowable error. The default is 0.00001. This value is saved in the reference file; the saved value is used for the comparison.
maxtime = -1 or positive
The maximum real time allowed for running a simulation, in seconds. When running a test, the maximum allowable time is the previously required time (saved in the reference file) multiplied by scaletime. The default is -1, which means there is no limit.
scaletime = positive
Factor used to scale the original simulation time to get the time allowed for a test simulation. The default is 1.25.
vars = probes, diffs, or states
Specifies the variables to test:
probes means use the probes in the model. This is the default.
diffs means use the state variables that are integrated.
states means use all the state variables (includes index-1 and discrete variables).
MapleSim:-Test is an appliable module for creating and verifying tests for MapleSim models.
The MapleSim files to test are passed as strings. If no filenames are passed, then all filenames with extension msim in directory dir are tested.
When a test is run, an output file of the same name but with extension out is written. It has the same format as the reference file generated when the create option is true. Use the Test:-Compare procedure to generate plots that compare the output file with the reference file.
A log file is written containing the files tested, whether a file passed or failed, and a summary of the number of failures and failed files.
Create tests for all msim files in the current directory.
MapleSim:-Test⁡create
Test all msim files in the current directory.
MapleSim:-Test⁡
Create a test for a particular MapleSim file, and set maximum error to 0.001.
MapleSim:-Test⁡foo.msim,create,maxerr=0.001
Run the previously created test, but test the integrated state variables.
MapleSim:-Test⁡foo.msim,vars=diffs
See Also
MapleSim[Test][Compare]
Download Help Document