.ModelicaDEVS.Examples.Miscellaneous.Stairball

Information

Bouncing Ball

This example is taken from the PowerDEVS software. It simulates a ball bouncing down a stair.

The model represents the following equations:
dx/dt=vx
dvx/dt= -ba/m*vx
dy/dt=vy
dvy/dt=-g-ba/m*vy-sw*[b/m*vy+k/m*(y-int(h+1-x))]

where x and y are the horizontal and vertical position of the ball, respectively, sw is equal to 0 if the ball is in the air, and 0 if it touches the floor, ba is the air friction constant, k is the spring constant, and b is a damping constant. The function int(h+1-x) gives the height of the floor at a given position. Note that h is the height of the first (top) step, and we assume steps of 1m by 1m height and length.

The current ModelicaDEVS stairball model features the following parameters: m=1, ba=0.1, k=100000, b=30, and the initial conditions: x(0)=0.575, vx(0)=0.5, y(0)=10.5, vy=0.


Output:

There are three output variables present: BallTrajectory, BallTrajectoryDEVS and Stairs. The Stairs variable represents the stairs, or in other words, it gives the current height of the stairs. The BallTrajectoryDEVS variable shows the actual DEVS simulation output, and the BallTrajectory is the interpolated version of BallTrajectoryDEVS.
Generated at 2024-11-23T19:25:52Z by OpenModelicaOpenModelica 1.24.2 using GenerateDoc.mos