model Obstacle parameter Real c = 1e10; parameter Real fixed_x = 0.45; input Real x; output Real F; Real compression; equation compression = x - fixed_x; F = if x > fixed_x then c * compression else 0; annotation( experiment(StartTime = 0, StopTime = 1, Tolerance = 1e-06, Interval = 0.002)); end Obstacle;