- Index
- » Programming
- » Modelica Language
- » Ideal Clutch
Ideal Clutch
Ideal Clutch
I'd like to model an ideal clutch, as this user already tried to do here
http://www.modelica-forum.com/forums/in … &p=289
The clutch should connect two flanges when locked, and let the flanges spin freely when not.
The core concept is this
Code:
if pre(locked) then
der(flange_a.phi) = der(flange_b.phi);
flange_a.tau + flange_b.tau = 0;
else
flange_a.tau = 0;
flange_b.tau = 0;
end if;
but this always give me the following error:
division by zero at time 0, (a=-3.5) / (b=0), where divisor b expression is: if $PRE.clutchDiscrete1.locked then 0.0 else -1.0
I tried with many different scenarios, but I always get this error.
I attach the demo code
IdealClutch.mo
Please: any advice will be greatly appreciated
- DarioMangoni
- 45 Posts
- Index
- » Programming
- » Modelica Language
- » Ideal Clutch