William (the Engineer formerly known as Jose),
The elastogap is a useful component because it lets you model a fixed or moving wall with intermittent contact.
I took the standard pendulum example from SystemModeler and added a moving wall. The combiTimeTable lets me input a time varying position of the wall. In this example, it moves to the right pushing the pendulum up for the first 3 seconds and then holds the position until 5 seconds, then it releases the pendulum by suddenly moving out of the way. I animated the prismatic movement of the wall with a big green arrow so you can see it move. This simulation uses all built-in components -- no need to write any custom code.
The model looks like this at 3 seconds: before the pendulum is released.

Here is the animation:

The model looks like this:

To run this model you must disable "dynamic state selection" because we have closed loops in the model (because of our "moving wall")
Go into preferences:

Why does this work?:
The CombiTimeTable outputs your position constraint over time to a translational position block. The position is attached to a prismatic joint so it moves the prismatic joint over time. The prismatic joint is attached to a planar constraint because the pendulum moves up and down so we must allow up/down sliding (y direction). The planar constraint attaches to another prismatic joint connected to an elastogap. This prismatic joint is constrained to allow discontinuous contact. you can set the spring rate and damping to get various behaviors from the elastogap -- i.e. super damped or very bouncy. Lastly, I added a Universal joint. This is more subtle but the prismatic joint ONLY allows X motion, The Planar joint gives you Y motion. However, you also need two rotations because as the pendulum swings, its angle changes so you must allow the angle of connection between the prismatic joint and the pendulum bob to rotate. (Remember -- our goal is to only constrain this bob in the x direction even though it can move up and down and rotate.
The model is attached.
I hope this helps.
Regards,
Neil*
*(Actually Neil was abducted by aliens so I am his evil twin...)
Attachments: