Sliding boundary in an analysis of an elasticity

Hi FF++ developpers and users.

As shown in the figure, I’d like to perform an analysis in which an object is stored by sliding it between upper and lower rails (curves given by y=f(x)) fixed in space.
If you know how to perform such an analysis, I would appreciate it if you could let me know.

Keita Kambayashi