modelStairball

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.

Components

TypeNameDefaultDescription
RealBallTrajectory
RealBallTrajectoryDEVS
RealStairs
ModelicaDEVS.SourceBlocks.StepStep1
ModelicaDEVS.FunctionBlocks.AddAdd1
ModelicaDEVS.FunctionBlocks.IntegratorIntegrator1
ModelicaDEVS.FunctionBlocks.IntegratorIntegrator2
ModelicaDEVS.FunctionBlocks.IntegratorIntegrator3
ModelicaDEVS.FunctionBlocks.IntegratorIntegrator4
ModelicaDEVS.FunctionBlocks.AddAdd4
ModelicaDEVS.FunctionBlocks.QuantiserQuantiser1
ModelicaDEVS.SourceBlocks.StepStep2
ModelicaDEVS.FunctionBlocks.AddAdd5
ModelicaDEVS.FunctionBlocks.ComparatorComparator1
ModelicaDEVS.FunctionBlocks.MultiplierMultiplier1
ModelicaDEVS.FunctionBlocks.AddAdd2
ModelicaDEVS.FunctionBlocks.MultiplierMultiplier2
ModelicaDEVS.FunctionBlocks.AddAdd3
ModelicaDEVS.SourceBlocks.ConstantConstant1
ModelicaDEVS.SinkBlocks.InterpolatorInterpolator1
ModelicaDEVS.Miscellaneous.worldModelworld