![]() To put that in, we need to think about the physics of why it decays. ![]() Bouncing ball gravity lab how to#Of course, the more interesting question is how to handle the decay of the bounce. That gives you a bouncing behavior that looks just like Rhett’s constant acceleration animation: Bouncing ball screenshot with no dissipation. I assigned a fairly arbitrary spring constant to the ball, and put in an if-then statement to apply a spring force if the center of the ball was within a radius of the “floor.” Then I fiddled with the spring constant to give reasonable behavior, namely keeping the center of the ball from getting all the way to the floor. But, of course, that’s pretty easy and obvious, given all the previous futzing around with VPython simulation we’ve done here: we just treat the ball as a spring. Bouncing ball gravity lab code#And, of course, being a great big nerd, I’m far more interested in simulation than animation, so let’s think about the physics, here, and how to code it up in VPython.įirst and foremost, we need to think about how to handle the bouncing behavior. So, if you want to really animate a bouncing ball, you need to capture that. There are some significant differences between them– the projectile ball stops really quickly, while the ping-pong ball goes on forever– but they all have one thing in common: the bounce height decreases rapidly as the bouncing goes on. These are what I happened to have lying around: a black rubber “happy” ball from a lab set, a hard plastic projectile from a PASCO launcher, a ping-pong ball, and a racquetball. This is footage of four different types of balls bouncing on a lab cart in our stockroom, shot in gratuitous slow motion (240 fps) because I’m still playing around with my new camera. (As you can see from the watermark, I’m trying out a new video editor…) But, of course, my immediate reaction was, “That’s not how a bouncing ball looks…” This is how a bouncing ball looks: This was mostly making a point about the distinction between real simulation and animation, along the lines of yesterday’s post on social construction of videogame reality. ![]() Last week, Rhett did a post on animating a bouncing ball in VPython. is then used to calculate the rebound velocity. To capture the velocity of the ball just before the collision, the output port of the Second-Order Integrator block and a Memory block are used. Note the loop for calculating the velocity after a collision with the ground. So, in the bouncing ball model, when the ball hits the ground, its velocity can be set to a different value, such as to the velocity after the impact. This parameter allows you to reinitialize ( in the bouncing ball model) to a new value when reaches its saturation limit. On the Attributes tab, check Reinitialize dx/dt when x reaches saturation. Open the Second-Order Integrator block dialog box and see that has a lower limit of zero. ![]() In this case, the second equation is internal to the Second-Order Integrator block in this case. The sldemo_bounce model uses a single Second-Order Integrator block to model a bouncing ball. Use Second-Order Integrator Block to Model Bouncing Ball Note, however, the chatter of the states between 21 seconds and 25 seconds and warning from Simulink about the strong chattering in the model around 20 seconds. You can now simulate the system beyond 20 seconds. This algorithm introduces a sophisticated treatment for chattering behavior. On the Configuration Parameters dialog box and go to Solver > Zero-crossing options. Expand Sovler details, In Zero-corssing options, set Algorithm to Nonadaptive.Īs the ball hits the ground more frequently and loses energy, the simulation exceeds the Number of consecutive zero crossings default limit of 1000. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |