Obstacle.mo 289 B

12345678910111213
  1. model Obstacle
  2. parameter Real c = 1e5;
  3. parameter Real fixed_x = 0.45;
  4. input Real x;
  5. input Real v;
  6. output Real F;
  7. equation
  8. F = if x > fixed_x then c*(x - fixed_x) else 0;
  9. annotation(
  10. experiment(StartTime = 0, StopTime = 1, Tolerance = 1e-6, Interval = 0.002)
  11. );
  12. end Obstacle;