summaryrefslogtreecommitdiff
path: root/SpringMassTest.mo
blob: 1efa1c9350d7fd203bfcf40d12dc45b07864518a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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;