forked from modelica/ModelicaStandardLibrary
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ObsoleteModelica3.mo
3471 lines (3243 loc) · 159 KB
/
ObsoleteModelica3.mo
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
within ;
package ObsoleteModelica3
"Library that contains components from Modelica Standard Library 2.2.2 that have been removed from version 3.0"
package Blocks
"Library of basic input/output control blocks (continuous, discrete, logical, table blocks)"
package Interfaces
"Library of connectors and partial models for input/output blocks"
connector RealSignal = Real "Real port (both input/output possible)"
annotation (obsolete="Connector is not valid according to Modelica 3, since input/output prefixes are missing. When using this connector, it is not possible to check for balanced models.",
Documentation(info="<html>
<p>
Connector with one signal of type Real (no icon, no input/output prefix).
</p>
</html>"));
connector BooleanSignal = Boolean
"Boolean port (both input/output possible)"
annotation (obsolete="Connector is not valid according to Modelica 3, since input/output prefixes are missing. When using this connector, it is not possible to check for balanced models.",
Documentation(info="<html>
<p>
Connector with one signal of type Boolean (no icon, no input/output prefix).
</p>
</html>"));
connector IntegerSignal = Integer
"Integer port (both input/output possible)"
annotation (obsolete="Connector is not valid according to Modelica 3, since input/output prefixes are missing. When using this connector, it is not possible to check for balanced models.",
Documentation(info="<html>
<p>
Connector with one signal of type .
</p>
</html>"));
package Adaptors
"Obsolete package with components to send signals to a bus or receive signals from a bus (only for backward compatibility)"
model AdaptorReal
"Completely obsolete adaptor between 'old' and 'new' Real signal connectors (only for backward compatibility)"
extends ObsoleteModelica3.Icons.ObsoleteBlock;
ObsoleteModelica3.Blocks.Interfaces.RealSignal newReal
"Connector of Modelica version 2.1" annotation ( Hide=true,
Placement(transformation(extent={{100,-10},{120,10}})));
RealPort oldReal(final n=1) "Connector of Modelica version 1.6" annotation (Placement(
transformation(extent={{-120,-10},{-100,10}})));
protected
connector RealPort "Connector with signals of type Real"
parameter Integer n=1 "Dimension of signal vector" annotation (Hide=true);
replaceable type SignalType = Real "type of signal";
SignalType signal[n] "Real signals" annotation (Hide=true);
end RealPort;
equation
newReal = oldReal.signal[1];
annotation(defaultConnectionStructurallyInconsistent=true,
obsolete="Model is not balanced, so equation check will not work. This model is no longer needed",
Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100},
{100,100}}), graphics={
Rectangle(
extent={{-100,40},{100,-40}},
lineColor={0,0,255},
fillColor={255,255,255},
fillPattern=FillPattern.Solid),
Text(
extent={{-144,96},{144,46}},
textString=""),
Text(
extent={{-88,22},{88,-24}},
lineColor={0,0,255},
textString="adaptor"),
Text(
extent={{-216,-58},{36,-80}},
textString="port.signal")}),
Documentation(info="<html>
<p>
Completely obsolete adaptor between the Real signal connector
of version 1.6 and version ≥ 2.1 of the Modelica Standard Library.
This block is only provided for backward compatibility.
</p>
</html>"));
end AdaptorReal;
model AdaptorBoolean
"Completely obsolete adaptor between 'old' and 'new' Boolean signal connectors (only for backward compatibility)"
extends ObsoleteModelica3.Icons.ObsoleteBlock;
ObsoleteModelica3.Blocks.Interfaces.BooleanSignal newBoolean
"Connector of Modelica version 2.1"
annotation ( Hide=true, Placement(
transformation(extent={{100,-10},{120,10}})));
BooleanPort oldBoolean(final n=1) "Connector of Modelica version 1.6" annotation (Placement(
transformation(extent={{-120,-10},{-100,10}})));
protected
connector BooleanPort "Connector with signals of type Boolean"
parameter Integer n=1 "Dimension of signal vector" annotation (Hide=true);
replaceable type SignalType = Boolean "type of signal";
SignalType signal[n] "Boolean signals" annotation (Hide=true);
end BooleanPort;
equation
newBoolean = oldBoolean.signal[1];
annotation(defaultConnectionStructurallyInconsistent=true,
obsolete="Model is not balanced, so equation check will not work. This model is no longer needed",
Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100},
{100,100}}), graphics={
Rectangle(
extent={{-100,40},{100,-40}},
lineColor={255,0,255},
fillColor={255,255,255},
fillPattern=FillPattern.Solid),
Text(
extent={{-144,96},{144,46}},
textString=""),
Text(
extent={{-88,22},{88,-24}},
lineColor={255,0,255},
textString="adaptor"),
Text(
extent={{-216,-58},{36,-80}},
textString="port.signal")}),
Documentation(info="<html>
<p>
Completely obsolete adaptor between the Real signal connector
of version 1.6 and version ≥ 2.1 of the Modelica Standard Library.
This block is only provided for backward compatibility.
</p>
</html>"));
end AdaptorBoolean;
model AdaptorInteger
"Completely obsolete adaptor between 'old' and 'new' Integer signal connectors (only for backward compatibility)"
extends ObsoleteModelica3.Icons.ObsoleteBlock;
ObsoleteModelica3.Blocks.Interfaces.IntegerSignal newInteger
"Connector of Modelica version 2.1"
annotation ( Hide=true, Placement(
transformation(extent={{100,-10},{120,10}})));
IntegerPort oldInteger(final n=1) "Connector of Modelica version 1.6" annotation (Placement(
transformation(extent={{-120,-10},{-100,10}})));
protected
connector IntegerPort "Connector with signals of type Integer"
parameter Integer n=1 "Dimension of signal vector" annotation (Hide=true);
replaceable type SignalType = Integer "type of signal";
SignalType signal[n] "Integer signals" annotation (Hide=true);
end IntegerPort;
equation
newInteger = oldInteger.signal[1];
annotation(defaultConnectionStructurallyInconsistent=true,
obsolete="Model is not balanced, so equation check will not work. This model is no longer needed",
Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100},
{100,100}}), graphics={
Rectangle(
extent={{-100,40},{100,-40}},
lineColor={255,127,0},
fillColor={255,255,255},
fillPattern=FillPattern.Solid),
Text(
extent={{-144,96},{144,46}},
textString=""),
Text(
extent={{-88,22},{88,-24}},
lineColor={255,127,0},
textString="adaptor"),
Text(
extent={{-216,-58},{36,-80}},
textString="port.signal")}),
Documentation(info="<html>
<p>
Completely obsolete adaptor between the Real signal connector
of version 1.6 and version ≥ 2.1 of the Modelica Standard Library.
This block is only provided for backward compatibility.
</p>
</html>"));
end AdaptorInteger;
end Adaptors;
end Interfaces;
package Math "Library of mathematical functions as input/output blocks"
package UnitConversions
"Conversion blocks to convert between SI and non-SI unit signals"
block ConvertAllUnits
"Obsolete block. Use one of Modelica.Blocks.Math.UnitConversions.XXX instead"
replaceable block ConversionBlock =
Modelica.Blocks.Interfaces.PartialConversionBlock
"Conversion block"
annotation (choicesAllMatching=true,
Documentation(info=
"<html>
<p>
Internal replaceable block that is used to construct the
\"pull down menu\" of the available unit conversions.
</p>
</html>"));
extends ConversionBlock;
extends ObsoleteModelica3.Icons.ObsoleteBlock;
annotation (
obsolete="Model is not according to Modelica Language 3.0 since replaceable base class present. " +
"Use instead one of Modelica.Blocks.Math.UnitConversions.XXX",
defaultComponentName="convert",
Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100},
{100,100}}), graphics={Line(points={{-90,0},{30,0}}, color=
{191,0,0}), Polygon(
points={{90,0},{30,20},{30,-20},{90,0}},
lineColor={191,0,0},
fillColor={191,0,0},
fillPattern=FillPattern.Solid)}),
Documentation(info="<html>
<p>This block implements the Modelica.SIunits.Conversions functions as a fixed causality block to
simplify their use. The block contains a replaceable block class <strong>ConversionBlock</strong> that can be
changed to be any of the blocks defined in Modelica.Blocks.Math.UnitConversions, and more generally, any
blocks that extend from Modelica.Blocks.Interfaces.PartialConversionBlock.
</p>
<p>
The desired conversion can be selected in the parameter menu
(the selected units are then displayed in the icon):
</p>
<p>
<img src=\"modelica://Modelica/Resources/Images/Blocks/ConvertAllUnits.png\">
</p>
</html>"));
end ConvertAllUnits;
end UnitConversions;
block TwoInputs
"Obsolete block. Use instead Modelica.Blocks.Math.InverseBlockConstraints"
extends Modelica.Blocks.Interfaces.BlockIcon;
extends ObsoleteModelica3.Icons.ObsoleteBlock;
Modelica.Blocks.Interfaces.RealInput u1
"Connector of first Real input signal"
annotation ( layer="icon",
Placement(transformation(extent={{-139.742,-19.0044},{-100,20}})));
Modelica.Blocks.Interfaces.RealInput u2
"Connector of second Real input signal (u1=u2)"
annotation (
layer="icon", Placement(transformation(
origin={120,0},
extent={{-20,-20},{20,20}},
rotation=180)));
equation
u1 = u2;
annotation(defaultConnectionStructurallyInconsistent=true,
obsolete="Model is not balanced, i.e., not according to Modelica Language 3.0. Use instead Modelica.Blocks.Math.InverseBlockConstraints",
Documentation(info="<html>
<p>
This block is used to enable assignment of values to variables preliminary
defined as outputs (e.g., useful for inverse model generation).
</p>
</html>"), Icon(coordinateSystem(
preserveAspectRatio=false,
extent={{-100,-100},{100,100}}),
graphics={Text(
extent={{-95,50},{95,-50}},
lineColor={0,0,127},
textString="=")}));
end TwoInputs;
block TwoOutputs
"Obsolete block. Use instead Modelica.Blocks.Math.InverseBlockConstraints"
extends Modelica.Blocks.Interfaces.BlockIcon;
extends ObsoleteModelica3.Icons.ObsoleteBlock;
output Modelica.Blocks.Interfaces.RealOutput y1
"Connector of first Real output signal"
annotation (Placement(transformation(extent={{100,-10},{120,10}})));
output Modelica.Blocks.Interfaces.RealOutput y2
"Connector of second Real output signal (y1=y2)"
annotation (Placement(
transformation(
origin={-110.366,-0.90289},
extent={{-10.0005,-10},{10.0005,10}},
rotation=180)));
equation
y1 = y2;
annotation(defaultConnectionStructurallyInconsistent=true,
obsolete="Model is not balanced, i.e., not according to Modelica Language 3.0. Use instead Modelica.Blocks.Math.InverseBlockConstraints",
Documentation(info="<html>
<p>
This block is used to enable calculation of values preliminary defined as inputs.
(e.g., useful for inverse model generation).
</p>
</html>"), Icon(coordinateSystem(
preserveAspectRatio=false,
extent={{-100,-100},{100,100}}),
graphics={Text(
extent={{-95,50},{95,-50}},
lineColor={0,0,127},
textString="=")}));
end TwoOutputs;
end Math;
end Blocks;
package Electrical
"Library of electrical models (analog, digital, machines, multi-phase)"
package Analog "Library for analog electrical models"
package Basic
"Basic electrical components such as resistor, capacitor, transformer"
model HeatingResistor
"Obsolete model. Use Modelica.Electrical.Analog.Basic.HeatingResistor instead"
extends Modelica.Electrical.Analog.Interfaces.OnePort;
extends ObsoleteModelica3.Icons.ObsoleteModel;
parameter Modelica.SIunits.Resistance R_ref=1
"Resistance at temperature T_ref";
parameter Modelica.SIunits.Temperature T_ref=300
"Reference temperature";
parameter Real alpha(unit="1/K") = 0
"Temperature coefficient of resistance";
Modelica.SIunits.Resistance R
"Resistance = R_ref*(1 + alpha*(heatPort.T - T_ref));";
Modelica.Thermal.HeatTransfer.Interfaces.HeatPort_a heatPort annotation (Placement(
transformation(
origin={0,-100},
extent={{10,-10},{-10,10}},
rotation=270)));
equation
v = R*i;
if cardinality(heatPort) > 0 then
R = R_ref*(1 + alpha*(heatPort.T - T_ref));
heatPort.Q_flow = -v*i;
else
/* heatPort is not connected resulting in the
implicit equation 'heatPort.Q_flow = 0'
*/
R = R_ref;
heatPort.T = T_ref;
end if;
annotation (
obsolete="Model equations depend on cardinality(..) which will become obsolete in the Modelica language. Use instead Modelica.Electrical.Analog.Basic.HeatingResistor",
Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-100,
-100},{100,100}}), graphics={
Line(points={{-110,20},{-85,20}}, color={160,160,164}),
Polygon(
points={{-95,23},{-85,20},{-95,17},{-95,23}},
lineColor={160,160,164},
fillColor={160,160,164},
fillPattern=FillPattern.Solid),
Line(points={{90,20},{115,20}}, color={160,160,164}),
Line(points={{-125,0},{-115,0}}, color={160,160,164}),
Line(points={{-120,-5},{-120,5}}, color={160,160,164}),
Text(
extent={{-110,25},{-90,45}},
lineColor={160,160,164},
textString="i"),
Polygon(
points={{105,23},{115,20},{105,17},{105,23}},
lineColor={160,160,164},
fillColor={160,160,164},
fillPattern=FillPattern.Solid),
Line(points={{115,0},{125,0}}, color={160,160,164}),
Text(
extent={{90,45},{110,25}},
lineColor={160,160,164},
textString="i"),
Rectangle(extent={{-70,30},{70,-30}}),
Line(points={{-96,0},{-70,0}}),
Line(points={{70,0},{96,0}}),
Line(points={{0,-30},{0,-90}}, color={191,0,0}),
Line(points={{-52,-50},{48,50}}, color={0,0,255}),
Polygon(
points={{40,52},{50,42},{54,56},{40,52}},
lineColor={0,0,255},
fillColor={0,0,255},
fillPattern=FillPattern.Solid)}),
Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100},
{100,100}}), graphics={
Text(extent={{-142,60},{143,118}}, textString="%name"),
Line(points={{-90,0},{-70,0}}),
Line(points={{70,0},{90,0}}),
Rectangle(
extent={{-70,30},{70,-30}},
lineColor={0,0,255},
fillColor={255,255,255},
fillPattern=FillPattern.Solid),
Line(points={{0,-30},{0,-91}}, color={191,0,0}),
Line(points={{-52,-50},{48,50}}, color={0,0,255}),
Polygon(
points={{40,52},{50,42},{54,56},{40,52}},
lineColor={0,0,255},
fillColor={0,0,255},
fillPattern=FillPattern.Solid)}),
Documentation(info="<html>
<p>This is a model for an electrical resistor where the generated heat
is dissipated to the environment via connector <strong>heatPort</strong> and where
the resistance R is temperature dependent according to the following
equation:</p>
<pre> R = R_ref*(1 + alpha*(heatPort.T - T_ref))
</pre>
<p><strong>alpha</strong> is the <strong>temperature coefficient of resistance</strong>, which
is often abbreviated as <strong>TCR</strong>. In resistor catalogues, it is usually
defined as <strong>X [ppm/K]</strong> (parts per million, similarly to percentage)
meaning <strong>X*1.e-6 [1/K]</strong>. Resistors are available for 1 .. 7000 ppm/K,
i.e., alpha = 1e-6 .. 7e-3 1/K;</p>
<p>When connector <strong>heatPort</strong> is <strong>not</strong> connected, the temperature
dependent behaviour is switched off by setting heatPort.T = T_ref.
Additionally, the equation <code>heatPort.Q_flow = 0</code> is implicitly present
due to a special rule in Modelica that flow variables of not connected
connectors are set to zero.</p>
</html>", revisions=
"<html>
<ul>
<li><em> 2002 </em>
by Anton Haumer<br> initially implemented<br>
</li>
</ul>
</html>"));
end HeatingResistor;
end Basic;
end Analog;
end Electrical;
package Icons "Library of icons"
partial block ObsoleteBlock
"Icon for an obsolete block (use only for this case)"
annotation (obsolete="Only used to mark an obsolete block. Do not use otherwise.",
Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,
-100},{100,100}}), graphics={Rectangle(
extent={{-102,102},{102,-102}},
lineColor={255,0,0},
pattern=LinePattern.Dash,
lineThickness=0.5)}), Documentation(info="<html>
<p>
This partial block is intended to provide a <u>default icon
for an obsolete block</u> that will be removed from the
corresponding library in a future release.
</p>
</html>"));
end ObsoleteBlock;
partial model ObsoleteModel
"Icon for an obsolete model (use only for this case)"
annotation (obsolete="Only used to mark an obsolete model. Do not use otherwise.",
Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,
-100},{100,100}}), graphics={Rectangle(
extent={{-102,102},{102,-102}},
lineColor={255,0,0},
pattern=LinePattern.Dash,
lineThickness=0.5)}), Documentation(info="<html>
<p>
This partial model is intended to provide a <u>default icon
for an obsolete model</u> that will be removed from the
corresponding library in a future release.
</p>
</html>"));
end ObsoleteModel;
partial class Enumeration
"Obsolete class (icon for an enumeration emulated by a package). Use a real enumeration instead"
annotation (obsolete="Icon for an emulated enumeration. Emulated enumerations are no longer used (only real enumerations)",
Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100},
{100,100}}), graphics={
Text(extent={{-138,164},{138,104}}, textString="%name"),
Ellipse(
extent={{-100,100},{100,-100}},
lineColor={255,0,127},
fillColor={255,255,255},
fillPattern=FillPattern.Solid),
Text(
extent={{-100,100},{100,-100}},
lineColor={255,0,127},
textString="e")}),
Documentation(info="<html>
<p>
This icon is designed for an <strong>enumeration</strong>
(that is emulated by a package).
</p>
</html>"));
end Enumeration;
end Icons;
package Mechanics
"Library of 1-dim. and 3-dim. mechanical components (multi-body, rotational, translational)"
package MultiBody "Library to model 3-dimensional mechanical systems"
package Forces
"Components that exert forces and/or torques between frames"
model WorldForceAndTorque
"Obsolete model. Use instead Modelica.Mechanics.MultiBody.Forces.WorldForceAndTorque"
import SI = Modelica.SIunits;
import Modelica.Mechanics.MultiBody.Types;
extends Modelica.Mechanics.MultiBody.Interfaces.PartialOneFrame_b;
extends ObsoleteModelica3.Icons.ObsoleteModel;
Modelica.Blocks.Interfaces.RealInput load[6]
"[1:6] = x-, y-, z-coordinates of force and x-, y-, z-coordiantes of torque resolved in world frame"
annotation (Placement(transformation(extent={{-140,-20},{-100,20}})));
parameter Boolean animation=true
"= true, if animation shall be enabled";
parameter Real N_to_m(unit="N/m") = world.defaultN_to_m
" Force arrow scaling (length = force/N_to_m)"
annotation (Dialog(group="if animation = true", enable=animation));
parameter Real Nm_to_m(unit="N.m/m") = world.defaultNm_to_m
" Torque arrow scaling (length = torque/Nm_to_m)"
annotation (Dialog(group="if animation = true", enable=animation));
input SI.Diameter forceDiameter=world.defaultArrowDiameter
" Diameter of force arrow" annotation (Dialog(group="if animation = true", enable=animation));
input SI.Diameter torqueDiameter=forceDiameter
" Diameter of torque arrow" annotation (Dialog(group="if animation = true", enable=animation));
input Types.Color forceColor=Modelica.Mechanics.MultiBody.Types.Defaults.ForceColor
" Color of force arrow" annotation (Dialog(group="if animation = true", enable=animation));
input Types.Color torqueColor=Modelica.Mechanics.MultiBody.Types.Defaults.TorqueColor
" Color of torque arrow" annotation (Dialog(group="if animation = true", enable=animation));
input Types.SpecularCoefficient specularCoefficient = world.defaultSpecularCoefficient
"Reflection of ambient light (= 0: light is completely absorbed)"
annotation (Dialog(group="if animation = true", enable=animation));
protected
SI.Position f_in_m[3]=frame_b.f/N_to_m
"Force mapped from N to m for animation";
SI.Position t_in_m[3]=frame_b.t/Nm_to_m
"Torque mapped from Nm to m for animation";
Modelica.Mechanics.MultiBody.Visualizers.Advanced.Arrow forceArrow(
diameter=forceDiameter,
color=forceColor,
specularCoefficient=specularCoefficient,
R=frame_b.R,
r=frame_b.r_0,
r_tail=f_in_m,
r_head=-f_in_m) if world.enableAnimation and animation;
Modelica.Mechanics.MultiBody.Visualizers.Advanced.DoubleArrow
torqueArrow(
diameter=torqueDiameter,
color=torqueColor,
specularCoefficient=specularCoefficient,
R=frame_b.R,
r=frame_b.r_0,
r_tail=t_in_m,
r_head=-t_in_m) if world.enableAnimation and animation;
equation
frame_b.f = -Modelica.Mechanics.MultiBody.Frames.resolve2(frame_b.R, load[1
:3]);
frame_b.t = -Modelica.Mechanics.MultiBody.Frames.resolve2(frame_b.R, load[4
:6]);
annotation (
obsolete="Based on a packed result signal which is not a good design. Use instead Modelica.Mechanics.MultiBody.Forces.WorldForceAndTorque",
preferredView="info",
Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-100,
-100},{100,100}}), graphics={
Polygon(
points={{-100,10},{50,10},{50,31},{97,0},{50,-31},{50,-10},{-100,
-10},{-100,10}},
fillPattern=FillPattern.Solid),
Line(
points={{-100,11},{-94,24},{-86,39},{-74,59},{-65,71},{-52,83},
{-35,92},{-22,95},{-8,95},{7,91},{19,84},{32,76},{44,66},
{52,58},{58,51}},
thickness=0.5),
Polygon(
points={{97,18},{72,77},{38,42},{97,18}},
fillPattern=FillPattern.Solid)}),
Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100},
{100,100}}), graphics={
Text(
extent={{-74,62},{44,24}},
lineColor={192,192,192},
textString="world"),
Polygon(
points={{-100,10},{50,10},{50,31},{94,0},{50,-31},{50,-10},{-100,
-10},{-100,10}},
fillPattern=FillPattern.Solid),
Text(extent={{-137,-47},{148,-108}}, textString="%name"),
Line(
points={{-98,14},{-92,27},{-84,42},{-72,62},{-63,74},{-50,86},
{-33,95},{-20,98},{-6,98},{9,94},{21,87},{34,79},{46,69},
{54,61},{60,54}},
thickness=0.5),
Polygon(
points={{99,21},{74,80},{40,45},{99,21}},
fillPattern=FillPattern.Solid)}),
Documentation(info="<html>
<p>
The <strong>6</strong> signals of the <strong>load</strong> connector are interpreted
as the x-, y- and z-coordinates of a <strong>force</strong> and as
the x-, y-, and z-coordinates of a <strong>torque</strong> resolved in the
<strong>world frame</strong> and acting at the frame connector to which this
component is attached. The input signals are mapped to the force
and torque in the following way:
</p>
<pre>
force = load[1:3]
torque = load[4:6]
</pre>
<p>
The force and torque are by default visualized as an arrow (force)
and as a double arrow (torque) acting at the connector to which
they are connected. The diameters
and colors of the arrows are fixed and can be defined via
parameters <strong>forceDiameter</strong>, <strong>torqueDiameter</strong>,
<strong>forceColor</strong> and <strong>torqueColor</strong>. The arrows
point in the directions defined by the
inPort.signal signals. The lengths of the arrows are proportional
to the length of the force and torque vectors, respectively, using parameters
<strong>N_to_m</strong> and <strong>Nm_to_m</strong> as scaling factors. For example, if N_to_m = 100 N/m,
then a force of 350 N is displayed as an arrow of length 3.5 m.
</p>
<p>
An example how to use this model is given in the
following figure:
</p>
<img src=\"modelica://Modelica/Resources/Images/Mechanics/MultiBody/Forces/WorldForceAndTorque1.png\">
<p>
This leads to the following animation
</p>
<img src=\"modelica://Modelica/Resources/Images/Mechanics/MultiBody/Forces/WorldForceAndTorque2.png\">
</html>"));
end WorldForceAndTorque;
model FrameForceAndTorque
"Obsolete model. Use instead Modelica.Mechanics.MultiBody.Forces.ForceAndTorque"
import SI = Modelica.SIunits;
import Modelica.Mechanics.MultiBody.Types;
extends Modelica.Mechanics.MultiBody.Interfaces.PartialOneFrame_b;
extends ObsoleteModelica3.Icons.ObsoleteModel;
Modelica.Mechanics.MultiBody.Interfaces.Frame_resolve frame_resolve
"If connected, the input signals are resolved in this frame"
annotation (Placement(transformation(
origin={0,100},
extent={{16,-16},{-16,16}},
rotation=270)));
Modelica.Blocks.Interfaces.RealInput load[6]
"[1:6] = x-, y-, z-coordinates of force and x-, y-, z-coordiantes of torque resolved in frame_b or frame_resolved (if connected)"
annotation (Placement(transformation(extent={{-140,-20},{-100,20}})));
parameter Boolean animation=true
"= true, if animation shall be enabled";
parameter Real N_to_m(unit="N/m") = world.defaultN_to_m
" Force arrow scaling (length = force/N_to_m)"
annotation (Dialog(group="if animation = true", enable=animation));
parameter Real Nm_to_m(unit="N.m/m") = world.defaultNm_to_m
" Torque arrow scaling (length = torque/Nm_to_m)"
annotation (Dialog(group="if animation = true", enable=animation));
input SI.Diameter forceDiameter=world.defaultArrowDiameter
" Diameter of force arrow" annotation (Dialog(group="if animation = true", enable=animation));
input SI.Diameter torqueDiameter=forceDiameter
" Diameter of torque arrow" annotation (Dialog(group="if animation = true", enable=animation));
input Types.Color forceColor=Modelica.Mechanics.MultiBody.Types.Defaults.ForceColor
" Color of force arrow" annotation (Dialog(group="if animation = true", enable=animation));
input Types.Color torqueColor=Modelica.Mechanics.MultiBody.Types.Defaults.TorqueColor
" Color of torque arrow" annotation (Dialog(group="if animation = true", enable=animation));
input Types.SpecularCoefficient specularCoefficient = world.defaultSpecularCoefficient
"Reflection of ambient light (= 0: light is completely absorbed)"
annotation (Dialog(group="if animation = true", enable=animation));
protected
SI.Position f_in_m[3]=frame_b.f/N_to_m
"Force mapped from N to m for animation";
SI.Position t_in_m[3]=frame_b.t/Nm_to_m
"Torque mapped from Nm to m for animation";
Modelica.Mechanics.MultiBody.Visualizers.Advanced.Arrow forceArrow(
diameter=forceDiameter,
color=forceColor,
specularCoefficient=specularCoefficient,
R=frame_b.R,
r=frame_b.r_0,
r_tail=f_in_m,
r_head=-f_in_m) if world.enableAnimation and animation;
Modelica.Mechanics.MultiBody.Visualizers.Advanced.DoubleArrow
torqueArrow(
diameter=torqueDiameter,
color=torqueColor,
specularCoefficient=specularCoefficient,
R=frame_b.R,
r=frame_b.r_0,
r_tail=t_in_m,
r_head=-t_in_m) if world.enableAnimation and animation;
equation
if cardinality(frame_resolve) == 0 then
frame_b.f = -load[1:3];
frame_b.t = -load[4:6];
frame_resolve.r_0 = zeros(3);
frame_resolve.R = Modelica.Mechanics.MultiBody.Frames.nullRotation();
else
frame_b.f = -Modelica.Mechanics.MultiBody.Frames.resolveRelative(
load[1:3],
frame_resolve.R,
frame_b.R);
frame_b.t = -Modelica.Mechanics.MultiBody.Frames.resolveRelative(
load[4:6],
frame_resolve.R,
frame_b.R);
frame_resolve.f = zeros(3);
frame_resolve.t = zeros(3);
end if;
annotation (
obsolete="Based on a packed result signal which is not a good design. Use instead Modelica.Mechanics.MultiBody.Forces.ForceAndTorque",
preferredView="info",
Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-100,
-100},{100,100}}), graphics={
Polygon(
points={{-100,10},{50,10},{50,31},{97,0},{50,-31},{50,-10},{-100,
-10},{-100,10}},
fillPattern=FillPattern.Solid),
Line(points={{-100,11},{-94,24},{-86,39},{-74,59},{-65,71},{-52,
83},{-35,92},{-22,95},{-8,95},{7,91},{19,84},{32,76},{44,
66},{52,58},{58,51}}),
Polygon(
points={{97,18},{72,77},{38,42},{97,18}},
fillPattern=FillPattern.Solid),
Line(
points={{0,97},{0,10}},
color={95,95,95},
pattern=LinePattern.Dot)}),
Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100},
{100,100}}), graphics={
Text(
extent={{-74,62},{44,24}},
lineColor={192,192,192},
textString="resolve"),
Polygon(
points={{-100,10},{50,10},{50,31},{94,0},{50,-31},{50,-10},{-100,
-10},{-100,10}},
fillPattern=FillPattern.Solid),
Text(extent={{-137,-47},{148,-108}}, textString="%name"),
Line(points={{-100,10},{-92,26},{-84,42},{-76,52},{-60,68},{-46,
76},{-31,82},{-17,85},{-2,87},{14,86},{26,82},{37,75},{46,
69},{54,61},{60,54}}),
Polygon(
points={{99,21},{74,80},{40,45},{99,21}},
fillPattern=FillPattern.Solid),
Line(
points={{0,95},{0,10}},
color={95,95,95},
pattern=LinePattern.Dot)}),
Documentation(info="<html>
<p>
The <strong>6</strong> signals of the <strong>load</strong> connector are interpreted
as the x-, y- and z-coordinates of a <strong>force</strong> and as
the x-, y-, and z-coordinates of a <strong>torque</strong> acting at the frame
connector to which this component is attached. If connector
<strong>frame_resolve</strong> is <strong>not</strong> connected, the force and torque coordinates
are with respect to <strong>frame_b</strong>. If connector
<strong>frame_resolve</strong> is connected, the force and torque coordinates
are with respect to <strong>frame_resolve</strong>. In this case the
force and torque in connector frame_resolve are set to zero,
i.e., this connector is solely used to provide the information
of the coordinate system, in which the force coordinates
are defined. The input signals are mapped to the force
and torque in the following way:
</p>
<pre>
force = load[1:3]
torque = load[4:6]
</pre>
<p>
The force and torque are by default visualized as an arrow (force)
and as a double arrow (torque) acting at the connector to which
they are connected. The diameters
and colors of the arrows are fixed and can be defined via
parameters <strong>forceDiameter</strong>, <strong>torqueDiameter</strong>,
<strong>forceColor</strong> and <strong>torqueColor</strong>. The arrows
point in the directions defined by the
inPort.signal signals. The lengths of the arrows are proportional
to the length of the force and torque vectors, respectively, using parameters
<strong>N_to_m</strong> and <strong>Nm_to_m</strong> as scaling factors. For example,
if N_to_m = 100 N/m,
then a force of 350 N is displayed as an arrow of length 3.5 m.
</p>
<p>
An example how to use this model is given in the
following figure:
</p>
<img src=\"modelica://Modelica/Resources/Images/Mechanics/MultiBody/Forces/FrameForceAndTorque1.png\">
<p>
This leads to the following animation
</p>
<img src=\"modelica://Modelica/Resources/Images/Mechanics/MultiBody/Forces/FrameForceAndTorque2.png\">
</html>"));
end FrameForceAndTorque;
model ForceAndTorque
"Obsolete model. Use instead Modelica.Mechanics.MultiBody.Forces.ForceAndTorque"
import SI = Modelica.SIunits;
import Modelica.Mechanics.MultiBody.Types;
extends Modelica.Mechanics.MultiBody.Interfaces.PartialTwoFrames;
extends ObsoleteModelica3.Icons.ObsoleteModel;
Modelica.Mechanics.MultiBody.Interfaces.Frame_resolve frame_resolve
"If connected, the input signals are resolved in this frame"
annotation (Placement(transformation(
origin={40,100},
extent={{-16,-16},{16,16}},
rotation=90)));
Modelica.Blocks.Interfaces.RealInput load[6]
"[1:6] = x-, y-, z-coordinates of force and x-, y-, z-coordiantes of torque resolved in frame_b or frame_resolved (if connected)"
annotation (Placement(transformation(
origin={-60,120},
extent={{-20,-20},{20,20}},
rotation=270)));
parameter Boolean animation=true
"= true, if animation shall be enabled";
parameter Real N_to_m(unit="N/m") = world.defaultN_to_m
" Force arrow scaling (length = force/N_to_m)"
annotation (Dialog(group="if animation = true", enable=animation));
parameter Real Nm_to_m(unit="N.m/m") = world.defaultNm_to_m
" Torque arrow scaling (length = torque/Nm_to_m)"
annotation (Dialog(group="if animation = true", enable=animation));
input SI.Diameter forceDiameter=world.defaultArrowDiameter
" Diameter of force arrow" annotation (Dialog(group="if animation = true", enable=animation));
input SI.Diameter torqueDiameter=forceDiameter
" Diameter of torque arrow" annotation (Dialog(group="if animation = true", enable=animation));
input SI.Diameter connectionLineDiameter=forceDiameter
" Diameter of line connecting frame_a and frame_b"
annotation (Dialog(group="if animation = true", enable=animation));
input Types.Color forceColor=Modelica.Mechanics.MultiBody.Types.Defaults.ForceColor
" Color of force arrow" annotation (Dialog(group="if animation = true", enable=animation));
input Types.Color torqueColor=Modelica.Mechanics.MultiBody.Types.Defaults.TorqueColor
" Color of torque arrow" annotation (Dialog(group="if animation = true", enable=animation));
input Types.Color connectionLineColor=Modelica.Mechanics.MultiBody.Types.Defaults.SensorColor
" Color of line connecting frame_a and frame_b"
annotation (Dialog(group="if animation = true", enable=animation));
input Types.SpecularCoefficient specularCoefficient = world.defaultSpecularCoefficient
"Reflection of ambient light (= 0: light is completely absorbed)"
annotation (Dialog(group="if animation = true", enable=animation));
SI.Position r_0[3]
"Position vector from origin of frame_a to origin of frame_b resolved in world frame";
SI.Force f_b_0[3] "frame_b.f resolved in world frame";
SI.Torque t_b_0[3] "frame_b.t resolved in world frame";
protected
SI.Position f_in_m[3]=frame_b.f/N_to_m
"Force mapped from N to m for animation";
SI.Position t_in_m[3]=frame_b.t/Nm_to_m
"Torque mapped from Nm to m for animation";
Modelica.Mechanics.MultiBody.Visualizers.Advanced.Arrow forceArrow(
diameter=forceDiameter,
color=forceColor,
specularCoefficient=specularCoefficient,
R=frame_b.R,
r=frame_b.r_0,
r_tail=f_in_m,
r_head=-f_in_m) if world.enableAnimation and animation;
Modelica.Mechanics.MultiBody.Visualizers.Advanced.DoubleArrow
torqueArrow(
diameter=torqueDiameter,
color=torqueColor,
specularCoefficient=specularCoefficient,
R=frame_b.R,
r=frame_b.r_0,
r_tail=t_in_m,
r_head=-t_in_m) if world.enableAnimation and animation;
Modelica.Mechanics.MultiBody.Visualizers.Advanced.Shape
connectionLine(
shapeType="cylinder",
lengthDirection=r_0,
widthDirection={0,1,0},
length=Modelica.Math.Vectors.length( r_0),
width=connectionLineDiameter,
height=connectionLineDiameter,
color=connectionLineColor,
specularCoefficient=specularCoefficient,
r=frame_a.r_0) if world.enableAnimation and animation;
equation
if cardinality(frame_resolve) == 0 then
frame_b.f = -load[1:3];
frame_b.t = -load[4:6];
f_b_0 = Modelica.Mechanics.MultiBody.Frames.resolve1(frame_b.R, frame_b.f);
t_b_0 = Modelica.Mechanics.MultiBody.Frames.resolve1(frame_b.R, frame_b.t);
frame_resolve.r_0 = zeros(3);
frame_resolve.R = Modelica.Mechanics.MultiBody.Frames.nullRotation();
else
f_b_0 = -Modelica.Mechanics.MultiBody.Frames.resolve1(frame_resolve.R,
load[1:3]);
t_b_0 = -Modelica.Mechanics.MultiBody.Frames.resolve1(frame_resolve.R,
load[4:6]);
frame_b.f = Modelica.Mechanics.MultiBody.Frames.resolve2(frame_b.R, f_b_0);
frame_b.t = Modelica.Mechanics.MultiBody.Frames.resolve2(frame_b.R, t_b_0);
frame_resolve.f = zeros(3);
frame_resolve.t = zeros(3);
end if;
// Force and torque balance
r_0 = frame_b.r_0 - frame_a.r_0;
zeros(3) = frame_a.f + Modelica.Mechanics.MultiBody.Frames.resolve2(frame_a.R,
f_b_0);
zeros(3) = frame_a.t + Modelica.Mechanics.MultiBody.Frames.resolve2(frame_a.R,
t_b_0 + cross(r_0, f_b_0));
annotation (
obsolete="Based on a packed result signal which is not a good design. Use instead Modelica.Mechanics.MultiBody.Forces.ForceAndTorque",
preferredView="info",
Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100},
{100,100}}), graphics={
Rectangle(
extent={{-98,99},{99,-98}},
lineColor={255,255,255},
fillColor={255,255,255},
fillPattern=FillPattern.Solid),
Text(
extent={{-59,55},{72,30}},
lineColor={192,192,192},
textString="resolve"),
Text(extent={{-136,-52},{149,-113}}, textString="%name"),
Polygon(
points={{100,21},{84,55},{69,39},{100,21}},
fillPattern=FillPattern.Solid),
Line(
points={{40,100},{40,0}},
color={95,95,95},
pattern=LinePattern.Dot),
Polygon(
points={{-95,1},{-64,11},{-64,-10},{-95,1}},
fillPattern=FillPattern.Solid),
Polygon(
points={{-100,20},{-86,53},{-70,42},{-100,20}},
fillPattern=FillPattern.Solid),
Line(
points={{-60,100},{40,100}},
color={95,95,95},
pattern=LinePattern.Dot),
Polygon(
points={{94,0},{65,12},{65,-11},{94,0}},
fillPattern=FillPattern.Solid),
Line(points={{-64,0},{-20,0}}),
Line(points={{20,0},{65,0}}),
Line(points={{-79,47},{-70,61},{-59,72},{-45,81},{-32,84},{-20,
85}}),
Line(points={{76,47},{66,60},{55,69},{49,74},{41,80},{31,84},{
20,85}})}),
Documentation(info="<html>
<p>
The <strong>6</strong> signals of the <strong>load</strong> connector are interpreted
as the x-, y- and z-coordinates of a <strong>force</strong> and as
the x-, y-, and z-coordinates of a <strong>torque</strong> acting at the frame
connector to which frame_b of this component is attached. If connector
<strong>frame_resolve</strong> is <strong>not</strong> connected, the force and torque coordinates
are with respect to <strong>frame_b</strong>. If connector
<strong>frame_resolve</strong> is connected, the force and torque coordinates
are with respect to <strong>frame_resolve</strong>. In this case the
force and torque in connector frame_resolve are set to zero,
i.e., this connector is solely used to provide the information
of the coordinate system, in which the force/torque coordinates
are defined. The input signals are mapped to the force
and torque in the following way:
</p>
<pre>
force = load[1:3]
torque = load[4:6]
</pre>
<p>
Additionally, a force and torque acts on frame_a in such a way that
the force and torque balance between frame_a and frame_b is fulfilled.
</p>
<p>
An example how to use this model is given in the
following figure:
</p>
<img src=\"modelica://Modelica/Resources/Images/Mechanics/MultiBody/Forces/ForceAndTorque1.png\">
<p>
This leads to the following animation (the yellow cylinder
characterizes the line between frame_a and frame_b of the
ForceAndTorque component, i.e., the force and torque acts with
negative sign
also on the opposite side of this cylinder, but for
clarity this is not shown in the animation):
</p>
<img src=\"modelica://Modelica/Resources/Images/Mechanics/MultiBody/Forces/ForceAndTorque2.png\">
</html>"));
end ForceAndTorque;
end Forces;
package Interfaces
"Connectors and partial models for 3-dim. mechanical components"
partial model PartialCutForceSensor
"Obsolete model. Use instead instead a model from Modelica.Mechanics.MultiBody.Sensors"
extends Modelica.Icons.RotationalSensor;
extends ObsoleteModelica3.Icons.ObsoleteModel;
Modelica.Mechanics.MultiBody.Interfaces.Frame_a frame_a
"Coordinate system with one cut-force and cut-torque" annotation (Placement(
transformation(extent={{-116,-16},{-84,16}})));
Modelica.Mechanics.MultiBody.Interfaces.Frame_b frame_b
"Coordinate system with one cut-force and cut-torque" annotation (Placement(
transformation(extent={{84,-16},{116,16}})));
Modelica.Mechanics.MultiBody.Interfaces.Frame_resolve frame_resolve
"If connected, the output signals are resolved in this frame (cut-force/-torque are set to zero)"
annotation (Placement(transformation(
origin={80,-100},