Changeset 893
- Timestamp:
- 12/08/2007 08:37:11 AM (13 months ago)
- Files:
-
- 1 modified
-
Modelica/trunk/ObsoleteModelica3.mo (modified) (74 diffs)
Legend:
- Unmodified
- Added
- Removed
-
Modelica/trunk/ObsoleteModelica3.mo
r869 r893 1 1 within ; 2 package ObsoleteModelica3 3 "Library that contains components from Modelica Standard Library 2.2.2 that have been removed from version 3.0" 4 2 package ObsoleteModelica3 3 "Library that contains components from Modelica Standard Library 2.2.2 that have been removed from version 3.0" 4 5 5 annotation (uses(Modelica(version="3.0"))); 6 7 package Blocks 8 package Interfaces 9 package Adaptors 10 model AdaptorReal 11 "Completely obsolete adaptor between 'old' and 'new' Real signal connectors (only for backward compatibility)" 12 extends ObsoleteModelica3.Icons.Obsolete Block;13 Modelica.Blocks.Interfaces.RealSignal newReal 6 7 package Blocks 8 package Interfaces 9 package Adaptors 10 model AdaptorReal 11 "Completely obsolete adaptor between 'old' and 'new' Real signal connectors (only for backward compatibility)" 12 extends ObsoleteModelica3.Icons.ObsoleteModel; 13 Modelica.Blocks.Interfaces.RealSignal newReal 14 14 "Connector of Modelica version 2.1" annotation ( Hide=true, 15 15 Placement(transformation(extent={{100,-10},{120,10}}, rotation=0))); 16 16 RealPort oldReal(final n=1) "Connector of Modelica version 1.6" annotation (Placement( 17 17 transformation(extent={{-120,-10},{-100,10}}, rotation=0))); 18 18 19 19 annotation(structurallyIncomplete, 20 20 Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100}, … … 49 49 </html> 50 50 ")); 51 52 protected 53 connector RealPort "Connector with signals of type Real" 51 52 protected 53 connector RealPort "Connector with signals of type Real" 54 54 parameter Integer n=1 "Dimension of signal vector" annotation (Hide=true); 55 55 replaceable type SignalType = Real "type of signal"; 56 56 SignalType signal[n] "Real signals" annotation (Hide=true); 57 57 58 58 end RealPort; 59 equation 59 equation 60 60 newReal = oldReal.signal[1]; 61 61 end AdaptorReal; 62 63 model AdaptorBoolean 64 "Completely obsolete adaptor between 'old' and 'new' Boolean signal connectors (only for backward compatibility)" 65 extends ObsoleteModelica3.Icons.Obsolete Block;66 Modelica.Blocks.Interfaces.BooleanSignal newBoolean 62 63 model AdaptorBoolean 64 "Completely obsolete adaptor between 'old' and 'new' Boolean signal connectors (only for backward compatibility)" 65 extends ObsoleteModelica3.Icons.ObsoleteModel; 66 Modelica.Blocks.Interfaces.BooleanSignal newBoolean 67 67 "Connector of Modelica version 2.1" 68 68 annotation ( Hide=true, Placement( … … 70 70 BooleanPort oldBoolean(final n=1) "Connector of Modelica version 1.6" annotation (Placement( 71 71 transformation(extent={{-120,-10},{-100,10}}, rotation=0))); 72 72 73 73 annotation(structurallyIncomplete, 74 74 Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100}, … … 101 101 </html> 102 102 ")); 103 104 protected 105 connector BooleanPort "Connector with signals of type Boolean" 103 104 protected 105 connector BooleanPort "Connector with signals of type Boolean" 106 106 parameter Integer n=1 "Dimension of signal vector" annotation (Hide=true); 107 107 replaceable type SignalType = Boolean "type of signal"; 108 108 SignalType signal[n] "Boolean signals" annotation (Hide=true); 109 109 110 110 end BooleanPort; 111 equation 112 111 equation 112 113 113 newBoolean = oldBoolean.signal[1]; 114 114 115 115 end AdaptorBoolean; 116 117 model AdaptorInteger 118 "Completely obsolete adaptor between 'old' and 'new' Integer signal connectors (only for backward compatibility)" 119 extends ObsoleteModelica3.Icons.Obsolete Block;120 Modelica.Blocks.Interfaces.IntegerSignal newInteger 116 117 model AdaptorInteger 118 "Completely obsolete adaptor between 'old' and 'new' Integer signal connectors (only for backward compatibility)" 119 extends ObsoleteModelica3.Icons.ObsoleteModel; 120 Modelica.Blocks.Interfaces.IntegerSignal newInteger 121 121 "Connector of Modelica version 2.1" 122 122 annotation ( Hide=true, Placement( … … 124 124 IntegerPort oldInteger(final n=1) "Connector of Modelica version 1.6" annotation (Placement( 125 125 transformation(extent={{-120,-10},{-100,10}}, rotation=0))); 126 126 127 127 annotation(structurallyIncomplete, 128 128 Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100}, … … 155 155 </html> 156 156 ")); 157 158 protected 159 connector IntegerPort "Connector with signals of type Integer" 157 158 protected 159 connector IntegerPort "Connector with signals of type Integer" 160 160 parameter Integer n=1 "Dimension of signal vector" annotation (Hide=true); 161 161 replaceable type SignalType = Integer "type of signal"; 162 162 SignalType signal[n] "Integer signals" annotation (Hide=true); 163 163 164 164 end IntegerPort; 165 equation 166 165 equation 166 167 167 newInteger = oldInteger.signal[1]; 168 168 169 169 end AdaptorInteger; 170 170 end Adaptors; 171 171 end Interfaces; 172 173 package Math 174 package UnitConversions 175 block ConvertAllUnits "Convert signal to a signal with different unit" 172 173 package Math 174 package UnitConversions 175 block ConvertAllUnits "Convert signal to a signal with different unit" 176 176 replaceable block ConversionBlock = 177 Modelica.Blocks.Interfaces.PartialConversionBlock 177 Modelica.Blocks.Interfaces.PartialConversionBlock 178 178 "Conversion block" 179 179 annotation (choicesAllMatching=true, Documentation(info="<html> … … 184 184 </html>")); 185 185 extends ConversionBlock; 186 extends ObsoleteModelica3.Icons.Obsolete Block;187 186 extends ObsoleteModelica3.Icons.ObsoleteModel; 187 188 188 annotation ( 189 189 defaultComponentName="convert", … … 214 214 end ConvertAllUnits; 215 215 end UnitConversions; 216 217 block TwoInputs 218 "Change causality of input signals by defining that two input signals are identical (e.g. for inverse models)" 216 217 block TwoInputs 218 "Change causality of input signals by defining that two input signals are identical (e.g. for inverse models)" 219 219 extends Modelica.Blocks.Interfaces.BlockIcon; 220 extends ObsoleteModelica3.Icons.Obsolete Block;220 extends ObsoleteModelica3.Icons.ObsoleteModel; 221 221 annotation(structurallyIncomplete, 222 222 Window( … … 239 239 lineColor={0,0,127}, 240 240 textString="=")})); 241 Modelica.Blocks.Interfaces.RealInput u1 241 Modelica.Blocks.Interfaces.RealInput u1 242 242 "Connector of first Real input signal" 243 243 annotation ( layer="icon", 244 244 Placement(transformation(extent={{-139.742,-19.0044},{-100,20}}, 245 245 rotation=0))); 246 Modelica.Blocks.Interfaces.RealInput u2 246 Modelica.Blocks.Interfaces.RealInput u2 247 247 "Connector of second Real input signal (u1=u2)" 248 248 annotation ( … … 251 251 extent={{-20,-20},{20,20}}, 252 252 rotation=180))); 253 equation 253 equation 254 254 u1 = u2; 255 255 end TwoInputs; 256 257 block TwoOutputs 258 "Change causality of output signals by defining that two output signals are identical (e.g. for inverse models)" 256 257 block TwoOutputs 258 "Change causality of output signals by defining that two output signals are identical (e.g. for inverse models)" 259 259 extends Modelica.Blocks.Interfaces.BlockIcon; 260 extends ObsoleteModelica3.Icons.Obsolete Block;260 extends ObsoleteModelica3.Icons.ObsoleteModel; 261 261 annotation(structurallyIncomplete, 262 262 Window( … … 280 280 lineColor={0,0,127}, 281 281 textString="=")})); 282 output Modelica.Blocks.Interfaces.RealOutput y1 282 output Modelica.Blocks.Interfaces.RealOutput y1 283 283 "Connector of first Real output signal" 284 284 annotation (Placement(transformation(extent={{100,-10},{120,10}}, 285 285 rotation=0))); 286 output Modelica.Blocks.Interfaces.RealOutput y2 286 output Modelica.Blocks.Interfaces.RealOutput y2 287 287 "Connector of second Real output signal (y1=y2)" 288 288 annotation (Placement( … … 291 291 extent={{-10.0005,-10},{10.0005,10}}, 292 292 rotation=180))); 293 equation 293 equation 294 294 y1 = y2; 295 295 end TwoOutputs; 296 296 end Math; 297 297 298 298 end Blocks; 299 300 package Icons 301 partial block ObsoleteBlock "Icon for an obsolete block" 302 299 300 package Electrical 301 package Analog 302 package Basic 303 model HeatingResistor "Temperature dependent electrical resistor" 304 extends Modelica.Electrical.Analog.Interfaces.OnePort; 305 extends ObsoleteModelica3.Icons.ObsoleteModel; 306 307 parameter Modelica.SIunits.Resistance R_ref=1 308 "Resistance at temperature T_ref"; 309 parameter Modelica.SIunits.Temperature T_ref=300 310 "Reference temperature"; 311 parameter Real alpha(unit="1/K") = 0 312 "Temperature coefficient of resistance"; 313 314 Modelica.SIunits.Resistance R 315 "Resistance = R_ref*(1 + alpha*(heatPort.T - T_ref));"; 316 317 annotation ( 318 Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-100, 319 -100},{100,100}}), graphics={ 320 Line(points={{-110,20},{-85,20}}, color={160,160,164}), 321 Polygon( 322 points={{-95,23},{-85,20},{-95,17},{-95,23}}, 323 lineColor={160,160,164}, 324 fillColor={160,160,164}, 325 fillPattern=FillPattern.Solid), 326 Line(points={{90,20},{115,20}}, color={160,160,164}), 327 Line(points={{-125,0},{-115,0}}, color={160,160,164}), 328 Line(points={{-120,-5},{-120,5}}, color={160,160,164}), 329 Text( 330 extent={{-110,25},{-90,45}}, 331 lineColor={160,160,164}, 332 textString= 333 "i"), 334 Polygon( 335 points={{105,23},{115,20},{105,17},{105,23}}, 336 lineColor={160,160,164}, 337 fillColor={160,160,164}, 338 fillPattern=FillPattern.Solid), 339 Line(points={{115,0},{125,0}}, color={160,160,164}), 340 Text( 341 extent={{90,45},{110,25}}, 342 lineColor={160,160,164}, 343 textString= 344 "i"), 345 Rectangle(extent={{-70,30},{70,-30}}), 346 Line(points={{-96,0},{-70,0}}), 347 Line(points={{70,0},{96,0}}), 348 Line(points={{0,-30},{0,-90}}, color={191,0,0}), 349 Line(points={{-52,-50},{48,50}}, color={0,0,255}), 350 Polygon( 351 points={{40,52},{50,42},{54,56},{40,52}}, 352 lineColor={0,0,255}, 353 fillColor={0,0,255}, 354 fillPattern=FillPattern.Solid)}), 355 Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100}, 356 {100,100}}), graphics={ 357 Text(extent={{-142,60},{143,118}}, textString= 358 "%name"), 359 Line(points={{-90,0},{-70,0}}), 360 Line(points={{70,0},{90,0}}), 361 Rectangle( 362 extent={{-70,30},{70,-30}}, 363 lineColor={0,0,255}, 364 fillColor={255,255,255}, 365 fillPattern=FillPattern.Solid), 366 Line(points={{0,-30},{0,-91}}, color={191,0,0}), 367 Line(points={{-52,-50},{48,50}}, color={0,0,255}), 368 Polygon( 369 points={{40,52},{50,42},{54,56},{40,52}}, 370 lineColor={0,0,255}, 371 fillColor={0,0,255}, 372 fillPattern=FillPattern.Solid)}), 373 Documentation(info="<HTML> 374 <p>This is a model for an electrical resistor where the generated heat 375 is dissipated to the environment via connector <b>heatPort</b> and where 376 the resistance R is temperature dependent according to the following 377 equation:</p> 378 <pre> R = R_ref*(1 + alpha*(heatPort.T - T_ref)) 379 </pre> 380 <p><b>alpha</b> is the <b>temperature coefficient of resistance</b>, which 381 is often abbreviated as <b>TCR</b>. In resistor catalogues, it is usually 382 defined as <b>X [ppm/K]</b> (parts per million, similarly to per centage) 383 meaning <b>X*1.e-6 [1/K]</b>. Resistors are available for 1 .. 7000 ppm/K, 384 i.e., alpha = 1e-6 .. 7e-3 1/K;</p> 385 <p>When connector <b>heatPort</b> is <b>not</b> connected, the temperature 386 dependent behaviour is switched off by setting heatPort.T = T_ref. 387 Additionally, the equation <tt>heatPort.Q_flow = 0</tt> is implicitly present 388 due to a special rule in Modelica that flow variables of not connected 389 connectors are set to zero.</p> 390 </HTML> 391 ", revisions= 392 "<html> 393 <ul> 394 <li><i> </i> 395 </li> 396 <li><i> 2002 </i> 397 by Anton Haumer<br> initially implemented<br> 398 </li> 399 </ul> 400 </html>"), uses(Modelica(version="2.2.1"))); 401 Modelica.Thermal.HeatTransfer.Interfaces.HeatPort_a heatPort annotation (Placement( 402 transformation( 403 origin={0,-100}, 404 extent={{10,-10},{-10,10}}, 405 rotation=270))); 406 equation 407 v = R*i; 408 409 if cardinality(heatPort) > 0 then 410 R = R_ref*(1 + alpha*(heatPort.T - T_ref)); 411 heatPort.Q_flow = -v*i; 412 else 413 /* heatPort is not connected resulting in the 414 implicit equation 'heatPort.Q_flow = 0' 415 */ 416 R = R_ref; 417 heatPort.T = T_ref; 418 end if; 419 end HeatingResistor; 420 end Basic; 421 end Analog; 422 end Electrical; 423 424 package Icons 425 partial model ObsoleteModel "Icon for an obsolete model" 426 303 427 annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100, 304 428 -100},{100,100}}), graphics={Rectangle( 305 extent={{-102,102},{102,-102}}, 306 lineColor={255,0,0}, 307 pattern=LinePattern.Dash, 429 extent={{-102,102},{102,-102}}, 430 lineColor={255,0,0}, 431 pattern=LinePattern.Dash, 308 432 lineThickness=2)}), Documentation(info="<html> 309 433 <p> … … 318 442 <b> Copyright © 1999-2007, DLR Institute of Robotics and Mechatronics</b> 319 443 </html>")); 320 equation 321 322 end Obsolete Block;323 324 partial class Enumeration "Icon for an enumeration (emulated by a package)" 325 444 equation 445 446 end ObsoleteModel; 447 448 partial class Enumeration "Icon for an enumeration (emulated by a package)" 449 326 450 annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100, 327 451 -100},{100,100}}), graphics={ … … 346 470 end Enumeration; 347 471 end Icons; 348 349 package Mechanics 350 package MultiBody 351 package Interfaces 352 partial model PartialCutForceSensor 353 "Base model to measure the cut force and/or torque between two frames" 354 472 473 package Mechanics 474 package MultiBody 475 package Interfaces 476 partial model PartialCutForceSensor 477 "Base model to measure the cut force and/or torque between two frames" 478 355 479 extends Modelica.Icons.RotationalSensor; 356 extends ObsoleteModelica3.Icons.Obsolete Block;357 Modelica.Mechanics.MultiBody.Interfaces.Frame_a frame_a 480 extends ObsoleteModelica3.Icons.ObsoleteModel; 481 Modelica.Mechanics.MultiBody.Interfaces.Frame_a frame_a 358 482 "Coordinate system with one cut-force and cut-torque" annotation (Placement( 359 483 transformation(extent={{-116,-16},{-84,16}}, rotation=0))); 360 Modelica.Mechanics.MultiBody.Interfaces.Frame_b frame_b 484 Modelica.Mechanics.MultiBody.Interfaces.Frame_b frame_b 361 485 "Coordinate system with one cut-force and cut-torque" annotation (Placement( 362 486 transformation(extent={{84,-16},{116,16}}, rotation=0))); 363 Modelica.Mechanics.MultiBody.Interfaces.Frame_resolve frame_resolve 487 Modelica.Mechanics.MultiBody.Interfaces.Frame_resolve frame_resolve 364 488 "If connected, the output signals are resolved in this frame (cut-force/-torque are set to zero)" 365 489 annotation (Placement(transformation( … … 367 491 extent={{-16,-16},{16,16}}, 368 492 rotation=270))); 369 493 370 494 annotation ( 371 495 Window( … … 422 546 color={95,95,95}, 423 547 pattern=LinePattern.Dot)})); 424 425 protected 548 549 protected 426 550 outer Modelica.Mechanics.MultiBody.World world; 427 equation 551 equation 428 552 defineBranch(frame_a.R, frame_b.R); 429 553 assert(cardinality(frame_a) > 0, … … 431 555 assert(cardinality(frame_b) > 0, 432 556 "Connector frame_b of cut-force/-torque sensor object is not connected"); 433 557 434 558 // frame_a and frame_b are identical 435 559 frame_a.r_0 = frame_b.r_0; 436 560 frame_a.R = frame_b.R; 437 561 438 562 // force and torque balance 439 563 zeros(3) = frame_a.f + frame_b.f; 440 564 zeros(3) = frame_a.t + frame_b.t; 441 565 442 566 // deduce cut-force 443 567 if cardinality(frame_resolve) == 1 then … … 452 576 end PartialCutForceSensor; 453 577 end Interfaces; 454 455 package Types 578 579 package Types 456 580 type AngularVelocity_degs = Modelica.Icons.TypeReal(final quantity="AngularVelocity", final unit 457 581 = "deg/s") "Angular velocity type in deg/s"; 458 type AngularAcceleration_degs2 = Modelica.Icons.TypeReal (final 582 type AngularAcceleration_degs2 = Modelica.Icons.TypeReal (final 459 583 quantity = "AngularAcceleration", 460 584 final unit="deg/s2") "Angular acceleration type in deg/s^2"; 461 package Init 462 "Type, constants and menu choices to define initialization, as temporary solution until enumerations are available" 463 585 package Init 586 "Type, constants and menu choices to define initialization, as temporary solution until enumerations are available" 587 464 588 annotation (Documentation(info="<html> 465 589 466 590 </html>"), uses(Modelica(version="2.2.2"))); 467 591 extends ObsoleteModelica3.Icons.Enumeration; 468 592 469 593 constant Integer Free=1; 470 594 constant Integer PositionVelocity=2; … … 474 598 constant Integer VelocityAcceleration=6; 475 599 constant Integer PositionVelocityAcceleration=7; 476 477 type Temp 478 "Temporary type of Init with choices for menus (until enumerations are available)" 479 600 601 type Temp 602 "Temporary type of Init with choices for menus (until enumerations are available)" 603 480 604 extends Modelica.Icons.TypeInteger; 481 605 annotation (choices( 482 choice=Modelica.Mechanics.MultiBody.Types.Init.Free 606 choice=Modelica.Mechanics.MultiBody.Types.Init.Free 483 607 "free (no initialization)", 484 choice=Modelica.Mechanics.MultiBody.Types.Init.PositionVelocity 608 choice=Modelica.Mechanics.MultiBody.Types.Init.PositionVelocity 485 609 "initialize generalized position and velocity variables", 486 choice=Modelica.Mechanics.MultiBody.Types.Init.SteadyState 610 choice=Modelica.Mechanics.MultiBody.Types.Init.SteadyState 487 611 "initialize in steady state (velocity and acceleration are zero)", 488 choice=Modelica.Mechanics.MultiBody.Types.Init.Position 612 choice=Modelica.Mechanics.MultiBody.Types.Init.Position 489 613 "initialize only generalized position variable(s)", 490 choice=Modelica.Mechanics.MultiBody.Types.Init.Velocity 614 choice=Modelica.Mechanics.MultiBody.Types.Init.Velocity 491 615 "initialize only generalized velocity variable(s)", 492 choice=Modelica.Mechanics.MultiBody.Types.Init.VelocityAcceleration 616 choice=Modelica.Mechanics.MultiBody.Types.Init.VelocityAcceleration 493 617 "initialize generalized velocity and acceleration variables", 494 choice=Modelica.Mechanics.MultiBody.Types.Init.PositionVelocityAcceleration 618 choice=Modelica.Mechanics.MultiBody.Types.Init.PositionVelocityAcceleration 495 619 "initialize generalized position, velocity and acceleration variables"), 496 620 Documentation(info="<html> … … 522 646 523 647 </html>")); 524 648 525 649 end Temp; 526 650 end Init; 527 651 end Types; 528 529 package Sensors 530 model AbsoluteSensor 531 "Measure absolute kinematic quantities of a frame connector" 652 653 package Sensors 654 model AbsoluteSensor 655 "Measure absolute kinematic quantities of a frame connector" 532 656 import SI = Modelica.SIunits; 533 657 import Modelica.Mechanics.MultiBody.Frames; 534 658 import Modelica.Mechanics.MultiBody.Types; 535 extends Modelica.Mechanics.MultiBody.Interfaces.PartialAbsoluteSensor(final 659 extends Modelica.Mechanics.MultiBody.Interfaces.PartialAbsoluteSensor(final 536 660 n_out=3*((if get_r_abs then 1 else 0) + (if get_v_abs then 1 else 0) + ( 537 661 if get_a_abs then 1 else 0) + (if get_angles then 1 else 0) + (if 538 662 get_w_abs then 1 else 0) + (if get_z_abs then 1 else 0))); 539 extends ObsoleteModelica3.Icons.Obsolete Block;540 541 Modelica.Mechanics.MultiBody.Interfaces.Frame_resolve frame_resolve 663 extends ObsoleteModelica3.Icons.ObsoleteModel; 664 665 Modelica.Mechanics.MultiBody.Interfaces.Frame_resolve frame_resolve 542 666 "If connected, the output signals are resolved in this frame" 543 667 annotation (Placement(transformation( … … 545 669 extent={{-16,-16},{16,16}}, 546 670 rotation=270))); 547 parameter Boolean animation=true 671 parameter Boolean animation=true 548 672 "= true, if animation shall be enabled (show arrow)"; 549 parameter Boolean resolveInFrame_a=false 673 parameter Boolean resolveInFrame_a=false 550 674 "= true, if vectors are resolved in frame_a, otherwise in the world frame (if connector frame_resolve is connected, vectors are resolved in frame_resolve)"; 551 parameter Boolean get_r_abs=true 675 parameter Boolean get_r_abs=true 552 676 "= true, to measure the position vector from the origin of the world frame to the origin of frame_a in [m]"; 553 parameter Boolean get_v_abs=false 677 parameter Boolean get_v_abs=false 554 678 "= true, to measure the absolute velocity of the origin of frame_a in [m/s]"; 555 parameter Boolean get_a_abs=false 679 parameter Boolean get_a_abs=false 556 680 "= true, to measure the absolute acceleration of the origin of frame_a in [m/s^2]"; 557 parameter Boolean get_angles=false 681 parameter Boolean get_angles=false 558 682 "= true, to measure the 3 rotation angles to rotate the world frame into frame_a along the axes defined in 'sequence' below in [rad]";
