summaryrefslogtreecommitdiff
path: root/SpringMassTest.mo
diff options
context:
space:
mode:
authorSiddharth112352019-09-03 18:09:16 +0530
committerSiddharth112352019-09-03 18:09:16 +0530
commitb4b6aa36e3486a3544acc52419149b5671f841e9 (patch)
tree66c1783158f23e6d21c77324156fc57e18d4ac67 /SpringMassTest.mo
parentf5266f634f4fb4fd39933a83551a01cf446256b8 (diff)
downloadOpenModelica_HIL-master.tar.gz
OpenModelica_HIL-master.tar.bz2
OpenModelica_HIL-master.zip
Pushing entire Modelica HIL Tasks repoHEADmaster
Diffstat (limited to 'SpringMassTest.mo')
-rw-r--r--SpringMassTest.mo17
1 files changed, 17 insertions, 0 deletions
diff --git a/SpringMassTest.mo b/SpringMassTest.mo
new file mode 100644
index 0000000..1efa1c9
--- /dev/null
+++ b/SpringMassTest.mo
@@ -0,0 +1,17 @@
+model SpringMassTest
+
+parameter Real M = 1;
+parameter Real k = 1; //Spring Constant
+parameter Real b = 10;//Damping Coeff
+
+Real vel;
+Real dist;
+Real Force = if time > 10 and time < 11 then 105 else 100;
+equation
+Force = M * der(vel) + k*dist + b*vel;
+vel = der(dist);
+
+
+
+
+end SpringMassTest; \ No newline at end of file