You must have MATLAB R2019a or later (earlier versions may work but are untested), and also must have the h5io package on your MATLAB path. The h5io package can be found either on GitHub or the MATLAB FileExchange.
This repository comes with several example files, as described below:
Create a world model:
Create a road model:
Create a vehicle model:
Run a sample simulation:
- examples/send_it.m - go over a jump, demonstrate wheel contact
- examples/left_side_speedbump.m - starts left front wheel on a speed bump, demonstrate IC solver
- examples/skidpad_and_bump.m - hits a speed bump while turning, demonstrates lateral acceleration
- examples/cobblestone_road.m - runs the cobblestone road, demonstrates time consuming solve
Here we run the sample file examples/send_it.m to test an example simulation. The required dependencies should be included in the repository. Upon running the simulation, a results file called "simulation.hdf5" will be created on the user's desktop. Additionally, two plots and one video file will be created. The plots allow the user to inspect CG and wheel motion, while the video file is a full visualization of the simulation.
Screenshot of Video:
This is a chassis simulation tool written purely in MATLAB. It is currently intended to primarily simulate ride dynamics. Note all units are assumed to be in SI.
Currently the only available model is the "simple_car", which is a 4-corner car model. It includes suspension components found in most road vehicles.
The tire is modelled as a spring/damper in parallel. Tire outer diameter is intersected with the road profile. The point of greatest vertical penetration into the circle is used to define ground profile input to the model.
The following parameters are needed to create a typical simple vehicle model, but some level of front/rear asymmetry is supported by the code if needed:
- Track width
- Sprung mass
- Sprung moment of inertia
- CG location from front axle and ground plane
- Front unsprung mass
- Rear unsprung mass
- Aerodynamic center of pressure
- Aerodynamic scaled coefficients
- Front spring rate
- Rear spring rate
- Front damping coefficient
- Rear damping coefficient
- Front motion ratio
- Rear motion ratio
- Front antiroll rate
- Rear antiroll rate
- Tire radius
- Tire spring rate
- Tire damping coefficient
The external world is modeled with simple ambient conditions:
- Atmospheric pressure
- Relative humidity
Currently the only available road model is the "simple_road", which prescribes a path for the vehicle as described below. The path must include the following vectors:
- Distance forward
- Yaw rate
- Left road profile vertical displacement
- Right road profile vertical displacement
The above described parameters are sufficient to create a ride dynamics simulation.
Currently the only available solver is the "roadload" solver, which simulates ride dynamics. This will be described below.
In general, we put the problem in state-space formulation and solve in MATLAB using ODE45. The equations below detail how to reformulate the typical equations of motion for use with this solver, which in general requires some matrix partitioning.
Mass, stiffness, and damping matrices come from the vehicle model detailed above. An eventual goal of this page will be to detail the derivation of the matrices, but I lost those notes so the code will have to suffice for the time being. See the KGG, MGG, and BGG functions in the class chassis_dynamics.sequence.roadload.residual for more details on the final form of these matrices in the meantime. The only nonlinearity included at the moment is tire contact with the road, which causes occasional updates of the stiffness and damping matrices.
John Scanlon (2023). chassis-dynamics (https://github.com/jscans12/chassis-dynamics/releases/tag/v1.0.1), GitHub. Retrieved .
MATLAB Release Compatibility
Platform CompatibilityWindows macOS Linux
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!
See release notes for this release on GitHub: https://github.com/jscans12/chassis-dynamics/releases/tag/v1.0.1