Window.mo 584 B

1234567891011121314151617181920212223242526
  1. model Window
  2. parameter Real J = 0.08;
  3. parameter Real r = 0.017;
  4. parameter Real b = 150;
  5. parameter Real c = 1e3;
  6. input Real omega_input;
  7. input Real theta_input;
  8. output Real tau;
  9. output Real x;
  10. output Real v;
  11. output Real omega;
  12. output Real theta;
  13. output Real friction;
  14. equation
  15. der(theta) = omega;
  16. tau = c * (theta_input - theta) - friction;
  17. //tau = c * (theta - theta_input);
  18. der(omega) = tau/J;
  19. x = r * theta;
  20. v = r * omega;
  21. friction = b*v;
  22. annotation(
  23. experiment(StartTime = 0, StopTime = 1, Tolerance = 1e-6, Interval = 0.002)
  24. );
  25. end Window;