Browse Source

updated window.mo to conform to use case in the paper.

Cláudio Gomes 4 years ago
parent
commit
0426401fdc

+ 2 - 2
ModelicaModels/NoObstacle_Test.mo

@@ -4,8 +4,8 @@ model NoObstacle_Test
 equation
   power.u = 1.0;
   power.d = 0.0;
-  window.omega_input = power.omega;
-  window.theta_input = power.theta;
+  window.speed = power.omega;
+  window.displacement = power.theta;
   power.tau = - window.tau;
   annotation(
     experiment(StartTime = 0, StopTime = 1, Tolerance = 1e-06, Interval = 0.001));

+ 3 - 3
ModelicaModels/Obstacle.mo

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

+ 4 - 4
ModelicaModels/UncontrolledScenario.mo

@@ -5,11 +5,11 @@ model UncontrolledScenario
 equation
   power.u = 1.0;
   power.d = 0.0;
-  window.omega_input = power.omega;
-  window.theta_input = power.theta;
-  window.obj_F = obstacle.F;
+  window.speed = power.omega;
+  window.displacement = power.theta;
+  window.reaction_force = obstacle.F;
   power.tau = window.tau;
-  obstacle.x = window.x;
+  obstacle.disp = window.height;
   annotation(
     experiment(StartTime = 0, StopTime = 6, Tolerance = 1e-06, Interval = 0.0024),
     __OpenModelica_simulationFlags(jacobian = "coloredNumerical", s = "dassl", lv = "LOG_STATS"));

+ 8 - 15
ModelicaModels/Window.mo

@@ -1,24 +1,17 @@
 model Window
-  //parameter Real J = 0.01;
   parameter Real r = 0.11;
   parameter Real b = 10;
-  //parameter Real c = 1e5;
-  input Real omega_input;
-  input Real theta_input;
-  input Real obj_F;
+  input Real speed;
+  input Real displacement;
+  input Real reaction_force;
   output Real tau;
-  output Real x;
-  output Real v;
-  //output Real omega;
-  //output Real theta;
+  output Real height;
+  Real v;
   output Real friction;
 equation
-//der(theta) = omega;
-//tau = c * (theta_input - theta) ; //- obj_F*r
-  tau = obj_F * r + friction;
-//der(omega) = (tau - friction)/J;
-  x = r * theta_input;
-  v = r * omega_input;
+  tau = reaction_force * r + friction;
+  height = r * displacement;
+  v = r * speed;
   friction = b * v;
   annotation(
     experiment(StartTime = 0, StopTime = 1, Tolerance = 1e-06, Interval = 0.002));