Explorar o código

power window model with object

Cláudio Gomes %!s(int64=8) %!d(string=hai) anos
pai
achega
f578fec7b5

+ 0 - 1
.gitignore

@@ -46,7 +46,6 @@ coverage.xml
 *,cover
 
 # Translations
-*.mo
 *.pot
 
 # Django stuff:

+ 18 - 0
debugging_fsa_cbd_composition/fsa_cbd_simulator/models/power_window.mo

@@ -0,0 +1,18 @@
+model power_window
+  parameter Real torque_w = 2;
+  parameter Real mass_w = 10;
+  parameter Real friction_w = 10;
+  parameter Real height_o = 0.4;
+  parameter Real stiffness_o = 1000;
+  parameter Real friction_o = 1000;
+  // Set 1.0 to enable object force.
+  parameter Real enable_o = 1.0;
+  Real height_w(start = 0);
+  Real velocity_w(start = 0);
+  Real force_o;
+equation
+  der(height_w) = velocity_w;
+  mass_w * der(velocity_w) = torque_w - friction_w * velocity_w + enable_o * force_o;
+  force_o = if height_w > height_o then (-friction_o * velocity_w) - stiffness_o * (height_w - height_o) else 0;
+  annotation(experiment(StartTime = 0, StopTime = 4, Tolerance = 1e-06, Interval = 0.008));
+end power_window;