Related content
f1 is replaced by p1.f, v1 is replaced by p1.lV, x is replaced by lengthchg, k is replaced by springcst, v is replaced by velocitydiff, f is replaced by forcethru, v2 is replaced by p2.v, and f2 is replaced by p2.f.
model Spring
Flange p1;
Flange p2;
parameter Real springcst = “10”;
Real velocitydiff
Real forcethru
equation
p1.f+p2.f=0
forcethru=p1.f;
velocitydiff=p1.lV-p2.lV;
velocitydiff=der(lengthchg);
forcediff=springcst*lengthchg;
end Spring;