Changeset 660
- Timestamp:
- 10/10/07 15:17:26 (14 months ago)
- Location:
- Modelica/branches/maintenance/2.2.2/Modelica
- Files:
-
- 8 modified
-
Blocks/Discrete.mo (modified) (1 diff)
-
Blocks/Sources.mo (modified) (2 diffs)
-
Electrical/Analog/Ideal.mo (modified) (21 diffs)
-
Mechanics/MultiBody/Examples/Loops/Utilities.mo (modified) (2 diffs)
-
Mechanics/MultiBody/Forces.mo (modified) (3 diffs)
-
Mechanics/MultiBody/Visualizers.mo (modified) (1 diff)
-
Mechanics/Rotational.mo (modified) (7 diffs)
-
Mechanics/Translational.mo (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
Modelica/branches/maintenance/2.2.2/Modelica/Blocks/Discrete.mo
r550 r660 105 105 protected 106 106 Real ySample; 107 RealtSample;107 Modelica.SIunits.Time tSample; 108 108 Real c; 109 109 annotation ( -
Modelica/branches/maintenance/2.2.2/Modelica/Blocks/Sources.mo
r653 r660 211 211 </html>")); 212 212 block Clock "Generate actual time signal " 213 parameter Realoffset=0 "Offset of output signal";214 parameter SIunits.Time startTime=0213 parameter Modelica.SIunits.Time offset=0 "Offset of output signal"; 214 parameter Modelica.SIunits.Time startTime=0 215 215 "Output = offset for time < startTime"; 216 216 extends Interfaces.SO; … … 598 598 block Ramp "Generate ramp signal" 599 599 parameter Real height=1 "Height of ramps"; 600 parameter Realduration(min=Modelica.Constants.small) = 2600 parameter Modelica.SIunits.Time duration(min=Modelica.Constants.small) = 2 601 601 "Durations of ramp"; 602 602 parameter Real offset=0 "Offset of output signal"; 603 parameter SIunits.Time startTime=0603 parameter Modelica.SIunits.Time startTime=0 604 604 "Output = offset for time < startTime"; 605 605 extends Interfaces.SO; -
Modelica/branches/maintenance/2.2.2/Modelica/Electrical/Analog/Ideal.mo
r550 r660 45 45 model IdealThyristor "Ideal thyristor" 46 46 extends Modelica.Electrical.Analog.Interfaces.OnePort; 47 Modelica.Blocks.Interfaces.BooleanInput fire 48 annotation (extent=[50,90; 90,130], rotation=-90); 47 49 parameter Modelica.SIunits.Resistance Ron(final min=0) = 1.E-5 48 50 "Closed thyristor resistance"; … … 52 54 "Forward threshold voltage"; 53 55 Boolean off(start=true) "Switching state"; 54 protected55 Real s56 "Auxiliary variable: if on then current, if opened then voltage";57 56 annotation ( 58 57 Documentation(info="<html> … … 175 174 height=0.6)); 176 175 177 public 176 protected 177 Real s 178 "Auxiliary variable: if on then current, if opened then voltage"; 179 constant Real unitVoltage(unit="V") = 1 annotation(Hide=true); 180 constant Real unitCurrent(unit="A") = 1 annotation(Hide=true); 181 182 equation 183 off = s < 0 or pre(off) and not fire; 184 v = (s*unitCurrent)*(if off then 1 else Ron) + Vknee; 185 i = (s*unitVoltage)*(if off then Goff else 1) + Goff*Vknee; 186 end IdealThyristor; 187 188 model IdealGTOThyristor "Ideal GTO thyristor" 189 extends Modelica.Electrical.Analog.Interfaces.OnePort; 178 190 Modelica.Blocks.Interfaces.BooleanInput fire 179 191 annotation (extent=[50,90; 90,130], rotation=-90); 180 equation181 off = s < 0 or pre(off) and not fire;182 v = s*(if off then 1 else Ron) + Vknee;183 i = s*(if off then Goff else 1) + Goff*Vknee;184 end IdealThyristor;185 186 model IdealGTOThyristor "Ideal GTO thyristor"187 extends Modelica.Electrical.Analog.Interfaces.OnePort;188 192 parameter Modelica.SIunits.Resistance Ron(final min=0) = 1.E-5 189 193 "Closed thyristor resistance"; … … 193 197 "Forward threshold voltage"; 194 198 Boolean off(start=true) "Switching state"; 195 protected196 Real s197 "Auxiliary variable: if on then current, if opened then voltage";198 199 annotation ( 199 200 Documentation(info="<html> … … 312 313 width=0.6, 313 314 height=0.6)); 314 315 public 316 Modelica.Blocks.Interfaces.BooleanInput fire 317 annotation (extent=[50,90; 90,130], rotation=-90); 315 protected 316 Real s 317 "Auxiliary variable: if on then current, if opened then voltage"; 318 constant Real unitVoltage(unit="V") = 1 annotation(Hide=true); 319 constant Real unitCurrent(unit="A") = 1 annotation(Hide=true); 318 320 equation 319 321 off = s < 0 or not fire; 320 v = s*(if off then 1 else Ron) + Vknee;321 i = s*(if off then Goff else 1) + Goff*Vknee;322 v = (s*unitCurrent)*(if off then 1 else Ron) + Vknee; 323 i = (s*unitVoltage)*(if off then Goff else 1) + Goff*Vknee; 322 324 end IdealGTOThyristor; 323 325 … … 390 392 Real s1; 391 393 Real s2 "Auxiliary variables"; 394 constant Real unitVoltage(unit="V") = 1 annotation(Hide=true); 395 constant Real unitCurrent(unit="A") = 1 annotation(Hide=true); 392 396 equation 393 397 0 = p.i + n2.i + n1.i; 394 398 395 p.v - n1.v = s1*(if (control) then 1 else Ron);396 n1.i = - s1*(if (control) then Goff else 1);397 p.v - n2.v = s2*(if (control) then Ron else 1);398 n2.i = - s2*(if (control) then 1 else Goff);399 p.v - n1.v = (s1*unitCurrent)*(if (control) then 1 else Ron); 400 n1.i = -(s1*unitVoltage)*(if (control) then Goff else 1); 401 p.v - n2.v = (s2*unitCurrent)*(if (control) then Ron else 1); 402 n2.i = -(s2*unitVoltage)*(if (control) then 1 else Goff); 399 403 end IdealCommutingSwitch; 400 404 … … 476 480 annotation (extent=[-20,60; 20,100],rotation=-90); 477 481 protected 478 Real s1; 479 Real s2; 480 Real s3; 481 Real s4 "Auxiliary variables"; 482 Real s1(final unit="1"); 483 Real s2(final unit="1"); 484 Real s3(final unit="1"); 485 Real s4(final unit="1") "Auxiliary variables"; 486 constant Real unitVoltage(unit="V") = 1 annotation(Hide=true); 487 constant Real unitCurrent(unit="A") = 1 annotation(Hide=true); 482 488 equation 483 p1.v - n1.v = s1*(if (control) then 1 else Ron);484 p2.v - n2.v = s2*(if (control) then 1 else Ron);485 p1.v - n2.v = s3*(if (control) then Ron else 1);486 p2.v - n1.v = s4*(if (control) then Ron else 1);489 p1.v - n1.v = (s1*unitCurrent)*(if (control) then 1 else Ron); 490 p2.v - n2.v = (s2*unitCurrent)*(if (control) then 1 else Ron); 491 p1.v - n2.v = (s3*unitCurrent)*(if (control) then Ron else 1); 492 p2.v - n1.v = (s4*unitCurrent)*(if (control) then Ron else 1); 487 493 488 p1.i = if (control) then s1*Goff + s3 else s1 + s3*Goff;489 p2.i = if (control) then s2*Goff + s4 else s2 + s4*Goff;490 n1.i = if (control) then -s1*Goff - s4 else -s1 - s4*Goff;491 n2.i = if (control) then -s2*Goff - s3 else -s2 - s3*Goff;494 p1.i = if control then s1*unitVoltage*Goff + s3*unitCurrent else s1*unitCurrent + s3*unitVoltage*Goff; 495 p2.i = if control then s2*unitVoltage*Goff + s4*unitCurrent else s2*unitCurrent + s4*unitVoltage*Goff; 496 n1.i = if control then -s1*unitVoltage*Goff - s4*unitCurrent else -s1*unitCurrent - s4*unitVoltage*Goff; 497 n2.i = if control then -s2*unitVoltage*Goff - s3*unitCurrent else -s2*unitCurrent - s3*unitVoltage*Goff; 492 498 end IdealIntermediateSwitch; 493 499 … … 562 568 Real s1; 563 569 Real s2 "Auxiliary variables"; 570 constant Real unitVoltage(unit="V") = 1 annotation(Hide=true); 571 constant Real unitCurrent(unit="A") = 1 annotation(Hide=true); 564 572 equation 565 573 control.i = 0; 566 574 0 = p.i + n2.i + n1.i; 567 575 568 p.v - n1.v = s1*(if (control.v > level) then 1 else Ron);569 n1.i = - s1*(if (control.v > level) then Goff else 1);570 p.v - n2.v = s2*(if (control.v > level) then Ron else 1);571 n2.i = - s2*(if (control.v > level) then 1 else Goff);576 p.v - n1.v = (s1*unitCurrent)*(if (control.v > level) then 1 else Ron); 577 n1.i = -(s1*unitVoltage)*(if (control.v > level) then Goff else 1); 578 p.v - n2.v = (s2*unitCurrent)*(if (control.v > level) then Ron else 1); 579 n2.i = -(s2*unitVoltage)*(if (control.v > level) then 1 else Goff); 572 580 end ControlledIdealCommutingSwitch; 573 581 … … 657 665 Real s3; 658 666 Real s4 "Auxiliary variables"; 667 constant Real unitVoltage(unit="V") = 1 annotation(Hide=true); 668 constant Real unitCurrent(unit="A") = 1 annotation(Hide=true); 659 669 equation 660 670 control.i = 0; 661 671 662 p1.v - n1.v = s1*(if (control.v > level) then 1 else Ron);663 p2.v - n2.v = s2*(if (control.v > level) then 1 else Ron);664 p1.v - n2.v = s3*(if (control.v > level) then Ron else 1);665 p2.v - n1.v = s4*(if (control.v > level) then Ron else 1);672 p1.v - n1.v = (s1*unitCurrent)*(if (control.v > level) then 1 else Ron); 673 p2.v - n2.v = (s2*unitCurrent)*(if (control.v > level) then 1 else Ron); 674 p1.v - n2.v = (s3*unitCurrent)*(if (control.v > level) then Ron else 1); 675 p2.v - n1.v = (s4*unitCurrent)*(if (control.v > level) then Ron else 1); 666 676 667 p1.i = if (control.v > level) then s1*Goff + s3 else s1 + s3*Goff;668 p2.i = if (control.v > level) then s2*Goff + s4 else s2 + s4*Goff;669 n1.i = if (control.v > level) then -s1*Goff - s4 else -s1 - s4*Goff;670 n2.i = if (control.v > level) then -s2*Goff - s3 else -s2 - s3*Goff;677 p1.i = if control.v > level then s1*unitVoltage*Goff + s3*unitCurrent else s1*unitCurrent + s3*unitVoltage*Goff; 678 p2.i = if control.v > level then s2*unitVoltage*Goff + s4*unitCurrent else s2*unitCurrent + s4*unitVoltage*Goff; 679 n1.i = if control.v > level then -s1*unitVoltage*Goff - s4*unitCurrent else -s1*unitCurrent - s4*unitVoltage*Goff; 680 n2.i = if control.v > level then -s2*unitVoltage*Goff - s3*unitCurrent else -s2*unitCurrent - s3*unitVoltage*Goff; 671 681 end ControlledIdealIntermediateSwitch; 672 682 … … 949 959 protected 950 960 Real s "Auxiliary variable"; 961 constant Real unitVoltage(unit="V") = 1 annotation(Hide=true); 951 962 equation 952 963 in_p.i = 0; … … 958 969 out.v = if (s < -1) then VMin.v else if (s > 1) then VMax.v else (VMax.v - 959 970 VMin.v)*s/2 + (VMax.v + VMin.v)/2; 971 960 972 end IdealOpAmpLimited; 961 973 … … 1316 1328 "true => switch open, false => p--n connected" annotation (extent=[-20,50; 1317 1329 20,90], rotation=-90); 1318 protected1319 Real s "Auxiliary variable";1320 1321 1330 annotation ( 1322 1331 Documentation(info="<HTML> … … 1372 1381 Line(points=[0, 51; 0, 26]), 1373 1382 Line(points=[40, 20; 40, 0]))); 1383 protected 1384 Real s "Auxiliary variable"; 1385 constant Real unitVoltage(unit="V") = 1 annotation(Hide=true); 1386 constant Real unitCurrent(unit="A") = 1 annotation(Hide=true); 1374 1387 equation 1375 v = s*(if control then 1 else Ron);1376 i = s*(if control then Goff else 1);1388 v = (s*unitCurrent)*(if control then 1 else Ron); 1389 i = (s*unitVoltage)*(if control then Goff else 1); 1377 1390 end IdealOpeningSwitch; 1378 1391 … … 1387 1400 "true => p--n connected, false => switch open" annotation (extent=[-20,50; 1388 1401 20,90], rotation=-90); 1389 protected1390 Real s "Auxiliary variable";1391 1392 1402 annotation ( 1393 1403 Documentation(info="<HTML> … … 1409 1419 </P> 1410 1420 </HTML> 1411 ", revisions="<html> 1421 ", revisions= 1422 "<html> 1412 1423 <ul> 1413 1424 <li><i> </i> … … 1441 1452 Text(extent=[-100, -40; 100, -79], string="%name"), 1442 1453 Line(points=[0, 51; 0, 26]))); 1454 protected 1455 Real s "Auxiliary variable"; 1456 constant Real unitVoltage(unit="V") = 1 annotation(Hide=true); 1457 constant Real unitCurrent(unit="A") = 1 annotation(Hide=true); 1443 1458 equation 1444 v = s*(if control then Ron else 1);1445 i = s*(if control then 1 else Goff);1459 v = (s*unitCurrent)*(if control then Ron else 1); 1460 i = (s*unitVoltage)*(if control then 1 else Goff); 1446 1461 end IdealClosingSwitch; 1447 1462 1448 1463 model ControlledIdealOpeningSwitch "Controlled ideal electrical opener" 1464 Interfaces.PositivePin p annotation (extent=[-110, -10; -90, 10]); 1465 Interfaces.NegativePin n annotation (extent=[90, -10; 110, 10]); 1466 Interfaces.Pin control 1467 "Control pin: control.v > level switch open, otherwise p--n connected" 1468 annotation (extent=[-10, 90; 10, 110], rotation=90); 1469 1449 1470 parameter SI.Voltage level=0.5 "Switch level" annotation (extent=[-56.6667, 1450 1471 10; -10, 56.6667]); … … 1454 1475 "Opened switch conductance" annotation (extent=[-56.6667, -56.6667; -10, 1455 1476 -10]); 1456 protected1457 Real s "Auxiliary variable";1458 1477 annotation ( 1459 1478 Documentation(info=" … … 1509 1528 Line(points=[0,96; 0,25]), 1510 1529 Line(points=[40, 20; 40, 0]))); 1511 public 1512 Interfaces.PositivePin p annotation (extent=[-110, -10; -90, 10]); 1513 Interfaces.NegativePin n annotation (extent=[90, -10; 110, 10]); 1514 Interfaces.Pin control 1515 "Control pin: control.v > level switch open, otherwise p--n connected" 1516 annotation (extent=[-10, 90; 10, 110], rotation=90); 1530 protected 1531 Real s "Auxiliary variable"; 1532 constant Real unitVoltage(unit="V") = 1 annotation(Hide=true); 1533 constant Real unitCurrent(unit="A") = 1 annotation(Hide=true); 1517 1534 equation 1518 1535 control.i = 0; 1519 1536 0 = p.i + n.i; 1520 p.v - n.v = s*(if (control.v > level) then 1 else Ron);1521 p.i = s*(if (control.v > level) then Goff else 1);1537 p.v - n.v = (s*unitCurrent)*(if (control.v > level) then 1 else Ron); 1538 p.i = (s*unitVoltage)*(if (control.v > level) then Goff else 1); 1522 1539 end ControlledIdealOpeningSwitch; 1523 1540 1524 1541 model ControlledIdealClosingSwitch "Controlled ideal electrical closer" 1542 Modelica.Electrical.Analog.Interfaces.PositivePin p annotation (extent=[-110, -10; -90, 10]); 1543 Modelica.Electrical.Analog.Interfaces.NegativePin n annotation (extent=[90, -10; 110, 10]); 1544 Modelica.Electrical.Analog.Interfaces.Pin control 1545 "Control pin: control.v > level switch closed, otherwise switch open" 1546 annotation (extent=[-10, 90; 10, 110], rotation=90); 1525 1547 parameter SI.Voltage level=0.5 "Switch level" annotation (extent=[-56.6667, 1526 1548 10; -10, 56.6667]); … … 1531 1553 "Opened switch conductance" annotation (extent=[-56.6667, -56.6667; -10, 1532 1554 -10]); 1533 protected1534 Real s "Auxiliary variable";1535 1555 annotation ( 1536 1556 Documentation(info=" … … 1553 1573 </P> 1554 1574 </HTML> 1555 ", revisions="<html> 1575 ", revisions= 1576 "<html> 1556 1577 <ul> 1557 1578 <li><i> </i> … … 1584 1605 Line(points=[40,0; 96,0]), 1585 1606 Line(points=[0,96; 0,25]))); 1586 public 1587 Modelica.Electrical.Analog.Interfaces.PositivePin p annotation (extent=[-110, -10; -90, 10]); 1588 Modelica.Electrical.Analog.Interfaces.NegativePin n annotation (extent=[90, -10; 110, 10]); 1589 Modelica.Electrical.Analog.Interfaces.Pin control 1590 "Control pin: control.v > level switch closed, otherwise switch open" 1591 annotation (extent=[-10, 90; 10, 110], rotation=90); 1607 protected 1608 Real s "Auxiliary variable"; 1609 constant Real unitVoltage(unit="V") = 1 annotation(Hide=true); 1610 constant Real unitCurrent(unit="A") = 1 annotation(Hide=true); 1592 1611 equation 1593 1612 control.i = 0; 1594 1613 0 = p.i + n.i; 1595 p.v - n.v = s*(if (control.v > level) then Ron else 1);1596 p.i = s*(if (control.v > level) then 1 else Goff);1614 p.v - n.v = (s*unitCurrent)*(if (control.v > level) then Ron else 1); 1615 p.i = (s*unitVoltage)*(if (control.v > level) then 1 else Goff); 1597 1616 end ControlledIdealClosingSwitch; 1598 1617 -
Modelica/branches/maintenance/2.2.2/Modelica/Mechanics/MultiBody/Examples/Loops/Utilities.mo
r645 r660 224 224 extends Modelica.Mechanics.Translational.Interfaces.Compliant; 225 225 parameter SI.Length L "Length of cylinder"; 226 parameter SI.Length d " diameter of cylinder";227 parameter Realk0=0.01;228 parameter Realk1=0.01;229 parameter Realk=7;226 parameter SI.Length d "Diameter of cylinder"; 227 parameter SIunits.Volume k0=0.01; 228 parameter SIunits.Volume k1=0.01; 229 parameter SIunits.HeatCapacity k=7; 230 230 constant Real pi=Modelica.Constants.pi; 231 231 constant Real PI=Modelica.Constants.pi; … … 296 296 extends Modelica.Mechanics.Translational.Interfaces.Compliant; 297 297 parameter SI.Length L "Length of cylinder"; 298 parameter SI. Length d "diameter of cylinder";299 parameter Realk0=0.01;300 parameter Realk1=0.01;301 parameter Realk=7;298 parameter SI.Diameter d "Diameter of cylinder"; 299 parameter SI.Volume k0=0.01; 300 parameter SI.Volume k1=0.01; 301 parameter SIunits.HeatCapacity k=7; 302 302 constant Real pi=Modelica.Constants.pi; 303 303 constant Real PI=Modelica.Constants.pi; -
Modelica/branches/maintenance/2.2.2/Modelica/Mechanics/MultiBody/Forces.mo
r572 r660 1565 1565 SI.Position r_rel_0[3] 1566 1566 "Position vector from frame_a to frame_b resolved in world frame"; 1567 SI.Positione_rel_0[3]1567 Real e_rel_0[3] 1568 1568 "Unit vector in direction from frame_a to frame_b, resolved in world frame"; 1569 1569 annotation ( … … 2262 2262 "Reflection of ambient light (= 0: light is completely absorbed)" 2263 2263 annotation (Dialog(tab="Animation", group="if animation = true", enable=animation)); 2264 input RealmassDiameter=max(0, (width - 2*coilWidth)*0.9)2264 input SIunits.Diameter massDiameter=max(0, (width - 2*coilWidth)*0.9) 2265 2265 " Diameter of mass point sphere" annotation (Dialog(tab="Animation", group= 2266 2266 "if animation = true and showMass = true", enable=animation and showMass)); … … 2356 2356 " Length of cylinder at frame_a side" 2357 2357 annotation (Dialog(tab="Animation", group="if animation = true", enable=animation)); 2358 input SI .Distancediameter_a=world.defaultForceWidth2358 input SIunits.Diameter diameter_a=world.defaultForceWidth 2359 2359 " Diameter of cylinder at frame_a side" 2360 2360 annotation (Dialog(tab="Animation", group="if animation = true", enable=animation)); 2361 input Realdiameter_b=0.6*diameter_a2361 input SIunits.Diameter diameter_b=0.6*diameter_a 2362 2362 " Diameter of cylinder at frame_b side" 2363 2363 annotation (Dialog(tab="Animation", group="if animation = true", enable=animation)); -
Modelica/branches/maintenance/2.2.2/Modelica/Mechanics/MultiBody/Visualizers.mo
r572 r660 1304 1304 T.Orientation R_rel=T.from_nxy(n_x, n_y); 1305 1305 T.Orientation R_lines=T.absoluteRotation(R.T, R_rel); 1306 Realr_abs[3]=r + T.resolve1(R.T, r_lines);1306 Modelica.SIunits.Position r_abs[3]=r + T.resolve1(R.T, r_lines); 1307 1307 Modelica.Mechanics.MultiBody.Visualizers.Advanced.Shape cylinders[n]( 1308 1308 each shapeType="cylinder", -
Modelica/branches/maintenance/2.2.2/Modelica/Mechanics/Rotational.mo
r659 r660 3210 3210 3211 3211 // Friction torque 3212 tau = if locked then sa else (if startForward then3212 tau = if locked then sa*unitTorque else (if startForward then 3213 3213 Modelica.Math.tempInterpol1(w, tau_pos, 2) else if startBackward then - 3214 3214 Modelica.Math.tempInterpol1(-w, tau_pos, 2) else if pre(mode) == Forward then … … 3411 3411 3412 3412 // friction torque 3413 tau = if locked then sa else if free then 0 else cgeo*fn*(if startForward then3413 tau = if locked then sa*unitTorque else if free then 0 else cgeo*fn*(if startForward then 3414 3414 Modelica.Math.tempInterpol1(w_rel, mue_pos, 2) else if 3415 3415 startBackward then -Modelica.Math.tempInterpol1(-w_rel, mue_pos, 2) else … … 3448 3448 Real mue0 "Friction coefficient for w=0 and sliding"; 3449 3449 Boolean free "true, if frictional element is not active"; 3450 Real sa "path parameter of tau = f(a_rel) Friction characteristic"; 3450 Real sa(unit="1") 3451 "path parameter of tau = f(a_rel) Friction characteristic"; 3451 3452 constant Real eps0=1.0e-4 "Relative hysteresis epsilon"; 3452 3453 SI.Torque tau0_max_low "lowest value for tau0_max"; … … 3629 3630 special code shall be generated) 3630 3631 */ 3631 startForward = pre(stuck) and (sa > tau0_max or pre(startForward) and sa >3632 tau0 or w_rel > w_small) or initial() and (w_rel > 0);3632 startForward = pre(stuck) and (sa > tau0_max/unitTorque or pre(startForward) and sa > 3633 tau0/unitTorque or w_rel > w_small) or initial() and (w_rel > 0); 3633 3634 locked = pre(stuck) and not startForward; 3634 3635 3635 3636 // acceleration and friction torque 3636 3637 a_rel = unitAngularAcceleration* (if locked then 0 else sa - tau0/unitTorque); 3637 tau = if locked then sa else (if free then 0 else cgeo*fn*3638 tau = if locked then sa*unitTorque else (if free then 0 else cgeo*fn* 3638 3639 Modelica.Math.tempInterpol1(w_rel, mue_pos, 2)); 3639 3640 … … 3852 3853 3853 3854 // friction torque 3854 tau = if locked then sa else if free then 0 else cgeo*fn*(if startForward then3855 tau = if locked then sa*unitTorque else if free then 0 else cgeo*fn*(if startForward then 3855 3856 Modelica.Math.tempInterpol1(w, mue_pos, 2) else if startBackward then 3856 3857 -Modelica.Math.tempInterpol1(-w, mue_pos, 2) else if pre(mode) == … … 4190 4191 4191 4192 // Determine rolling/stuck mode when w_rel = 0 4192 startForward = pre(mode) == Stuck and sa > tauLossMax or initial() and w_a4193 startForward = pre(mode) == Stuck and sa > tauLossMax/unitTorque or initial() and w_a 4193 4194 > 0; 4194 startBackward = pre(mode) == Stuck and sa < tauLossMin or initial() and w_a4195 startBackward = pre(mode) == Stuck and sa < tauLossMin/unitTorque or initial() and w_a 4195 4196 < 0; 4196 4197 locked = not (ideal or pre(mode) == Forward or startForward or pre(mode) … … 4201 4202 to simplify the following expression as mode == Stuck is assured in case 4202 4203 of startForward or startBackward */ 4203 tauLoss = if ideal then 0 else (if locked then sa else (if (startForward or4204 tauLoss = if ideal then 0 else (if locked then sa*unitTorque else (if (startForward or 4204 4205 pre(mode) == Forward) then tauLossMax else tauLossMin)); 4205 4206 -
Modelica/branches/maintenance/2.2.2/Modelica/Mechanics/Translational.mo
r659 r660 1878 1878 1879 1879 // Friction force 1880 f = if locked then sa else if free then 0 else1880 f = if locked then sa*unitForce else if free then 0 else 1881 1881 (if startForward then F_prop*v + F_Coulomb + 1882 1882 F_Stribeck else if startBackward then F_prop*v - F_Coulomb - F_Stribeck else
