Obstacle.mo 273 B

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