Window.mo 636 B

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