WOLFRAM SYSTEM MODELER
CarModel of a car with replaceable wheels and powertrain |
SystemModel["EducationExamples.MechanicalEngineering.SlidingCar.Car"]
This model requires the PlanarMechanics library.
This model shows the concept of configurable modeling. The wheels are defined as replaceable models and can easily be changed in the car model.
This model is based on the TwoTrackWithDifferentialGear example from the Planar Mechanics Library. The library can be downloaded here. Four wheels interact with the ground through a friction model. Depending on the type of wheel and ground, different friction coefficients are used. To switch between different setups, use the drop-down menu in the General tab.
To simulate the model, click the Simulate button:
The simulation is set to run for 15 seconds. A constant torque is applied to the back wheels during the simulation. After 7 seconds, the front wheel will turn to the right over 3 seconds and then keep that front wheel angle for the rest of the simulation. See the position of the wheels of the car (as plotted below) or the forces on the wheels in the Model plots. The top plot shows the motion on asphalt and the bottom plot shows the motion on ice.
PlanarMechanics and Multibody systems have visualizers to show what a real-world system would look like.
To show a 3D animation of the model, click the Animate button:
It is also possible to add traces to the wheels to see the path they have taken over time in the animation. To do this, right-click the background in the animation and choose Trace Path, and then choose the components to trace. One option is to trace the different cylinders 2–5 (powerTrain.fixedTranslation2.cylinder) as shown in the following image:
By using the replaceable concept, we can redeclare the Wheel model and effectively change all four wheels of the car model with a drop-down menu.
planarWorld |
Type: PlanarWorld Description: Planar world coordinate system + gravity field + default animation definition |
|
---|---|---|
WheelJoint1 |
Type: Wheel Description: Model of the wheels used in the car |
|
WheelJoint2 |
Type: Wheel Description: Model of the wheels used in the car |
|
WheelJoint3 |
Type: Wheel Description: Model of the wheels used in the car |
|
WheelJoint4 |
Type: Wheel Description: Model of the wheels used in the car |
|
constantTorque |
Type: ConstantTorque Description: Constant torque, not dependent on speed |
|
differentialGear |
Type: DifferentialGear Description: Simple Model of a differential gear |
|
powerTrain |
Type: PowerTrain Description: Model of the powertrain used in the car |
|
inertia4 |
Type: Inertia Description: 1D-rotational component with inertia |
|
inertia3 |
Type: Inertia Description: 1D-rotational component with inertia |
|
inertia2 |
Type: Inertia Description: 1D-rotational component with inertia |
|
inertia1 |
Type: Inertia Description: 1D-rotational component with inertia |