Custom MATLAB 3D Rigid
Body Physics Engine
Alex Hsia
Project Overview
• Dynamic simulation of a Star Wars-themed roller
coaster with a novel suspension, built at low-
level from ground up (Simulink not used)
• Simulation is used to tune spring and damper
values to produce desirable suspension behavior
• Double four bar linkage allows vertical
translation, giving feeling of “floating”
• Pivoting joint allows yaw, giving feeling of
“drifting”
• MATLAB was chosen for following reasons:
• Existing team expertise
• Many options for type of solver used
• Good control over simulation accuracy and
speed
• Very customizable integration with other
roller-coaster design software
Double four-bar
linkage
Pivoting joint (springs
and dampers not
shown for yaw DOF)
Physical Model
• Motivation: Dynamic simulation
of a novel suspension on a roller
coaster car
• Simulates any number of point
masses connected by rigid
massless links, or springs, or
dampers
• Constrains any number of points
to 3D cubic splines representing
roller coaster track rails
Point masses
Spring and damper (red)
Triangle masses are
constrained to roller coaster
rails, which are represented
as 3D cubic splines
Spring and
damper
(red)
Yaw DOF: Pivoting Joint
Velocity in car X frame indicates “drift”
0 0.5 1 1.5 2 2.5
-0.5
0
0.5
1
1.5
2
Velocity, Car Frame
Time (s)
Velocity(m/s)
X
Y
Z
0 0.5 1 1.5 2 2.5
-0.3
-0.2
-0.1
0
0.1
Acceleration, Car Frame
Time (s)
Acceleration(Gs)
X
Y
Z
https://www.youtube.com/watch?v=eouZZfH-8a8
Heave DOF: 4 Bar Linkage
0 0.5 1 1.5 2 2.5
-1
0
1
2
3
Velocity, Car Frame
Time (s)
Velocity(m/s)
X
Y
Z
0 0.5 1 1.5 2 2.5
-1
0
1
2
Acceleration, Car Frame
Time (s)
Acceleration(Gs)
X
Y
Z
https://www.youtube.com/watch?v=LMSTMYtSI58
Full-Scale Simulation Validation
- Acceleration data taken for actual roller coasters using smartphones
- Acceleration time history compared to MATLAB simulation
- Kingda Ka simulation shown below
Small Scale (1:20) Simulation Validation
Final Coaster Track Design
0 20 40 60 80 100 120 140 160 180 200
-20
0
20
Velocity, Car Frame
Time (s)
Velocity(m/s)
X
Y
Z
0 20 40 60 80 100 120 140 160 180 200
-5
0
5
Acceleration, Car Frame
Time (s)
Acceleration(Gs)
X
Y
Z
0 20 40 60 80 100 120 140 160 180 200
-50
0
50
Yaw Angle (deg)
Time (s)
YawAngle(deg)(m/s)
A

Custom MATLAB 3D Rigid Body Physics Engine

  • 1.
    Custom MATLAB 3DRigid Body Physics Engine Alex Hsia
  • 2.
    Project Overview • Dynamicsimulation of a Star Wars-themed roller coaster with a novel suspension, built at low- level from ground up (Simulink not used) • Simulation is used to tune spring and damper values to produce desirable suspension behavior • Double four bar linkage allows vertical translation, giving feeling of “floating” • Pivoting joint allows yaw, giving feeling of “drifting” • MATLAB was chosen for following reasons: • Existing team expertise • Many options for type of solver used • Good control over simulation accuracy and speed • Very customizable integration with other roller-coaster design software Double four-bar linkage Pivoting joint (springs and dampers not shown for yaw DOF)
  • 3.
    Physical Model • Motivation:Dynamic simulation of a novel suspension on a roller coaster car • Simulates any number of point masses connected by rigid massless links, or springs, or dampers • Constrains any number of points to 3D cubic splines representing roller coaster track rails Point masses Spring and damper (red) Triangle masses are constrained to roller coaster rails, which are represented as 3D cubic splines Spring and damper (red)
  • 4.
    Yaw DOF: PivotingJoint Velocity in car X frame indicates “drift” 0 0.5 1 1.5 2 2.5 -0.5 0 0.5 1 1.5 2 Velocity, Car Frame Time (s) Velocity(m/s) X Y Z 0 0.5 1 1.5 2 2.5 -0.3 -0.2 -0.1 0 0.1 Acceleration, Car Frame Time (s) Acceleration(Gs) X Y Z https://www.youtube.com/watch?v=eouZZfH-8a8
  • 5.
    Heave DOF: 4Bar Linkage 0 0.5 1 1.5 2 2.5 -1 0 1 2 3 Velocity, Car Frame Time (s) Velocity(m/s) X Y Z 0 0.5 1 1.5 2 2.5 -1 0 1 2 Acceleration, Car Frame Time (s) Acceleration(Gs) X Y Z https://www.youtube.com/watch?v=LMSTMYtSI58
  • 6.
    Full-Scale Simulation Validation -Acceleration data taken for actual roller coasters using smartphones - Acceleration time history compared to MATLAB simulation - Kingda Ka simulation shown below
  • 7.
    Small Scale (1:20)Simulation Validation
  • 8.
    Final Coaster TrackDesign 0 20 40 60 80 100 120 140 160 180 200 -20 0 20 Velocity, Car Frame Time (s) Velocity(m/s) X Y Z 0 20 40 60 80 100 120 140 160 180 200 -5 0 5 Acceleration, Car Frame Time (s) Acceleration(Gs) X Y Z 0 20 40 60 80 100 120 140 160 180 200 -50 0 50 Yaw Angle (deg) Time (s) YawAngle(deg)(m/s) A