Changeset 662
- Timestamp:
- 10/10/2007 03:38:19 PM (15 months ago)
- Location:
- Modelica/trunk/Modelica
- Files:
-
- 8 modified
-
Blocks/Discrete.mo (modified) (2 diffs)
-
Blocks/Math.mo (modified) (3 diffs)
-
Blocks/Sources.mo (modified) (2 diffs)
-
Electrical/Analog/Ideal.mo (modified) (12 diffs)
-
Mechanics/Rotational.mo (modified) (3 diffs)
-
Mechanics/Translational.mo (modified) (2 diffs)
-
SIunits.mo (modified) (6 diffs)
-
Thermal/FluidHeatFlow.mo (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
Modelica/trunk/Modelica/Blocks/Discrete.mo
r611 r662 105 105 protected 106 106 Real ySample; 107 RealtSample;107 Modelica.SIunits.Time tSample; 108 108 Real c; 109 109 annotation ( … … 470 470 </HTML> 471 471 ")); 472 Modelica.Blocks.Interfaces.RealInput u 473 "Connector with a Real input signal"annotation (extent=[-472 Modelica.Blocks.Interfaces.RealInput u "Connector with a Real input signal" 473 annotation (extent=[- 474 474 140, -20; -100, 20]); 475 475 Modelica.Blocks.Interfaces.RealOutput y -
Modelica/trunk/Modelica/Blocks/Math.mo
r559 r662 236 236 block To_rpm "Convert from radian per second to revolutions per minute" 237 237 extends Modelica.Blocks.Interfaces.PartialConversionBlock(u(unit="rad/s"), 238 y(unit="r ev/min"));238 y(unit="r/min")); 239 239 annotation (Icon(Text( 240 240 extent=[26,82; -98,50], … … 243 243 extent=[100,-42; -62,-74], 244 244 style(color=0), 245 string="r ev/min")), Documentation(info="<html>245 string="r/min")), Documentation(info="<html> 246 246 <p> 247 247 This block converts the input signal from radian per second to revolutions per minute and returns … … 255 255 block From_rpm "Convert from revolutions per minute to radian per second" 256 256 extends Modelica.Blocks.Interfaces.PartialConversionBlock(u(unit= 257 "r ev/min"), y(unit="rad/s"));257 "r/min"), y(unit="rad/s")); 258 258 annotation (Icon(Text( 259 259 extent=[50,84; -94,56], 260 260 style(color=0), 261 string="r ev/min"), Text(261 string="r/min"), Text( 262 262 extent=[94,-42; -26,-74], 263 263 style(color=0), -
Modelica/trunk/Modelica/Blocks/Sources.mo
r572 r662 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/trunk/Modelica/Electrical/Analog/Ideal.mo
r621 r662 178 178 Real s(final unit="1") 179 179 "Auxiliary variable: if on then current, if opened then voltage"; 180 constant Real unitVolt PerOhm(unit="V/Ohm") = 1annotation(Hide=true);181 constant Real unit AmperePerSiemens(unit="A/S") = 1annotation(Hide=true);180 constant Real unitVoltage(unit="V") = 1 annotation(Hide=true); 181 constant Real unitCurrent(unit="A") = 1 annotation(Hide=true); 182 182 183 183 equation 184 184 off = s < 0 or pre(off) and not fire; 185 v = (s*unit VoltPerOhm)*(if off then 1 else Ron) + Vknee;186 i = (s*unit AmperePerSiemens)*(if off then Goff else 1) + Goff*Vknee;185 v = (s*unitCurrent)*(if off then 1 else Ron) + Vknee; 186 i = (s*unitVoltage)*(if off then Goff else 1) + Goff*Vknee; 187 187 end IdealThyristor; 188 188 … … 320 320 Real s(final unit="1") 321 321 "Auxiliary variable: if on then current, if opened then voltage"; 322 constant Real unitVolt PerOhm(unit="V/Ohm") = 1annotation(Hide=true);323 constant Real unit AmperePerSiemens(unit="A/S") = 1annotation(Hide=true);322 constant Real unitVoltage(unit="V") = 1 annotation(Hide=true); 323 constant Real unitCurrent(unit="A") = 1 annotation(Hide=true); 324 324 equation 325 325 off = s < 0 or not fire; 326 v = (s*unit VoltPerOhm)*(if off then 1 else Ron) + Vknee;327 i = (s*unit AmperePerSiemens)*(if off then Goff else 1) + Goff*Vknee;326 v = (s*unitCurrent)*(if off then 1 else Ron) + Vknee; 327 i = (s*unitVoltage)*(if off then Goff else 1) + Goff*Vknee; 328 328 end IdealGTOThyristor; 329 329 … … 396 396 Real s1(final unit="1"); 397 397 Real s2(final unit="1") "Auxiliary variables"; 398 constant Real unitVolt PerOhm(unit="V/Ohm") = 1annotation(Hide=true);399 constant Real unit AmperePerSiemens(unit="A/S") = 1annotation(Hide=true);398 constant Real unitVoltage(unit="V") = 1 annotation(Hide=true); 399 constant Real unitCurrent(unit="A") = 1 annotation(Hide=true); 400 400 401 401 equation 402 402 0 = p.i + n2.i + n1.i; 403 403 404 p.v - n1.v = (s1*unit VoltPerOhm)*(if (control) then 1 else Ron);405 n1.i = -(s1*unit AmperePerSiemens)*(if (control) then Goff else 1);406 p.v - n2.v = (s2*unit VoltPerOhm)*(if (control) then Ron else 1);407 n2.i = -(s2*unit AmperePerSiemens)*(if (control) then 1 else Goff);404 p.v - n1.v = (s1*unitCurrent)*(if (control) then 1 else Ron); 405 n1.i = -(s1*unitVoltage)*(if (control) then Goff else 1); 406 p.v - n2.v = (s2*unitCurrent)*(if (control) then Ron else 1); 407 n2.i = -(s2*unitVoltage)*(if (control) then 1 else Goff); 408 408 end IdealCommutingSwitch; 409 409 … … 489 489 Real s3(final unit="1"); 490 490 Real s4(final unit="1") "Auxiliary variables"; 491 constant Real unitVoltPerOhm(unit="V/Ohm") = 1 annotation(Hide=true); 492 constant Real unitAmperePerSiemens(unit="A/S") = 1 annotation(Hide=true); 493 constant Real unitAmpere(unit="A") = 1 annotation(Hide=true); 491 constant Real unitVoltage(unit="V") = 1 annotation(Hide=true); 492 constant Real unitCurrent(unit="A") = 1 annotation(Hide=true); 494 493 equation 495 p1.v - n1.v = (s1*unit VoltPerOhm)*(if (control) then 1 else Ron);496 p2.v - n2.v = (s2*unit VoltPerOhm)*(if (control) then 1 else Ron);497 p1.v - n2.v = (s3*unit VoltPerOhm)*(if (control) then Ron else 1);498 p2.v - n1.v = (s4*unit VoltPerOhm)*(if (control) then Ron else 1);499 500 p1.i = if control then s1*unit AmperePerSiemens*Goff + s3*unitAmpere else s1*unitAmpere + s3*unitAmperePerSiemens*Goff;501 p2.i = if control then s2*unit AmperePerSiemens*Goff + s4*unitAmpere else s2*unitAmpere + s4*unitAmperePerSiemens*Goff;502 n1.i = if control then -s1*unit AmperePerSiemens*Goff - s4*unitAmpere else -s1*unitAmpere - s4*unitAmperePerSiemens*Goff;503 n2.i = if control then -s2*unit AmperePerSiemens*Goff - s3*unitAmpere else -s2*unitAmpere - s3*unitAmperePerSiemens*Goff;494 p1.v - n1.v = (s1*unitCurrent)*(if (control) then 1 else Ron); 495 p2.v - n2.v = (s2*unitCurrent)*(if (control) then 1 else Ron); 496 p1.v - n2.v = (s3*unitCurrent)*(if (control) then Ron else 1); 497 p2.v - n1.v = (s4*unitCurrent)*(if (control) then Ron else 1); 498 499 p1.i = if control then s1*unitVoltage*Goff + s3*unitCurrent else s1*unitCurrent + s3*unitVoltage*Goff; 500 p2.i = if control then s2*unitVoltage*Goff + s4*unitCurrent else s2*unitCurrent + s4*unitVoltage*Goff; 501 n1.i = if control then -s1*unitVoltage*Goff - s4*unitCurrent else -s1*unitCurrent - s4*unitVoltage*Goff; 502 n2.i = if control then -s2*unitVoltage*Goff - s3*unitCurrent else -s2*unitCurrent - s3*unitVoltage*Goff; 504 503 end IdealIntermediateSwitch; 505 504 … … 574 573 Real s1(final unit="1"); 575 574 Real s2(final unit="1") "Auxiliary variables"; 576 constant Real unitVolt PerOhm(unit="V/Ohm") = 1annotation(Hide=true);577 constant Real unit AmperePerSiemens(unit="A/S") = 1annotation(Hide=true);575 constant Real unitVoltage(unit="V") = 1 annotation(Hide=true); 576 constant Real unitCurrent(unit="A") = 1 annotation(Hide=true); 578 577 equation 579 578 control.i = 0; 580 579 0 = p.i + n2.i + n1.i; 581 580 582 p.v - n1.v = (s1*unit VoltPerOhm)*(if (control.v > level) then 1 else Ron);583 n1.i = -(s1*unit AmperePerSiemens)*(if (control.v > level) then Goff else 1);584 p.v - n2.v = (s2*unit VoltPerOhm)*(if (control.v > level) then Ron else 1);585 n2.i = -(s2*unit AmperePerSiemens)*(if (control.v > level) then 1 else Goff);581 p.v - n1.v = (s1*unitCurrent)*(if (control.v > level) then 1 else Ron); 582 n1.i = -(s1*unitVoltage)*(if (control.v > level) then Goff else 1); 583 p.v - n2.v = (s2*unitCurrent)*(if (control.v > level) then Ron else 1); 584 n2.i = -(s2*unitVoltage)*(if (control.v > level) then 1 else Goff); 586 585 end ControlledIdealCommutingSwitch; 587 586 … … 671 670 Real s3(final unit="1"); 672 671 Real s4(final unit="1") "Auxiliary variables"; 673 constant Real unitVoltPerOhm(unit="V/Ohm") = 1 annotation(Hide=true); 674 constant Real unitAmperePerSiemens(unit="A/S") = 1 annotation(Hide=true); 675 constant Real unitAmpere(unit="A") = 1 annotation(Hide=true); 672 constant Real unitVoltage(unit="V") = 1 annotation(Hide=true); 673 constant Real unitCurrent(unit="A") = 1 annotation(Hide=true); 676 674 equation 677 675 control.i = 0; 678 676 679 p1.v - n1.v = (s1*unit VoltPerOhm)*(if (control.v > level) then 1 else Ron);680 p2.v - n2.v = (s2*unit VoltPerOhm)*(if (control.v > level) then 1 else Ron);681 p1.v - n2.v = (s3*unit VoltPerOhm)*(if (control.v > level) then Ron else 1);682 p2.v - n1.v = (s4*unit VoltPerOhm)*(if (control.v > level) then Ron else 1);683 684 p1.i = if control.v > level then s1*unit AmperePerSiemens*Goff + s3*unitAmpere else s1*unitAmpere + s3*unitAmperePerSiemens*Goff;685 p2.i = if control.v > level then s2*unit AmperePerSiemens*Goff + s4*unitAmpere else s2*unitAmpere + s4*unitAmperePerSiemens*Goff;686 n1.i = if control.v > level then -s1*unit AmperePerSiemens*Goff - s4*unitAmpere else -s1*unitAmpere - s4*unitAmperePerSiemens*Goff;687 n2.i = if control.v > level then -s2*unit AmperePerSiemens*Goff - s3*unitAmpere else -s2*unitAmpere - s3*unitAmperePerSiemens*Goff;677 p1.v - n1.v = (s1*unitCurrent)*(if (control.v > level) then 1 else Ron); 678 p2.v - n2.v = (s2*unitCurrent)*(if (control.v > level) then 1 else Ron); 679 p1.v - n2.v = (s3*unitCurrent)*(if (control.v > level) then Ron else 1); 680 p2.v - n1.v = (s4*unitCurrent)*(if (control.v > level) then Ron else 1); 681 682 p1.i = if control.v > level then s1*unitVoltage*Goff + s3*unitCurrent else s1*unitCurrent + s3*unitVoltage*Goff; 683 p2.i = if control.v > level then s2*unitVoltage*Goff + s4*unitCurrent else s2*unitCurrent + s4*unitVoltage*Goff; 684 n1.i = if control.v > level then -s1*unitVoltage*Goff - s4*unitCurrent else -s1*unitCurrent - s4*unitVoltage*Goff; 685 n2.i = if control.v > level then -s2*unitVoltage*Goff - s3*unitCurrent else -s2*unitCurrent - s3*unitVoltage*Goff; 688 686 end ControlledIdealIntermediateSwitch; 689 687 … … 969 967 protected 970 968 Real s(final unit="1") "Auxiliary variable"; 971 constant Real unitVolt (unit="V") = 1annotation(Hide=true);969 constant Real unitVoltage(unit="V") = 1 annotation(Hide=true); 972 970 equation 973 971 in_p.i = 0; … … 976 974 VMin.i = 0; 977 975 vin = in_p.v - in_n.v; 978 in_p.v - in_n.v = if (s*unitVolt < -1) then s*unitVolt + 1 else if (s*unitVolt > 1) then s*unitVolt - 1 else 0;979 out.v = if (s*unitVolt < -1) then VMin.v else if (s*unitVolt > 1)then VMax.v else (VMax.v - VMin.v)*s/2 + (VMax.v + VMin.v)/2;976 in_p.v - in_n.v = unitVoltage*(if s < -1 then s + 1 else if s > 1 then s - 1 else 0); 977 out.v = if s < -1 then VMin.v else if s > 1 then VMax.v else (VMax.v - VMin.v)*s/2 + (VMax.v + VMin.v)/2; 980 978 end IdealOpAmpLimited; 981 979 … … 1393 1391 Line(points=[40, 20; 40, 0]))); 1394 1392 protected 1395 Real s(final unit="1") "Auxiliary variable";1396 constant Real unitVoltPerOhm(unit="V/Ohm") = 1annotation(Hide=true);1397 constant Real unitAmperePerSiemens(unit="A/S") = 1annotation(Hide=true);1393 Real s(final unit="1") "Auxiliary variable"; 1394 constant Real unitVoltage(unit="V") = 1 annotation(Hide=true); 1395 constant Real unitCurrent(unit="A") = 1 annotation(Hide=true); 1398 1396 equation 1399 v = (s*unit VoltPerOhm)*(if control then 1 else Ron);1400 i = (s*unit AmperePerSiemens)*(if control then Goff else 1);1397 v = (s*unitCurrent)*(if control then 1 else Ron); 1398 i = (s*unitVoltage)*(if control then Goff else 1); 1401 1399 end IdealOpeningSwitch; 1402 1400 … … 1466 1464 protected 1467 1465 Real s(final unit="1") "Auxiliary variable"; 1468 constant Real unitVolt PerOhm(unit="V/Ohm") = 1annotation(Hide=true);1469 constant Real unit AmperePerSiemens(unit="A/S") = 1annotation(Hide=true);1466 constant Real unitVoltage(unit="V") = 1 annotation(Hide=true); 1467 constant Real unitCurrent(unit="A") = 1 annotation(Hide=true); 1470 1468 equation 1471 v = (s*unit VoltPerOhm)*(if control then Ron else 1);1472 i = (s*unit AmperePerSiemens)*(if control then 1 else Goff);1469 v = (s*unitCurrent)*(if control then Ron else 1); 1470 i = (s*unitVoltage)*(if control then 1 else Goff); 1473 1471 end IdealClosingSwitch; 1474 1472 … … 1543 1541 protected 1544 1542 Real s(final unit="1") "Auxiliary variable"; 1545 constant Real unitVolt PerOhm(unit="V/Ohm") = 1annotation(Hide=true);1546 constant Real unit AmperePerSiemens(unit="A/S") = 1annotation(Hide=true);1543 constant Real unitVoltage(unit="V") = 1 annotation(Hide=true); 1544 constant Real unitCurrent(unit="A") = 1 annotation(Hide=true); 1547 1545 equation 1548 1546 control.i = 0; 1549 1547 0 = p.i + n.i; 1550 p.v - n.v = (s*unit VoltPerOhm)*(if (control.v > level) then 1 else Ron);1551 p.i = (s*unit AmperePerSiemens)*(if (control.v > level) then Goff else 1);1548 p.v - n.v = (s*unitCurrent)*(if (control.v > level) then 1 else Ron); 1549 p.i = (s*unitVoltage)*(if (control.v > level) then Goff else 1); 1552 1550 end ControlledIdealOpeningSwitch; 1553 1551 … … 1623 1621 protected 1624 1622 Real s(final unit="1") "Auxiliary variable"; 1625 constant Real unitVolt PerOhm(unit="V/Ohm") = 1annotation(Hide=true);1626 constant Real unit AmperePerSiemens(unit="A/S") = 1annotation(Hide=true);1623 constant Real unitVoltage(unit="V") = 1 annotation(Hide=true); 1624 constant Real unitCurrent(unit="A") = 1 annotation(Hide=true); 1627 1625 equation 1628 1626 control.i = 0; 1629 1627 0 = p.i + n.i; 1630 p.v - n.v = (s*unit VoltPerOhm)*(if (control.v > level) then Ron else 1);1631 p.i = (s*unit AmperePerSiemens)*(if (control.v > level) then 1 else Goff);1628 p.v - n.v = (s*unitCurrent)*(if (control.v > level) then Ron else 1); 1629 p.i = (s*unitVoltage)*(if (control.v > level) then 1 else Goff); 1632 1630 end ControlledIdealClosingSwitch; 1633 1631 -
Modelica/trunk/Modelica/Mechanics/Rotational.mo
r643 r662 1757 1757 equation 1758 1758 tau_support = -adapter.flange_b.tau; 1759 connect(adapter.flange_a, bearing) annotation (points=[-6.12323e-016,-70; 1759 connect(adapter.flange_a, bearing) annotation (points=[-6.12323e-016,-70; 1760 1760 0,-70; 0,-100], style(color=0)); 1761 1761 annotation (Documentation(info="<html> … … 4574 4574 SI.Torque tau_support "Support torque"; 4575 4575 protected 4576 parameter Realw_crit=2*Modelica.Constants.pi*f_crit4577 " critical frequency in [1/s]";4576 parameter Modelica.SIunits.AngularFrequency w_crit=2*Modelica.Constants.pi*f_crit 4577 "Critical frequency"; 4578 4578 constant Real af=1.3617 "s coefficient of Bessel filter"; 4579 4579 constant Real bf=0.6180 "s*s coefficient of Bessel filter"; … … 4707 4707 SI.Torque tau_support "Support torque"; 4708 4708 protected 4709 parameter Real w_crit=2*Constants.pi*f_crit "critical frequency in [1/s]"; 4709 parameter Modelica.SIunits.AngularFrequency w_crit=2*Modelica.Constants.pi*f_crit 4710 "Critical frequency"; 4710 4711 public 4711 4712 Interfaces.Flange_b flange_b annotation (extent=[90, -10; 110, 10]); -
Modelica/trunk/Modelica/Mechanics/Translational.mo
r643 r662 2272 2272 output SI.Acceleration a "absolute acceleration of flange_b"; 2273 2273 protected 2274 parameter Realw_crit=2*Modelica.Constants.pi*f_crit2275 " critical frequency in [1/s]";2274 parameter Modelica.SIunits.AngularFrequency w_crit=2*Modelica.Constants.pi*f_crit 2275 "Critical frequency"; 2276 2276 constant Real af=1.3617 "s coefficient of Bessel filter"; 2277 2277 constant Real bf=0.6180 "s*s coefficient of Bessel filter"; … … 2421 2421 color=10, fillColor=10)))); 2422 2422 protected 2423 parameter Realw_crit=2*Modelica.Constants.pi*f_crit2424 " critical frequency in [1/s]";2423 parameter Modelica.SIunits.AngularFrequency w_crit=2*Modelica.Constants.pi*f_crit 2424 "Critical frequency"; 2425 2425 SI.Acceleration a 2426 2426 "absolute acceleration of flange_b if exact=false (a=0, if exact=true)"; -
Modelica/trunk/Modelica/SIunits.mo
r597 r662 390 390 type Angle_deg = Real (final quantity="Angle", final unit="deg"); 391 391 type AngularVelocity_rpm = Real (final quantity="AngularVelocity", final unit 392 = "r ev/min");392 = "r/min"); 393 393 type Velocity_kmh = Real (final quantity="Velocity", final unit="km/h"); 394 394 type Time_day = Real (final quantity="Time", final unit="d"); … … 422 422 "), Icon(Text( 423 423 extent=[-66, -13; 52, -67], 424 string="[r ev/min]",424 string="[r/min]", 425 425 style(color=0)))); 426 426 end NonSIunits; … … 556 556 extent=[100, -20; 20, -100], 557 557 style(color=0), 558 string="r ev/min")));558 string="r/min"))); 559 559 algorithm 560 560 rpm := (30/Modelica.Constants.pi)*rs; … … 569 569 extent=[-20, 100; -100, 20], 570 570 style(color=0), 571 string="r ev/min"), Text(571 string="r/min"), Text( 572 572 extent=[100, -20; 20, -100], 573 573 style(color=0), … … 850 850 final quantity="AngularVelocity", 851 851 final unit="rad/s", 852 displayUnit="r ev/min");852 displayUnit="r/min"); 853 853 type AngularAcceleration = Real (final quantity="AngularAcceleration", final unit 854 854 = "rad/s2"); … … 860 860 type Frequency = Real (final quantity="Frequency", final unit="Hz"); 861 861 type AngularFrequency = Real (final quantity="AngularFrequency", final unit= 862 " s-1");862 "rad/s"); 863 863 type Wavelength = Real (final quantity="Wavelength", final unit="m"); 864 864 type Wavelenght = Wavelength; -
Modelica/trunk/Modelica/Thermal/FluidHeatFlow.mo
r655 r662 1 1 within Modelica.Thermal; 2 2 3 3 4 package FluidHeatFlow … … 1395 1396 "Part of friction losses fed to medium"; 1396 1397 protected 1398 constant Modelica.SIunits.VolumeFlowRate unitVolumeFlowRate = 1; 1397 1399 constant Real small = Modelica.Constants.small; 1398 constant Modelica.SIunits.VolumeFlowRate smallVolumeFlowRate = eps ;1400 constant Modelica.SIunits.VolumeFlowRate smallVolumeFlowRate = eps*unitVolumeFlowRate; 1399 1401 constant Real eps = Modelica.Constants.eps; 1400 1402 Real yLim = max(min(y,y1),0) "Limited valve opening";
