This is an old revision of the document!


Cirque du Soleil Stunt

Activity Information

Learning Goals

  • Model a horizontal projectile and graph the object's motion independently with its horizontal and vertical components

Prior Knowledge Required

  • Kinematics
  • Unbalanced forces
    • $\Sigma F \neq 0$
  • Momentum
  • Energy

Code Manipulation

  • Copying/pasting code
  • Modifying existing code
  • While loops and if statements
  • Translating equations into code

—-

Activity

Handout

Cirque du Soleil Stunt

As part of your Cirque du Soleil audition you are going to ride a bicycle horizontally off a cliff and fall into an airbag that is in the back of a moving pickup truck driving towards the cliff. The people in charge of personnel safety at Cirque du Soleil are concerned about the level of danger in your proposed stunt. In order to reassure them that you have a reasonable chance of being successful with the stunt, you are going to create a computer simulation. Using the minimally working code and the ball velocity provided by the stunt coordinator, determine an appropriate airbag speed and complete the simulation that shows you will hit the moving airbag. Be sure to include velocity versus time graphs of both your horizontal and vertical velocities.

Note: when conducting this activity with students, the initial velocity of the bike (ball) and the initial position of the airbag (target) can be provided by the instructor, but for demonstration purposes they have been included in the code below.

Code

  1. GlowScript 2.8 VPython
  2. #Projectile and moving target challenge
  3. '''
  4. The people in charge of personnel safety at Cirque du Soleil are concerned about
  5. the level of danger in your proposed stunt. In order to reassure them that you have
  6. a reasonable chance of being successful with the stunt, you are going to create a computer simulation.
  7.  
  8. Using the minimally working code and the vehicle velocity value from your stunt coordinator,
  9. create a simulation that shows you will hit the moving airbag. Be sure to include
  10. velocity vs time graphs of both your horizontal and vertical velocities over time.
  11. '''
  12.  
  13. # scene set up DO NOT CHANGE.
  14. scene.align='left'
  15. scene.width=400
  16. scene.height=200
  17. #scene fov is scaling factor(in radians) greater than 1 zooms out, less than in.
  18. scene.fov=.25
  19.  
  20. # System Objects
  21. Table=box(pos=vec(-1,-.55,0),size=vec(2,1.1,2),color=color.orange)
  22. Ground=box(pos=vec(1,-1.2,-4),size=vec(6,.2,10),color=color.green)
  23. Ball=sphere(pos=vec(-1.9,0.2,.5), radius=.2,color=color.magenta)
  24. # ADD you must add some sort of target that starts at either end of the floor
  25. # Your target width should be the diamter of the ball
  26. # Be mindful your target height will affect your calculations, do not choose a height greater than 0.25
  27.  
  28. # DO NOT CHANGE. Tells he camera to follow ground after ground has been defined.
  29. scene.camera.follow(Ground)
  30.  
  31. # system parameters
  32. # DO NOT CHANGE. Time step rate and total run time
  33. dt = 0.01
  34. t = 0
  35. tf = 5
  36. # DO NOT CHANGE. Assigns initial vector values to objects set to zero so the can be defined later.
  37. Ball.velocity=vector(0,0,0)
  38. Ball.acc=vector(0,0,0)
  39. Target.velocity=vector(0,0,0)
  40.  
  41.  
  42. # You will be assigned a velocity for the ball by your teacher.
  43. Ballvx=0
  44. # Enter the velocity for the target that you calculate it needs to have in order for the ball to hit it.
  45. Targetvx=0
  46.  
  47. # DO NOT CHANGE. Defines ball and target vectors as what you assigned above and as earths free acceleration.
  48. Ball.velocity.x=Ballvx
  49. Ball.acc.y=-10
  50. Target.velocity.x=Targetvx
  51.  
  52. #Enter lines of code to produce a velocity time graphs in the x and y direction for the projectile
  53. velocityGraph = graph(align='left',width=400, height=200,title='velocity vs time', xtitle='time (s)', ytitle='velocity (m/s)',fast=False)
  54.  
  55.  
  56. #Only change line 76 . Button Code allows you to run/pause and reset the intial conditions
  57. running=False
  58.  
  59. def Run(b):
  60. global running
  61. running=not running
  62. if running: b.text="Pause"
  63. else: b.text="Run"
  64.  
  65. bbutton=button(text="Run", pos=scene.title_anchor, bind=Run)
  66.  
  67. def Reset(c):
  68. global t, Ball
  69.  
  70. t=0
  71. Ball.pos=vec(-1.9,0.2,.5)
  72. Ball.acc=vec(0,-10,0)
  73. Ball.velocity.x=Ballvx
  74. Ball.velocity.y=0
  75. Target.velocity.x=Targetvx
  76. #copy in the initial target position as assigned above when creating the target.
  77. cbutton=button(text="Reset", pos=scene.title_anchor, bind=Reset)
  78. #End of Button Code
  79.  
  80. '''
  81. Run the code and see what happens.
  82.  
  83. Assuming the ball is the stuntman bicyclist and the target is the truck with an airbag,
  84. Make adjustments to the initial conditions of the program and/or
  85. write additional code so the program can serve as evidence to safety personnel that
  86. the stunt is physically possible.
  87. '''
  88. #While true just means run the code all of the time.
  89. while True:
  90.  
  91. rate(100)
  92.  
  93. if running: #starts the loop when the run button is pressed.
  94. Ball.pos.x=Ball.pos.x+(Ball.velocity.x*dt)
  95. #Enter a line of code that gets the target to start moving when the run button is pressed.
  96.  
  97. #Enter another if statement that allows the ball to fall when it gets to the edge of the table.
  98. #The statement will need conditions for when to work and likely require multiple lines of code.
  99.  
  100.  
  101.  
  102. # Do not modifiy the lines of code below this line. It stops the ball and target when
  103. # they have the same x position. While the code is still running the objects don't move when x positions are the same
  104. if abs(Ball.pos.x-Target.pos.x)<.03: # less than small increment is needed in case calculation never reaches exactly zero.
  105. Ball.velocity.x=0
  106. Target.velocity.x=0
  107. Ball.acc.y=0
  108. Ball.velocity.y=0
  109.  
  110. # add the code for the velocity time graph so it gets updated in the loop
  111.  
  112.  
  113.  
  114.  
  115. t=t+dt

Answer Key

Handout

Code

  1.  

See Also

  • repository/cirque_du_soleil_stunt.1601574374.txt.gz
  • Last modified: 2020/10/01 17:46
  • by porcaro1