VS Solvers and Math Models

Modular VS Math Models

CarSim, TruckSim, and BikeSim automatically construct custom VS Math Models every time a simulation is run. A VS Math Model is a set of variables and functions constructed for a specific vehicle of interest. It is used to run a simulation calculating values for variables of interest, writing results into files, and possibly exchanging information with other software during the simulation.

kanes equations and code
VS Lisp generates code for each multibody module. The code is correct and highly efficient. Click to see more.

Custom Parametric Math Models

VS Math Models are customized to include the parts needed to represent a vehicle of interest in a scenario of interest.

Machine-Generated Multibody Equations

Much of the source code in the library used to construct a VS Math Model is machine-generated by a symbolic multibody program called VS Lisp (originally called AutoSim). With over 25 years of continued use and development, VS Lisp is routinely used by the Mechanical Simulation development team to generate highly optimized equations of motion customized for specific 3D multibody modules, such as suspensions for motorcycles, cars, and trucks.

Modularized Solver Libraries

Dynamic VS Solver libraries that are provided with a VehicleSim product include modules for potential parts of a 3D multibody vehicle model, plus potential controllers, plus the ground, plus potential sensors, plus additional moving objects that represent traffic vehicles and other "actors" (pedestrians, signs, animals, buildings, etc.). Each time a simulation is run, a custom VS Math Model is constructed to run the simulation. Some examples:

  • A basic CarSim model has independent front and rear suspensions, an all-wheel hybrid powertrain, and controllers to steer and control the speed, operating on a flat and level surface.
  • The same vehicle runs in an urban environment with curbs, pedestrians, traffic signals, and ADAS sensors that detect other "actors."
  • A TruckSim vehicle has a 3-axle lead unit towing a semitrailer with a tandem, towing a dolly with 1 axle, supporting a second semitrailer with another tandem. It travels through an intersection with 3D geometry.
  • A CarSim model includes four independent vehicles, as shown in this video of ► an ADAS scenario in an urban intersection.

Here is more information about the available modules: Modular Vehicle Models (PDF).

Parameters and Configurable Functions

A VS Math Model is parametric; the built-in equations use parameters as placeholders. Values are provided at runtime for hundreds of parameters.

Parameters have numerical values. A value can be set with a number, a formula involving numbers (e.g., 1/16), or a formula involving other parameters (e.g., Y_S = -L_TRACK(1)/2). All parameters are assigned default values before reading input Parsfiles; if a parameter is not given a new value, the default value remains in effect.

About half of the calculations in a typical vehicle model involve fixed relationships between internal variables that might be nonlinear. Some examples:

  • target speed vs. time
  • tire forces and moments vs. slip and load
  • suspension toe and camber vs. jounce

A basic CarSim model has about 90 groups of Configurable Functions. Some groups have separated datasets for repeated parts such as suspensions, tires, etc.

As indicated by the name, these functions can be configured to use constants, linear coefficients, 1D tables with various built-in interpolation and extrapolation methods, and in some cases, 2D tables with various built-in interpolation and extrapolation methods. In some cases, functions can be replaced with symbolic formulas provided at runtime.

Indexed Parameters and Functions

VS Math Models use consistent names for parameters of parts that are repeated in a model, such as tires, wheels, springs, etc. Parameters and Configurable Functions for repeated parts are indexed, such that a single text file can be used multiple times to set values for different components. For example, it is common to use the same set of tire properties for multiple tires in the vehicle model. Although the model contains separate equations and values in memory, the values can be set from the same file if it is read multiple times.

Standard Files

Simulation I/O Files

VS Math Models receive all configuration information from simple keyword-based text files called Parsfiles. These files are generated automatically by the VS Browser (GUI and database manager) for use in VS Math Models and VS Visualizer. The format is simple and well-documented; advanced users often generate Parsfiles using external software for custom automation setups.

Machine-Generated Documentation

In addition to the primary role of solving equations, VS Math Models can generate a number of documentation files:

  1. An Echo Parsfile is written just after the model is initialized. Another is written just after the simulation ends. The Echo file lists every parameter that was used, along with every configurable function.
  2. A Log file is written that lists all Parsfiles encountered in setting up the run, along with status reports and possibly warnings or error messages.
  3. In addition to running simulations, VS Math Models can generate model documentation:
    1. List of all state variables in the model,
    2. List of all potential output variables (available as text or CSV).
    3. List of all potential import variables (available as text or CSV).
    These files are typically generated and viewed using the View button from the Run Control screen of the VS Browser.

Portable and Extensible

The VS Solver libraries used to construct VS Math Models are provided as dynamically linked library (.dll) files for Windows OS, and as shared object (.do) files for Linux. For HIL RT Systems, they are typically in a form required for the system: .dll, .so, or .lib.

The models are extensible by way of their modularity, as shown in the video ► extended TruckSim configurations. They are also extensible in other ways:

  1. The models include many mutually exclusive options that support many requirements. E.g., powertrain can use internal combustion, electric, or hybrid; multiple tire models are available; multiple steering configurations are available; etc.
  2. Some options are added as needed, such as Payloads, motion sensors, ADAS detection sensors, moving objects, etc.
  3. New variables and equations may be added through the use of VS Commands.
  4. The models communicate as needed with external simulation programs such as Simulink, LabVIEW, and ASCET through arrays of import and export variables.
  5. The models can run and access with other software, as supported by the VehicleSim software development kit (VS SDK).


video + plots
Machine-generated Echo file lists all parameters and tables used in a specific simulation. Click to see more.
outputs csv
Machine-generated CSV file showing all output variables for a specific VS Math Model. Click to see more.
Contact Us
Subscribe to Newsletter