FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
ModelicaStandardLibrary/ModelicaTestConversion4.mo at master · modelscript/ModelicaStandardLibrary · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
modelscript
/
ModelicaStandardLibrary
Public
forked from
modelica/ModelicaStandardLibrary
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
ModelicaStandardLibrary
/
ModelicaTestConversion4.mo
Copy path
More file actions
More file actions
Latest commit
History
History
History
3222 lines (3044 loc) · 160 KB
Breadcrumbs
ModelicaStandardLibrary
/
ModelicaTestConversion4.mo
Copy path
File metadata and controls
3222 lines (3044 loc) · 160 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
package
ModelicaTestConversion4
extends
Modelica.Icons.ExamplesPackage;
package
Blocks
extends
Modelica.Icons.ExamplesPackage;
model
Issue813
"Conversion test for #813"
extends
Modelica.Icons.Example;
block
B
output
Real
y;
parameter
Real
p;
equation
y
=
p
*
time;
end
B;
block
B1
extends
Modelica.Blocks.Interfaces.BlockIcon;
extends
B(p
=
1
);
end
B1;
block
B2
extends
Modelica.Blocks.Interfaces.BooleanBlockIcon;
extends
B(p
=
2
);
end
B2;
block
B3
extends
Modelica.Blocks.Interfaces.DiscreteBlockIcon;
extends
B(p
=
3
);
end
B3;
block
B4
extends
Modelica.Blocks.Interfaces.IntegerBlockIcon;
extends
B(p
=
4
);
end
B4;
block
B5
extends
Modelica.Blocks.Interfaces.partialBooleanBlockIcon;
extends
B(p
=
5
);
end
B5;
B1 b1;
B2 b2;
B3 b3;
B4 b4;
B5 b5;
Modelica.Blocks.Interfaces.Adaptors.SendReal
sendReal;
Modelica.Blocks.Interfaces.Adaptors.ReceiveReal
receiveReal;
Modelica.Blocks.Sources.RealExpression
realExpression;
Modelica.Blocks.Interfaces.Adaptors.SendBoolean
sendBoolean;
Modelica.Blocks.Interfaces.Adaptors.ReceiveBoolean
receiveBoolean;
Modelica.Blocks.Sources.BooleanExpression
booleanExpression;
Modelica.Blocks.Interfaces.Adaptors.SendInteger
sendInteger;
Modelica.Blocks.Interfaces.Adaptors.ReceiveInteger
receiveInteger;
Modelica.Blocks.Sources.IntegerExpression
integerExpression;
equation
connect
(sendReal.toBus, receiveReal.fromBus);
connect
(realExpression.y, sendReal.u);
connect
(sendBoolean.toBus, receiveBoolean.fromBus);
connect
(booleanExpression.y, sendBoolean.u);
connect
(sendInteger.toBus, receiveInteger.fromBus);
connect
(integerExpression.y, sendInteger.u);
annotation(experiment(StopTime=1), Documentation(info=
"<html>
<p>
Conversion test for <a href=\"
https://github.com/modelica/ModelicaStandardLibrary/issues/813\
">#813</a>.
</p>
</html>"
));
end
Issue813;
model
Issue1724
"Conversion test for #1724"
extends
Modelica.Icons.Example;
Modelica.Blocks.Math.LinearDependency
linearDependency(
y0
=
10
,
k1
=
100
,
k2
=
1000
)
annotation(Placement(transformation(extent={{-70,65},{-50,85}})));
Modelica.Blocks.Sources.Constant
const(k
=
1
)
annotation(Placement(transformation(extent={{-115,65},{-95,85}})));
equation
assert
(
noEvent
(linearDependency.y
>
11009
and
linearDependency.y
<
11011
),
"Break in backward compatibilityof Modelica.Blocks.Math.LinearDependency"
);
connect
(const.y, linearDependency.u1)
annotation(Line(points={{-94,75},{-89,75},{-77,75},{-77,81},{-72,81}},color={0,0,127}));
connect
(const.y, linearDependency.u2)
annotation(Line(points={{-94,75},{-89,75},{-77,75},{-77,69},{-72,69}},color={0,0,127}));
annotation(experiment(StopTime=1), Documentation(info=
"<html>
<p>
Conversion test for <a href=\"
https://github.com/modelica/ModelicaStandardLibrary/issues/1724\
">#1724</a>.
</p>
</html>"
));
end
Issue1724;
model
Issue2441
"Conversion test for #2441"
extends
Modelica.Icons.Example;
Modelica.Blocks.Tables.CombiTable1D
table1(table
=
[
0
,
0
;
0
,
1
]);
Modelica.Blocks.Tables.CombiTable2D
table2(table
=
[
0
,
0
;
0
,
1
]);
equation
table1.u[
1
]
=
time;
table2.u1
=
time;
table2.u2
=
time;
annotation(experiment(StopTime=1), Documentation(info=
"<html>
<p>
Conversion test for <a href=\"
https://github.com/modelica/ModelicaStandardLibrary/issues/2441\
">#2441</a>.
</p>
</html>"
));
end
Issue2441;
model
Issue2891
"Conversion test for #2891"
extends
Modelica.Icons.Example;
Modelica.Blocks.Continuous.LimPID
PID(
controllerType
=
Modelica.Blocks.Types.SimpleController.P,
yMax
=
0.5
,
initType
=
Modelica.Blocks.Types.InitPID.DoNotUse_InitialIntegratorState,
limitsAtInit
=
true
);
Modelica.Blocks.Sources.Clock
clock;
Modelica.Blocks.Nonlinear.Limiter
limiter(
uMax
=
0.5
,
limitsAtInit
=
true
);
Modelica.Blocks.Nonlinear.VariableLimiter
variableLimiter(
limitsAtInit
=
false
);
Modelica.Blocks.Nonlinear.DeadZone
deadZone(
uMax
=
0.5
,
deadZoneAtInit
=
false
);
Modelica.Blocks.Sources.Constant
const1(k
=
0.5
);
Modelica.Blocks.Sources.Constant
const2(k
=
-
0.5
);
equation
connect
(clock.y, PID.u_s);
connect
(clock.y, PID.u_m);
connect
(clock.y, limiter.u);
connect
(clock.y, variableLimiter.u);
connect
(clock.y, deadZone.u);
connect
(const1.y, variableLimiter.limit1);
connect
(const2.y, variableLimiter.limit2);
annotation(experiment(StopTime=1), Documentation(info=
"<html>
<p>
Conversion test for <a href=\"
https://github.com/modelica/ModelicaStandardLibrary/issues/2891\
">#2891</a>.
</p>
</html>"
));
end
Issue2891;
model
Issue2892
"Conversion test for #2892"
extends
Modelica.Icons.Example;
import
Modelica.Blocks.Types.InitPID;
Modelica.Blocks.Continuous.LimPID
pid1(initType
=
InitPID(
3
), yMax
=
1
);
Modelica.Blocks.Continuous.LimPID
pid2(initType
=
InitPID.DoNotUse_InitialIntegratorState, yMax
=
1
);
Modelica.Blocks.Continuous.LimPID
pid3(initType
=
InitPID.SteadyState, yMax
=
1
);
Modelica.Blocks.Continuous.LimPID
pid4(yMax
=
1
);
Modelica.Blocks.Continuous.PID
pid5(initType
=
Modelica.Blocks.Types.InitPID(
3
), Td
=
0.5
, Ti
=
0.5
);
Modelica.Blocks.Continuous.PID
pid6(initType
=
Modelica.Blocks.Types.InitPID.DoNotUse_InitialIntegratorState, Td
=
0.5
, Ti
=
0.5
);
Modelica.Blocks.Continuous.PID
pid7(initType
=
Modelica.Blocks.Types.InitPID.NoInit, Td
=
0.5
, Ti
=
0.5
);
Modelica.Blocks.Continuous.PID
pid8(Td
=
0.5
, Ti
=
0.5
);
Modelica.Blocks.Sources.Clock
clock;
equation
connect
(clock.y, pid1.u_s);
connect
(clock.y, pid1.u_m);
connect
(clock.y, pid2.u_s);
connect
(clock.y, pid2.u_m);
connect
(clock.y, pid3.u_s);
connect
(clock.y, pid3.u_m);
connect
(clock.y, pid4.u_s);
connect
(clock.y, pid4.u_m);
connect
(clock.y, pid5.u);
connect
(clock.y, pid6.u);
connect
(clock.y, pid7.u);
connect
(clock.y, pid8.u);
annotation(experiment(StopTime=1), Documentation(info=
"<html>
<p>
Conversion test for <a href=\"
https://github.com/modelica/ModelicaStandardLibrary/issues/2892\
">#2892</a>.
</p>
</html>"
));
end
Issue2892;
model
Issue2945
"Conversion test for #2945"
extends
Modelica.Icons.Example;
Modelica.Blocks.Sources.Clock
clock(
offset
=
-
0.5
,
startTime
=
0.5
);
annotation(experiment(StopTime=1), Documentation(info=
"<html>
<p>
Conversion test for <a href=\"
https://github.com/modelica/ModelicaStandardLibrary/issues/2945\
">#2945</a>.
</p>
</html>"
));
end
Issue2945;
model
Issue3035
"Conversion test for #3035"
extends
Modelica.Icons.Example;
Modelica.Blocks.Sources.Clock
clock(
offset
=
-
0.5
,
startTime
=
0.5
);
Modelica.Blocks.Sources.Sine
sine(
amplitude
=
1
,
freqHz
=
1
,
phase
=
0
,
offset
=
0
,
startTime
=
0.1
)
annotation (Placement(transformation(extent={{-40,30},{-20,50}})));
Modelica.Blocks.Sources.Cosine
cosine(
amplitude
=
1
,
freqHz
=
1
,
phase
=
0
,
offset
=
0
,
startTime
=
0.1
)
annotation (Placement(transformation(extent={{-40,-10},{-20,10}})));
Modelica.Blocks.Sources.ExpSine
expSine(
amplitude
=
1
,
freqHz
=
1
,
phase
=
0
,
damping
=
1
,
offset
=
0
,
startTime
=
0.1
)
annotation (Placement(transformation(extent={{-40,-50},{-20,-30}})));
annotation(experiment(StopTime=1, Tolerance=1e-06), Documentation(info=
"<html>
<p>
Conversion test for <a href=\"
https://github.com/modelica/ModelicaStandardLibrary/issues/3035\
">#3035</a>.
</p>
</html>"
));
end
Issue3035;
end
Blocks;
package
ComplexBlocks
"Library of basic input/output control blocks with Complex signals"
extends
Modelica.Icons.ExamplesPackage;
model
Issue2157
"Conversion test for #2157"
extends
Modelica.Icons.Example;
Modelica.ComplexBlocks.Sources.LogFrequencySweep
logSweep(
wMin
=
0.01
,
wMax
=
100
,
duration
=
1
)
annotation (Placement(transformation(extent={{-10,-10},{10,10}})));
annotation(experiment(StopTime=1), Documentation(info=
"<html>
<p>
Conversion test for <a href=\"
https://github.com/modelica/ModelicaStandardLibrary/issues/2157\
">#2157</a>.
</p>
</html>"
));
end
Issue2157;
end
ComplexBlocks;
package
Constants
extends
Modelica.Icons.ExamplesPackage;
model
Issue194
"Conversion test for #194"
extends
Modelica.Icons.Example;
Modelica.Blocks.Sources.Constant
constantBlock(
k
=
Modelica.Constants.mue_0);
annotation(experiment(StopTime=1), Documentation(info=
"<html>
<p>
Conversion test for <a href=\"
https://github.com/modelica/ModelicaStandardLibrary/issues/194\
">#194</a>.
</p>
</html>"
));
end
Issue194;
end
Constants;
package
StateGraph
extends
Modelica.Icons.ExamplesPackage;
model
Issue2112
"Conversion test for #2112"
extends
Modelica.Icons.Example;
Boolean
b1
=
Modelica.StateGraph.Temporary.anyTrue({
true
,
false
});
Boolean
b2;
algorithm
b2
:=
not
Modelica.StateGraph.Temporary.allTrue({
true
,
false
});
annotation(experiment(StopTime=1), Documentation(info=
"<html>
<p>
Conversion test for <a href=\"
https://github.com/modelica/ModelicaStandardLibrary/issues/2112\
">#2112</a>.
</p>
</html>"
));
end
Issue2112;
model
Issue2113
"Conversion test for #2113"
extends
Modelica.Icons.Example;
Modelica.StateGraph.Temporary.NumericValue
numericValue1(
precision
=
2
,
hideConnector
=
false
)
annotation(Placement(transformation(extent={{-60,0},{-40,20}})));
Modelica.StateGraph.Temporary.NumericValue
numericValue2(
precision
=
3
,
hideConnector
=
true
,
Value
=
time
*
2
)
annotation(Placement(transformation(extent={{-60,40},{-40,60}})));
Modelica.StateGraph.Temporary.IndicatorLamp
indicatorLamp
annotation(Placement(transformation(extent={{20,40},{40,60}})));
Modelica.Blocks.Sources.BooleanExpression
booleanExpression(y
=
time
>
=
0.5
)
annotation(Placement(transformation(extent={{-20,40},{0,60}})));
Modelica.Blocks.Sources.RealExpression
realExpression(y
=
time
*
3
)
annotation(Placement(transformation(extent={{-100,0},{-80,20}})));
equation
connect
(booleanExpression.y, indicatorLamp.u)
annotation(Line(points={{1,50},{18,50}}, color={255,0,255}));
connect
(realExpression.y, numericValue1.Value)
annotation(Line(points={{-79,10},{-62,10}}, color={0,0,127}));
annotation(experiment(StopTime=1), Documentation(info=
"<html>
<p>
Conversion test for <a href=\"
https://github.com/modelica/ModelicaStandardLibrary/issues/2113\
">#2113</a>.
</p>
</html>"
));
end
Issue2113;
model
Issue2880
"Conversion test for #2880"
extends
Modelica.Icons.Example;
parameter
Modelica.StateGraph.Temporary.SetRealParameter
limit
=
0.98
"Limit level of tank 1"
annotation(Placement(transformation(extent={{-64,76},{-44,96}})));
parameter
Modelica.StateGraph.Temporary.SetRealParameter
waitTime
=
3
"Wait time"
annotation(Placement(transformation(extent={{-91,76},{-71,96}})));
Modelica.StateGraph.Temporary.RadioButton
start(reset
=
{stop.on,shut.on}, buttonTimeTable
=
{
20
,
280
})
annotation(Placement(transformation(extent={{-66,40},{-46,60}})));
Modelica.StateGraph.Temporary.RadioButton
stop(reset
=
{start.on,shut.on}, buttonTimeTable
=
{
220
,
650
})
annotation(Placement(transformation(extent={{-66,10},{-46,30}})));
Modelica.StateGraph.Temporary.RadioButton
shut(reset
=
{start.on,stop.on}, buttonTimeTable
=
{
700
})
annotation(Placement(transformation(extent={{-66,-20},{-46,0}})));
annotation(experiment(StopTime=900), Documentation(info=
"<html>
<p>
Conversion test for <a href=\"
https://github.com/modelica/ModelicaStandardLibrary/issues/2880\
">#2880</a>.
</p>
</html>"
));
end
Issue2880;
model
Issue3086
"Conversion test for #3086"
extends
Modelica.Icons.Example;
Modelica.StateGraph.InitialStep
initialStep
annotation (Placement(transformation(extent={{-48,0},{-28,20}})));
Modelica.StateGraph.Transition
transition1(enableTimer
=
true
, waitTime
=
1
)
annotation (Placement(transformation(extent={{-20,0},{0,20}})));
Modelica.StateGraph.Step
step
annotation (Placement(transformation(extent={{10,0},{30,20}})));
Modelica.StateGraph.Transition
transition2(enableTimer
=
true
, waitTime
=
1
)
annotation (Placement(transformation(extent={{40,0},{60,20}})));
inner
Modelica.StateGraph.StateGraphRoot
stateGraphRoot
annotation (Placement(transformation(extent={{-80,60},{-60,80}})));
equation
connect
(initialStep.outPort[
1
], transition1.inPort)
annotation (Line(points={{-27.5,10},{-14,10}}));
connect
(transition1.outPort, step.inPort[
1
])
annotation (Line(points={{-8.5,10},{9,10}}));
connect
(step.outPort[
1
], transition2.inPort)
annotation (Line(points={{30.5,10},{46,10}}));
connect
(transition2.outPort, initialStep.inPort[
1
])
annotation (Line(points={{51.5,10},{70,10},{70,32},{-62,32},{-62,10},{-49,10}}));
annotation(experiment(StopTime=5), Documentation(info=
"<html>
<p>
Conversion test for <a href=\"
https://github.com/modelica/ModelicaStandardLibrary/issues/3086\
">#3086</a>.
</p>
</html>"
));
end
Issue3086;
model
Issue3086_WithSignal
"Conversion test for #3086"
extends
Modelica.Icons.Example;
Modelica.StateGraph.InitialStepWithSignal
initialStep
annotation (Placement(transformation(extent={{-48,0},{-28,20}})));
Modelica.StateGraph.Transition
transition1(enableTimer
=
true
, waitTime
=
1
)
annotation (Placement(transformation(extent={{-20,0},{0,20}})));
Modelica.StateGraph.StepWithSignal
step
annotation (Placement(transformation(extent={{10,0},{30,20}})));
Modelica.StateGraph.Transition
transition2(enableTimer
=
true
, waitTime
=
1
)
annotation (Placement(transformation(extent={{40,0},{60,20}})));
inner
Modelica.StateGraph.StateGraphRoot
stateGraphRoot
annotation (Placement(transformation(extent={{-80,60},{-60,80}})));
equation
connect
(initialStep.outPort[
1
], transition1.inPort)
annotation (Line(points={{-27.5,10},{-14,10}}));
connect
(transition1.outPort, step.inPort[
1
])
annotation (Line(points={{-8.5,10},{9,10}}));
connect
(step.outPort[
1
], transition2.inPort)
annotation (Line(points={{30.5,10},{46,10}}));
connect
(transition2.outPort, initialStep.inPort[
1
])
annotation (Line(points={{51.5,10},{70,10},{70,32},{-62,32},{-62,10},{-49,10}}));
annotation(experiment(StopTime=5), Documentation(info=
"<html>
<p>
Conversion test for <a href=\"
https://github.com/modelica/ModelicaStandardLibrary/issues/3086\
">#3086</a>.
</p>
</html>"
));
end
Issue3086_WithSignal;
end
StateGraph;
package
Electrical
extends
Modelica.Icons.ExamplesPackage;
package
Analog
extends
Modelica.Icons.ExamplesPackage;
model
Issue197
"Conversion test for #197"
extends
Modelica.Icons.Example;
Modelica.Electrical.Analog.Basic.EMF
emf(
k
=
1
,
phi(start
=
0
, fixed
=
true
));
Modelica.Electrical.Analog.Sources.ConstantVoltage
constantVoltage(V
=
1
);
Modelica.Electrical.Analog.Basic.Ground
ground;
equation
connect
(constantVoltage.n, emf.p);
connect
(constantVoltage.p, emf.n);
connect
(ground.p, emf.n);
annotation(experiment(StopTime=1), Documentation(info=
"<html>
<p>
Conversion test for <a href=\"
https://github.com/modelica/ModelicaStandardLibrary/issues/197\
">#197</a>.
</p>
</html>"
));
end
Issue197;
model
Issue778
"Conversion test for #778"
extends
Modelica.Icons.Example;
Modelica.Electrical.Analog.Basic.Ground
ground
annotation(Placement(transformation(extent={{-20,-100},{0,-80}})));
Modelica.Electrical.Analog.Sources.ConstantVoltage
constantVoltage(V
=
1
)
annotation (Placement(transformation(
extent={{-10,-10},{10,10}},
rotation=270,
origin={-80,0})));
Modelica.Electrical.Analog.Basic.Resistor
r1(R
=
2
)
annotation(Placement(transformation(extent={{-10,-10},{10,10}},
rotation=270,
origin={20,20})));
Modelica.Electrical.Analog.Ideal.IdealCommutingSwitch
twoWay
annotation (Placement(transformation(extent={{-40,50},{-20,30}})));
Modelica.Electrical.Analog.Ideal.ControlledIdealCommutingSwitch
controlledTwoWay
annotation (Placement(transformation(extent={{40,70},{60,50}})));
Modelica.Electrical.Analog.Basic.Resistor
r2(R
=
1
)
annotation(Placement(transformation(extent={{-10,-10},{10,10}},
rotation=270,
origin={20,-20})));
Modelica.Blocks.Sources.BooleanStep
booleanStep(startTime
=
0.5
)
annotation (Placement(transformation(extent={{-60,-10},{-40,10}})));
Modelica.Electrical.Analog.Basic.Resistor
r3(R
=
1
)
annotation(Placement(transformation(extent={{-10,-10},{10,10}},
rotation=270,
origin={80,20})));
Modelica.Electrical.Analog.Basic.Resistor
r4(R
=
2
)
annotation(Placement(transformation(extent={{-10,-10},{10,10}},
rotation=270,
origin={80,-20})));
equation
connect
(ground.p, constantVoltage.n)
annotation (Line(points={{-10,-80},{-80,-80},{-80,-10}}, color={0,0,255}));
connect
(r1.n, r2.p)
annotation (Line(points={{20,10},{20,-10}}, color={0,0,255}));
connect
(r2.n, constantVoltage.n)
annotation (Line(points={{20,-30},{20,-80},{-80,-80},{-80,-10}}, color={0,0,255}));
connect
(constantVoltage.p, twoWay.p)
annotation (Line(points={{-80,10},{-80,40},{-40,40}}, color={0,0,255}));
connect
(twoWay.n2, r1.p)
annotation (Line(points={{-20,40},{20,40},{20,30}}, color={0,0,255}));
connect
(twoWay.n1, r2.p)
annotation (Line(points={{-20,36},{-16,36},{-16,0},{20,0},{20,-10}}, color={0,0,255}));
connect
(booleanStep.y, twoWay.control)
annotation (Line(points={{-39,0},{-30,0},{-30,28}}, color={255,0,255}));
connect
(controlledTwoWay.p, twoWay.p)
annotation (Line(points={{40,60},{-80,60},{-80,40},{-40,40}}, color={0,0,255}));
connect
(controlledTwoWay.control, r2.p)
annotation (Line(points={{50,50},{50,0},{20,0},{20,-10}}, color={0,0,255}));
connect
(controlledTwoWay.n2, r3.p)
annotation (Line(points={{60,60},{80,60},{80,30}}, color={0,0,255}));
connect
(controlledTwoWay.n1, r4.p)
annotation (Line(points={{60,56},{68,56},{68,0},{80,0},{80,-10}}, color={0,0,255}));
connect
(r3.n, r4.p)
annotation (Line(points={{80,10},{80,-10}}, color={0,0,255}));
connect
(r4.n, constantVoltage.n)
annotation (Line(points={{80,-30},{80,-80},{-80,-80},{-80,-10}}, color={0,0,255}));
annotation(experiment(StopTime=1), Documentation(info=
"<html>
<p>
Conversion test for <a href=\"
https://github.com/modelica/ModelicaStandardLibrary/issues/778\
">#778</a>.
</p>
</html>"
));
end
Issue778;
model
Issue2361
"Conversion test for #2361"
extends
Modelica.Icons.Example;
Modelica.Electrical.Analog.Ideal.IdealizedOpAmpLimted
opAmp(
Vps
=
15
,
Vns
=
-
15
,
out(i(start
=
0
, fixed
=
false
)))
annotation (Placement(transformation(extent={{0,-10},{20,10}})));
Modelica.Electrical.Analog.Basic.Ground
ground
annotation(Placement(transformation(extent={{-20,-100},{0,-80}})));
Modelica.Electrical.Analog.Sources.TrapezoidVoltage
vIn(
V
=
10
,
rising
=
0.2
/
10
,
width
=
0.3
/
10
,
falling
=
0.2
/
10
,
period
=
1
/
10
,
nperiod
=
-
1
,
offset
=
-
5
,
startTime
=
-
(vIn.rising
+
vIn.width
/
2
))
annotation(Placement(transformation(extent={{-10,-10},{10,10}}, rotation=270, origin={-80,0})));
Modelica.Electrical.Analog.Sensors.VoltageSensor
vOut
annotation(Placement(transformation(extent={{-10,10},{10,-10}}, rotation=270, origin={50,-20})));
Modelica.Electrical.Analog.Basic.Resistor
r1(R
=
1000
)
annotation(Placement(transformation(extent={{-40,20},{-20,40}})));
Modelica.Electrical.Analog.Basic.Resistor
r2(R
=
2000
)
annotation(Placement(transformation(extent={{20,20},{0,40}})));
equation
connect
(r1.n, r2.n)
annotation(Line(points={{-20,30},{0,30}}, color={0,0,255}));
connect
(r2.n, opAmp.in_n)
annotation(Line(points={{0,30},{-10,30},{-10,6},{0,6}}, color={0,0,255}));
connect
(r2.p, opAmp.out)
annotation(Line(points={{20,30},{30,30},{30,0},{20,0}}, color={0,0,255}));
connect
(ground.p, opAmp.in_p)
annotation(Line(points={{-10,-80},{-10,-6},{0,-6}}, color={0,0,255}));
connect
(vIn.p, r1.p)
annotation(Line(points={{-80,10},{-80,30},{-40,30}}, color={0,0,255}));
connect
(ground.p, vIn.n)
annotation(Line(points={{-10,-80},{-80,-80},{-80,-10}}, color={0,0,255}));
connect
(ground.p, vOut.n)
annotation(Line(points={{-10,-80},{50,-80},{50,-30}}, color={0,0,255}));
connect
(opAmp.out, vOut.p)
annotation(Line(points={{20,0},{50,0},{50,-10}}, color={0,0,255}));
annotation(experiment(StopTime=1), Documentation(info=
"<html>
<p>
Conversion test for <a href=\"
https://github.com/modelica/ModelicaStandardLibrary/issues/2361\
">#2361</a>.
</p>
</html>"
));
end
Issue2361;
model
Issue2786IdealGyrator
"Conversion test for #2786"
extends
Modelica.Icons.Example;
Modelica.Electrical.Analog.Basic.Ground
ground1
annotation (Placement(transformation(extent={{-40,-54},{-20,-34}})));
Modelica.Electrical.Analog.Ideal.IdealGyrator
gyrator(G
=
2
)
annotation (Placement(transformation(extent={{-10,-12},{10,8}})));
Modelica.Electrical.Analog.Sources.ConstantVoltage
v1(V
=
1
)
annotation (Placement(transformation(
extent={{-10,-10},{10,10}},
rotation=270,
origin={-30,0})));
Modelica.Electrical.Analog.Sources.ConstantVoltage
v2(V
=
1
)
annotation (Placement(transformation(
extent={{-10,-10},{10,10}},
rotation=270,
origin={30,0})));
Modelica.Electrical.Analog.Basic.Ground
ground2
annotation (Placement(transformation(extent={{20,-54},{40,-34}})));
equation
connect
(v1.p, gyrator.p1)
annotation (Line(points={{-30,10},{-30,20},{-10,20},{-10,8}}, color={0,0,255}));
connect
(v1.n, gyrator.n1)
annotation (Line(points={{-30,-10},{-30,-20},{-10,-20},{-10,-12}}, color={0,0,255}));
connect
(v1.n, ground1.p)
annotation (Line(points={{-30,-10},{-30,-34}}, color={0,0,255}));
connect
(v2.p, gyrator.p2)
annotation (Line(points={{30,10},{30,20},{10,20},{10,8}}, color={0,0,255}));
connect
(v2.n, gyrator.n2)
annotation (Line(points={{30,-10},{30,-20},{10,-20},{10,-12}}, color={0,0,255}));
connect
(v2.n,ground2. p)
annotation (Line(points={{30,-10},{30,-34}}, color={0,0,255}));
annotation (experiment(StopTime=1),
Documentation(info=
"<html>
<p>
Conversion test for <a href=\"
https://github.com/modelica/ModelicaStandardLibrary/issues/2786\
">#2786</a>.
</p>
</html>"
));
end
Issue2786IdealGyrator;
model
Issue2899Resistor
"Conversion test for #2899"
extends
Modelica.Icons.Example;
Modelica.Electrical.Analog.Basic.Ground
ground
annotation(Placement(transformation(extent={{-30,-20},{-10,0}})));
Modelica.Electrical.Analog.Basic.HeatingResistor
resistor(R_ref
=
10
,
useHeatPort
=
false
)
annotation (Placement(transformation(extent={{0,-10},{20,10}})));
equation
connect
(ground.p, resistor.p)
annotation (Line(points={{-20,0},{-10,0},{-10,0},{0,0}}, color={0,0,255}));
annotation(experiment(StopTime=1), Documentation(info=
"<html>
<p>
Conversion test for <a href=\"
https://github.com/modelica/ModelicaStandardLibrary/issues/2899\
">#2899</a>.
</p>
</html>"
));
end
Issue2899Resistor;
model
Issue2899Diode
"Conversion test for #2899"
extends
Modelica.Icons.Example;
Modelica.Electrical.Analog.Semiconductors.HeatingDiode
diode1(useHeatPort
=
false
, N
=
1.5
)
annotation(Placement(transformation(extent={{-95,40},{-75,60}})));
Modelica.Electrical.Analog.Basic.Ground
ground1
annotation(Placement(transformation(extent={{-130,-5},{-110,15}})));
Modelica.Electrical.Analog.Sources.SineVoltage
sineVoltage1(
V
=
1
, freqHz
=
1
)
annotation(Placement(transformation(origin={-120,35}, extent={{-10,-10},{10,10}}, rotation=270)));
Modelica.Electrical.Analog.Basic.Capacitor
capacitor1(
v(start
=
0
, fixed
=
true
), C
=
1
)
annotation(Placement(transformation(extent={{-55,40},{-35,60}})));
Modelica.Electrical.Analog.Basic.Resistor
resistor1(R
=
1
)
annotation(Placement(transformation(extent={{-55,70},{-35,90}})));
Modelica.Electrical.Analog.Semiconductors.Diode
diode2(useHeatPort
=
false
, Vt
=
0.05
)
annotation(Placement(transformation(extent={{15,40},{35,60}})));
Modelica.Electrical.Analog.Basic.Ground
ground2
annotation(Placement(transformation(extent={{-20,-5},{0,15}})));
Modelica.Electrical.Analog.Sources.SineVoltage
sineVoltage2(
V
=
1
, freqHz
=
1
)
annotation(Placement(transformation(origin={-10,35}, extent={{-10,-10},{10,10}}, rotation=270)));
Modelica.Electrical.Analog.Basic.Capacitor
capacitor2(
v(start
=
0
, fixed
=
true
), C
=
1
)
annotation(Placement(transformation(extent={{55,40},{75,60}})));
Modelica.Electrical.Analog.Basic.Resistor
resistor2(R
=
1
)
annotation(Placement(transformation(extent={{55,70},{75,90}})));
equation
connect
(sineVoltage1.p,diode1.p)
annotation(Line(points={{-120,45},{-120,50},{-100,50},{-95,50}}, color={0,0,255}));
connect
(sineVoltage1.n,ground1.p)
annotation(Line(points={{-120,25},{-120,15}}, color={0,0,255}));
connect
(diode1.n,capacitor1.p)
annotation(Line(points={{-75,50},{-70,50},{-60,50},{-55,50}}, color={0,0,255}));
connect
(resistor1.p,capacitor1.p)
annotation(Line(points={{-55,80},{-60,80},{-60,50},{-55,50}}, color={0,0,255}));
connect
(resistor1.n,capacitor1.n)
annotation(Line(points={{-35,80},{-30,80},{-30,50},{-35,50}}, color={0,0,255}));
connect
(sineVoltage1.n,capacitor1.n)
annotation(Line(points={{-120,25},{-120,20},{-30,20},{-30,50},{-35,50}}, color={0,0,255}));
connect
(sineVoltage2.n,capacitor2.n)
annotation(Line(points={{-10,25},{-10,20},{80,20},{80,50},{75,50}}, color={0,0,255}));
connect
(resistor2.n,capacitor2.n)
annotation(Line(points={{75,80},{80,80},{80,50},{75,50}}, color={0,0,255}));
connect
(resistor2.p,capacitor2.p)
annotation(Line(points={{55,80},{50,80},{50,50},{55,50}}, color={0,0,255}));
connect
(diode2.n,capacitor2.p)
annotation(Line(points={{35,50},{40,50},{50,50},{55,50}}, color={0,0,255}));
connect
(sineVoltage2.n,ground2.p)
annotation(Line(points={{-10,25},{-10,15}}, color={0,0,255}));
connect
(sineVoltage2.p,diode2.p)
annotation(Line(points={{-10,45},{-10,50},{10,50},{15,50}}, color={0,0,255}));
annotation(experiment(StopTime=5), Documentation(info=
"<html>
<p>
Conversion test for <a href=\"
https://github.com/modelica/ModelicaStandardLibrary/issues/2899\
">#2899</a>.
</p>
</html>"
));
end
Issue2899Diode;
model
Issue2899MOS
"Conversion test for #2899"
extends
Modelica.Icons.Example;
Modelica.Electrical.Analog.Basic.Ground
ground
annotation (Placement(transformation(extent={{-80,-40},{-60,-20}})));
Modelica.Electrical.Analog.Sources.SineVoltage
sinV(V
=
5
, freqHz
=
1
)
annotation (Placement(transformation(origin={-70,0}, extent={{-10,-10},{10,10}}, rotation=270)));
Modelica.Electrical.Analog.Basic.Capacitor
capacitor(C
=
0.00001
, v(start
=
0
, fixed
=
true
))
annotation (Placement(transformation(origin={30,10}, extent={{-10,-10},{10,10}}, rotation=270)));
Modelica.Thermal.HeatTransfer.Components.HeatCapacitor
heatCapacitor(C
=
0.01
)
annotation (Placement(transformation(origin={70,-60}, extent={{-10,-10},{10,10}}, rotation=270)));
Modelica.Thermal.HeatTransfer.Components.ThermalConductor
tc1(G
=
0.01
)
annotation (Placement(transformation(extent={{0,-50},{20,-30}})));
Modelica.Electrical.Analog.Semiconductors.HeatingPMOS
pMOS(useHeatPort
=
true
)
annotation (Placement(transformation(extent={{-40,40},{-20,60}})));
Modelica.Electrical.Analog.Semiconductors.HeatingNMOS
nMOS(useHeatPort
=
true
)
annotation (Placement(transformation(extent={{-40,0},{-20,20}})));
Modelica.Electrical.Analog.Sources.RampVoltage
rampV(V
=
5
, duration
=
1e-2
)
annotation (Placement(transformation(origin={50,50}, extent={{-10,-10},{10,10}}, rotation=270)));
Modelica.Thermal.HeatTransfer.Components.ThermalConductor
tc2(G
=
0.01
)
annotation (Placement(transformation(extent={{0,-90},{20,-70}})));
Modelica.Thermal.HeatTransfer.Sources.FixedTemperature
fixedT(T
=
300
)
annotation (Placement(transformation(origin={90,-30}, extent={{-10,-10},{10,10}}, rotation=180)));
Modelica.Thermal.HeatTransfer.Components.ThermalConductor
tc3(G
=
0.01
)
annotation (Placement(transformation(extent={{50,-40},{70,-20}})));
initial equation
heatCapacitor.T
=
293.15
;
equation
connect
(sinV.n, ground.p)
annotation (Line(points={{-70,-10},{-70,-20}}, color={0,0,255}));
connect
(capacitor.n, ground.p)
annotation (Line(points={{30,0},{30,-20},{-70,-20}}, color={0,0,255}));
connect
(pMOS.S, nMOS.D)
annotation (Line(points={{-20,44},{-20,16}}, color={0,0,255}));
connect
(nMOS.D, capacitor.p)
annotation (Line(points={{-20,16},{-20,20},{30,20}}, color={0,0,255}));
connect
(nMOS.B, nMOS.S)
annotation (Line(points={{-20,10},{-20,4}}, color={0,0,255}));
connect
(nMOS.S, ground.p)
annotation (Line(points={{-20,4},{-20,-20},{-70,-20}}, color={0,0,255}));
connect
(pMOS.B, pMOS.D)
annotation (Line(points={{-20,50},{-20,56}}, color={0,0,255}));
connect
(rampV.p, pMOS.D)
annotation (Line(points={{50,60},{-20,60},{-20,56}}, color={0,0,255}));
connect
(rampV.n, ground.p)
annotation (Line(points={{50,40},{50,-20},{-70,-20}}, color={0,0,255}));
connect
(tc1.port_b, heatCapacitor.port)
annotation (Line(points={{20,-40},{40,-40},{40,-60},{60,-60}}, color={191,0,0}));
connect
(tc2.port_b, heatCapacitor.port)
annotation (Line(points={{20,-80},{40,-80},{40,-60},{60,-60}}, color={191,0,0}));
connect
(tc1.port_a, pMOS.heatPort)
annotation (Line(points={{0,-40},{-10,-40},{-10,40},{-30,40}}, color={191,0,0}));
connect
(tc2.port_a, nMOS.heatPort)
annotation (Line(points={{0,-80},{-30,-80},{-30,0}}, color={191,0,0}));
connect
(tc3.port_b, fixedT.port)
annotation (Line(points={{70,-30},{80,-30}}, color={191,0,0}));
connect
(tc3.port_a, heatCapacitor.port)
annotation (Line(points={{50,-30},{40,-30},{40,-60},{60,-60}}, color={191,0,0}));
connect
(sinV.p, nMOS.G)
annotation (Line(points={{-70,10},{-54,10},{-54,4},{-40,4}}, color={0,0,255}));
connect
(pMOS.G, sinV.p)
annotation (Line(points={{-40,44},{-48,44},{-48,44},{-54,44},{-54,10},{-70,10}}, color={0,0,255}));
annotation(experiment(StopTime=5), Documentation(info=
"<html>
<p>
Conversion test for <a href=\"
https://github.com/modelica/ModelicaStandardLibrary/issues/2899\
">#2899</a>.
</p>
</html>"
));
end
Issue2899MOS;
model
Issue2899NPN
"Conversion test for #2899"
extends
Modelica.Icons.Example;
Modelica.Electrical.Analog.Semiconductors.HeatingNPN
npn(useHeatPort
=
true
)
annotation (Placement(transformation(extent={{-2,40},{18,60}})));
Modelica.Electrical.Analog.Basic.Ground
ground
annotation (Placement(transformation(extent={{-42,12},{-22,32}})));
Modelica.Thermal.HeatTransfer.Components.ThermalConductor
tc(G
=
0.01
)
annotation (Placement(transformation(origin={8,22}, extent={{-10,-10},{10,10}}, rotation=270)));
Modelica.Thermal.HeatTransfer.Components.HeatCapacitor
heatCapacitor(C
=
0.1
)
annotation (Placement(transformation(origin={8,-6}, extent={{-10,-10},{10,10}}, rotation=180)));
initial equation
heatCapacitor.T
=
293.15
;
equation
connect
(npn.B, ground.p)
annotation (Line(points={{-2,50},{-26,50},{-26,32},{-32,32}}, color={0,0,255}));
connect
(npn.E, ground.p)
annotation (Line(points={{18,44},{-14,44},{-14,32},{-32,32}}, color={0,0,255}));
connect
(npn.C, ground.p)
annotation (Line(points={{18,56},{-16,56},{-16,32},{-32,32}}, color={0,0,255}));
connect
(npn.heatPort, tc.port_a)
annotation (Line(points={{8,40},{8,32}}, color={191,0,0}));
connect
(tc.port_b, heatCapacitor.port)
annotation (Line(points={{8,12},{8,4}}, color={191,0,0}));
annotation(experiment(StopTime=1), Documentation(info=
"<html>
<p>
Conversion test for <a href=\"
https://github.com/modelica/ModelicaStandardLibrary/issues/2899\
">#2899</a>.
</p>
</html>"
));
end
Issue2899NPN;
model
Issue2899PNP
"Conversion test for #2899"
extends
Modelica.Icons.Example;
Modelica.Electrical.Analog.Semiconductors.HeatingPNP
pnp
annotation (Placement(transformation(extent={{-2,40},{18,60}})));
Modelica.Electrical.Analog.Basic.Ground
ground
annotation (Placement(transformation(extent={{-42,12},{-22,32}})));
Modelica.Thermal.HeatTransfer.Components.ThermalConductor
tc(G
=
0.01
)
annotation (Placement(transformation(origin={8,22}, extent={{-10,-10},{10,10}}, rotation=270)));
Modelica.Thermal.HeatTransfer.Components.HeatCapacitor
heatCapacitor(C
=
0.1
)
annotation (Placement(transformation(origin={8,-6}, extent={{-10,-10},{10,10}}, rotation=180)));
initial equation
heatCapacitor.T
=
293.15
;
equation
connect
(pnp.B, ground.p)
annotation (Line(points={{-2,50},{-26,50},{-26,32},{-32,32}}, color={0,0,255}));
connect
(pnp.E, ground.p)
annotation (Line(points={{18,44},{-14,44},{-14,32},{-32,32}}, color={0,0,255}));
connect
(pnp.C, ground.p)
annotation (Line(points={{18,56},{-16,56},{-16,32},{-32,32}}, color={0,0,255}));
connect
(pnp.heatPort, tc.port_a)
annotation (Line(points={{8,40},{8,32}}, color={191,0,0}));
connect
(tc.port_b, heatCapacitor.port)
annotation (Line(points={{8,12},{8,4}}, color={191,0,0}));
annotation(experiment(StopTime=1), Documentation(info=
"<html>
<p>
Conversion test for <a href=\"
https://github.com/modelica/ModelicaStandardLibrary/issues/2899\
">#2899</a>.
</p>
</html>"
));
end
Issue2899PNP;
model
Issue3024
"Conversion test for #3024"
extends
Modelica.Icons.Example;
import
pi
=
Modelica.Electrical.Analog.Basic.OpAmpDetailed.Pi;
annotation(experiment(StopTime=1), Documentation(info=
"<html>
<p>
Conversion test for <a href=\"
https://github.com/modelica/ModelicaStandardLibrary/issues/3024\
">#3024</a>.
</p>
</html>"
));
end
Issue3024;
model
Issue3035
"Conversion test for #3035"
extends
Modelica.Icons.Example;
Modelica.Blocks.Sources.Clock
clock(
offset
=
-
0.5
,
startTime
=
0.5
);
Modelica.Electrical.Analog.Basic.Ground
ground
annotation (Placement(transformation(extent={{-10,-80},{10,-60}})));
Modelica.Electrical.Analog.Sources.SineVoltage
sineVoltage(
V
=
1
,
phase
=
0
,
freqHz
=
1
,
offset
=
0
,
startTime
=
0.1
)
annotation (Placement(transformation(extent={{-10,-10},{10,10}}, rotation=270, origin={-40,30})));
Modelica.Electrical.Analog.Sources.CosineVoltage
cosineVoltage(
V
=
1
,
phase
=
0
,
freqHz
=
1
,
offset
=
0
,
startTime
=
0.1
)
annotation (Placement(transformation(extent={{-10,-10},{10,10}}, rotation=270, origin={-40,0})));
Modelica.Electrical.Analog.Sources.ExpSineVoltage
expSineVoltage(
V
=
1
,
freqHz
=
1
,
phase
=
0
,
damping
=
1
,
offset
=
0
,
startTime
=
0.1
)
annotation (Placement(transformation(extent={{-10,-10},{10,10}}, rotation=270, origin={-40,-30})));
Modelica.Electrical.Analog.Sources.SineCurrent
sineCurrent(
I
=
1
,
phase
=
0
,
freqHz
=
1
,
offset
=
0
,
startTime
=
0.2
)
annotation (Placement(transformation(extent={{-10,-10},{10,10}}, rotation=270, origin={20,0})));
Modelica.Electrical.Analog.Sources.CosineCurrent
cosineCurrent(
I
=
1
,
phase
=
0
,
freqHz
=
1
,
offset
=
0
,
startTime
=
0.2
)
annotation (Placement(transformation(extent={{-10,-10},{10,10}}, rotation=270, origin={50,0})));
Modelica.Electrical.Analog.Sources.ExpSineCurrent
expSineCurrent(
I
=
1
,
freqHz
=
1
,
phase
=
0
,
damping
=
1
,
offset
=
0
,
startTime
=
0.2
)
annotation (Placement(transformation(extent={{-10,-10},{10,10}}, rotation=270, origin={80,0})));
equation
connect
(sineVoltage.p, sineCurrent.p)
annotation (Line(points={{-40,40},{-40,50},{20,50},{20,10}}, color={0,0,255}));
connect
(cosineCurrent.p, sineCurrent.p)
annotation (Line(points={{50,10},{50,50},{20,50},{20,10}}, color={0,0,255}));
connect
(expSineCurrent.p, sineCurrent.p)
annotation (Line(points={{80,10},{80,50},{20,50},{20,10}}, color={0,0,255}));
connect
(sineVoltage.n, cosineVoltage.p)
annotation (Line(points={{-40,20},{-40,10}}, color={0,0,255}));
connect
(cosineVoltage.n, expSineVoltage.p)
annotation (Line(points={{-40,-10},{-40,-20}}, color={0,0,255}));
connect
(expSineVoltage.n, ground.p)
annotation (Line(points={{-40,-40},{-40,-50},{0,-50},{0,-60}}, color={0,0,255}));
connect
(sineCurrent.n, ground.p)
annotation (Line(points={{20,-10},{20,-50},{0,-50},{0,-60}}, color={0,0,255}));
connect
(cosineCurrent.n, ground.p)
annotation (Line(points={{50,-10},{50,-50},{0,-50},{0,-60}}, color={0,0,255}));
connect
(expSineCurrent.n, ground.p)
annotation (Line(points={{80,-10},{80,-50},{0,-50},{0,-60}}, color={0,0,255}));
annotation(experiment(StopTime=1, Tolerance=1e-06), Documentation(info=
"<html>
<p>
Conversion test for <a href=\"
https://github.com/modelica/ModelicaStandardLibrary/issues/3035\
">#3035</a>.
</p>
</html>"
));
end
Issue3035;
end
Analog;
package
Digital
extends
Modelica.Icons.ExamplesPackage;
model
Issue758
"Conversion test for #758"
extends
Modelica.Icons.Example;
Modelica.Electrical.Digital.Sources.Set
set(
x
=
Modelica.Electrical.Digital.Interfaces.Logic.'U');
Modelica.Electrical.Digital.Converters.LogicToXO1
logicToXO1_1(n
=
1
);
Modelica.Electrical.Digital.Converters.LogicToXO1Z
logicToXO1Z(n
=
1
);
equation
connect
(set.y, logicToXO1_1.x[
1
]);
connect
(set.y, logicToXO1Z.x[
1
]);
annotation(experiment(StopTime=1), Documentation(info=
"<html>
<p>
Conversion test for <a href=\"
https://github.com/modelica/ModelicaStandardLibrary/issues/758\
">#758</a>.
</p>
</html>"
));
end
Issue758;
model
Issue2945
"Conversion test for #2945"
extends
Modelica.Icons.Example;
Modelica.Electrical.Digital.Sources.Clock
clock(
startTime
=
0
,
period
=
1
,
width
=
50
);
annotation(experiment(StopTime=1), Documentation(info=
"<html>
<p>
Conversion test for <a href=\"
https://github.com/modelica/ModelicaStandardLibrary/issues/2945\
">#2945</a>.
</p>
</html>"
));
end
Issue2945;
end
Digital;
package
QuasiStatic
extends
Modelica.Icons.ExamplesPackage;
model
Issue1189
"Conversion test for #1189"
extends
Modelica.Icons.Example;
import
Modelica.Electrical.QuasiStationary.Types.Reference;
parameter
Reference r
=
Modelica.Electrical.QuasiStationary.Types.Reference(
0
);
annotation(experiment(StopTime=1), Documentation(info=
"<html>
<p>
Conversion test for <a href=\"
https://github.com/modelica/ModelicaStandardLibrary/issues/1189\
">#1189</a>.
</p>
</html>"
));
end
Issue1189;
model
Issue2693
"Conversion test for #2693"
extends
Modelica.Icons.Example;
Modelica.Electrical.QuasiStationary.MultiPhase.Basic.VariableConductor
variableConductor(variableResistor
"Variable Conductor"
);
Modelica.Blocks.Sources.RealExpression
realExpression[
3
](
each
y
=
time
+
1
);
Modelica.Electrical.QuasiStationary.MultiPhase.Sources.VoltageSource
voltageSource;
equation
connect
(realExpression.y, variableConductor.G_ref);
connect
(variableConductor.plug_n, voltageSource.plug_p);
connect
(voltageSource.plug_n, variableConductor.plug_p);
annotation(experiment(StopTime=1), Documentation(info=
"<html>
<p>
Conversion test for <a href=\"
https://github.com/modelica/ModelicaStandardLibrary/issues/2693\
">#2693</a>.
</p>
</html>"
));
end
Issue2693;
model
Issue2993
"Conversion test for #2993"
extends
Modelica.Icons.Example;
import
C1
=
Modelica.Electrical.QuasiStationary.MultiPhase;
import
C2
=
Modelica.Electrical.QuasiStationary.MultiPhase.Blocks.SingleToMultiPhase;
annotation(experiment(StopTime=1), Documentation(info=
"<html>
<p>
Conversion test for <a href=\"
https://github.com/modelica/ModelicaStandardLibrary/issues/2993\
">#2993</a>.
</p>
</html>"
));
end
Issue2993;
model
Issue3022SinglePhase
"Conversion test for #3022"
extends
Modelica.Icons.Example;
import
Modelica.Electrical.QuasiStationary.SinglePhase.Interfaces.RelativeSensor;
constant
Integer
m
=
3
"Number of phases"
;
import
Modelica.Constants.pi;
parameter
Modelica.SIunits.Voltage
VRMS
=
100
"Nominal RMS voltage per phase"
;
parameter
Modelica.SIunits.Frequency
f
=
50
"Frequency"
;
parameter
Modelica.SIunits.Resistance
R
=
1
/
sqrt
(
2
)
"Load resistance"
;
parameter
Modelica.SIunits.Inductance
L
=
1
/
sqrt
(
2
)
/
(
2
*
pi
*
f)
"Load inductance"
;
final
parameter
Modelica.SIunits.Impedance
Z
=
sqrt
(R
^
2
+
(
2
*
pi
*
f
*
L)
^
2
)
"Load impedance"
;
final
parameter
Modelica.SIunits.Current
IRMS
=
VRMS
/
Z
"Steady state RMS current"
;
final
parameter
Modelica.SIunits.ActivePower
P
=
3
*
R
*
IRMS
^
2
"Total active power"
;
final
parameter
Modelica.SIunits.ReactivePower
Q
=
3
*
(
2
*
pi
*
f
*
L)
*
IRMS
^
2
"Total reactive power"
;
final
parameter
Modelica.SIunits.ApparentPower
S
=
3
*
Z
*
IRMS
^
2
"Total apparent power"
;
Modelica.SIunits.Angle
reference
=
referenceSensor.y
"Reference angle"
;
Modelica.SIunits.AbsoluteActivity
frequency
=
frequencySensor.y
"Frequency"
;
Modelica.SIunits.ComplexElectricPotential
potential
=
potentialSensor.y
"Potential"
;
Modelica.SIunits.ComplexVoltage
voltage
=
voltageSensor.y
"Voltage"
;
Modelica.SIunits.ComplexCurrent
current
=
currentSensor.y
"Current"
;
Modelica.SIunits.ComplexPower
power
=
powerSensor.y
"Power"
;
Modelica.Electrical.QuasiStationary.SinglePhase.Basic.Ground
ground
annotation (Placement(
transformation(
origin={-20,-100},
extent={{-10,-10},{10,10}})));
Modelica.Blocks.Math.Gain
gainReferenceSensor(k
=
1
)
annotation (Placement(transformation(extent={{-70,-20},{-90,0}})));
Modelica.ComplexBlocks.ComplexMath.Gain
gainVoltageSensor(k
=
Complex(
1
,
0
))
annotation (Placement(transformation(extent={{-70,-60},{-90,-40}})));
Modelica.Electrical.QuasiStationary.SinglePhase.Sources.VoltageSource
voltageSource(
gamma(start
=
0
, fixed
=
true
),
f
=
50
,
V
=
100
,
phi
=
0
)
annotation (Placement(transformation(
extent={{-10,-10},{10,10}},
rotation=270,
origin={-20,-50})));
Modelica.Electrical.QuasiStationary.SinglePhase.Sources.CurrentSource
currentSource(
gamma(fixed
=
true
, start
=
0
),
f
=
50
,
I
=
1
,
phi
=
0
)
annotation (Placement(transformation(
extent={{-10,-10},{10,10}},
rotation=270,
origin={20,-50})));
Modelica.Electrical.QuasiStationary.SinglePhase.Sensors.CurrentSensor
currentSensor
annotation (Placement(transformation(
extent={{10,-10},{-10,10}},
rotation=90,
origin={20,-20})));
Modelica.Electrical.QuasiStationary.SinglePhase.Sensors.PowerSensor
powerSensor
annotation (Placement(transformation(
extent={{10,-10},{-10,10}},
rotation=90,
origin={20,10})));
Modelica.Electrical.QuasiStationary.SinglePhase.Sensors.VoltageSensor
voltageSensor
annotation (Placement(transformation(
extent={{-10,-10},{10,10}},
rotation=270,
origin={-40,-50})));
Modelica.Electrical.QuasiStationary.SinglePhase.Sensors.ReferenceSensor
referenceSensor
annotation (Placement(transformation(extent={{-40,-20},{-60,0}})));
Modelica.Electrical.QuasiStationary.SinglePhase.Sensors.PotentialSensor
potentialSensor
annotation (Placement(transformation(extent={{-40,40},{-60,60}})));
Modelica.Electrical.QuasiStationary.SinglePhase.Sensors.FrequencySensor
frequencySensor
annotation (Placement(transformation(extent={{-40,10},{-60,30}})));
Modelica.Blocks.Math.Gain
gainFrequencySensor(k
=
1
)
annotation (Placement(transformation(extent={{-70,10},{-90,30}})));
Modelica.ComplexBlocks.ComplexMath.Gain
gainCurrentSensor(k
=
Complex(
1
,
0
))
annotation (Placement(transformation(extent={{60,-30},{80,-10}})));
Modelica.ComplexBlocks.ComplexMath.Gain
gainPowerSensor(k
=
Complex(
1
,
0
))
annotation (Placement(transformation(extent={{60,10},{80,30}})));
Modelica.ComplexBlocks.ComplexMath.Gain
gainPotentialSensor(k
=
Complex(
1
,
0
))
annotation (Placement(transformation(extent={{-70,40},{-90,60}})));
equation
connect
(voltageSource.pin_n, ground.pin)
annotation (Line(points={{-20,-60},{-20,-90}}, color={85,170,255}));
connect
(voltageSource.pin_n, currentSource.pin_n)
annotation (Line(points={{-20,-60},{-20,-70},{20,-70},{20,-60}}, color={85,170,255}));
connect
(voltageSource.pin_p, powerSensor.currentP)
annotation (Line(points={{-20,-40},{-20,50},{20,50},{20,20}}, color={85,170,255}));
connect
(powerSensor.currentN, currentSensor.pin_p)
annotation (Line(points={{20,0},{20,-10}}, color={85,170,255}));
connect
(currentSensor.pin_n, currentSource.pin_p)
annotation (Line(points={{20,-30},{20,-40}}, color={85,170,255}));
connect
(powerSensor.voltageP, powerSensor.currentP)
annotation (Line(points={{10,10},{10,20},{20,20}}, color={85,170,255}));
connect
(powerSensor.voltageN, currentSource.pin_n)
annotation (Line(points={{30,10},{40,10},{40,-70},{20,-70},{20,-60}}, color={85,170,255}));
connect
(powerSensor.y, gainPowerSensor.u)
annotation (Line(points={{31,20},{58,20}}, color={85,170,255}));
connect
(currentSensor.y, gainCurrentSensor.u)
annotation (Line(points={{31,-20},{58,-20}}, color={85,170,255}));
connect
(referenceSensor.y, gainReferenceSensor.u)
annotation (Line(points={{-61,-10},{-68,-10}}, color={0,0,127}));
connect
(frequencySensor.y, gainFrequencySensor.u)
annotation (Line(points={{-61,20},{-68,20}}, color={0,0,127}));
connect
(frequencySensor.pin, powerSensor.currentP)
annotation (Line(points={{-40,20},{-20,20},{-20,50},{20,50},{20,20}}, color={85,170,255}));
connect
(potentialSensor.pin, powerSensor.currentP)
annotation (Line(points={{-40,50},{20,50},{20,20}}, color={85,170,255}));
connect
(referenceSensor.pin, powerSensor.currentP)
annotation (Line(points={{-40,-10},{-20,-10},{-20,50},{20,50},{20,20}}, color={85,170,255}));
connect
(gainVoltageSensor.u, voltageSensor.y)
annotation (Line(points={{-68,-50},{-51,-50}}, color={85,170,255}));
connect
(voltageSensor.pin_p, powerSensor.currentP)
annotation (Line(points={{-40,-40},{-40,-28},{-20,-28},{-20,50},{20,50},{20,20}}, color={85,170,255}));
connect
(voltageSensor.pin_n, ground.pin)
annotation (Line(points={{-40,-60},{-40,-70},{-20,-70},{-20,-90}}, color={85,170,255}));
connect
(gainPotentialSensor.u, potentialSensor.y)
annotation (Line(points={{-68,50},{-61,50}}, color={85,170,255}));
annotation(experiment(StopTime=1), Documentation(info=
"<html>
<p>
Conversion test for <a href=\"
https://github.com/modelica/ModelicaStandardLibrary/issues/3022\
">#3022</a>.
</p>
</html>"
));
end
Issue3022SinglePhase;
model
Issue3022MultiPhase
"Conversion test for #3022"
extends
Modelica.Icons.Example;
import
Modelica.Electrical.QuasiStationary.MultiPhase.Interfaces.RelativeSensor;
constant
Integer
m
=
3
"Number of phases"
;
import
Modelica.Constants.pi;
parameter
Modelica.SIunits.Voltage
VRMS
=
100
"Nominal RMS voltage per phase"
;
parameter
Modelica.SIunits.Frequency
f
=
50
"Frequency"
;
parameter
Modelica.SIunits.Resistance
R
=
1
/
sqrt
(
2
)
"Load resistance"
;
parameter
Modelica.SIunits.Inductance
L
=
1
/
sqrt
(
2
)
/
(
2
*
pi
*
f)
"Load inductance"
;
final
parameter
Modelica.SIunits.Impedance
Z
=
sqrt
(R
^
2
+
(
2
*
pi
*
f
*
L)
^
2
)
"Load impedance"
;
final
parameter
Modelica.SIunits.Current
IRMS
=
VRMS
/
Z
"Steady state RMS current"
;
final
parameter
Modelica.SIunits.ActivePower
P
=
3
*
R
*
IRMS
^
2
"Total active power"
;
final
parameter
Modelica.SIunits.ReactivePower
Q
=
3
*
(
2
*
pi
*
f
*
L)
*
IRMS
^
2
"Total reactive power"
;
final
parameter
Modelica.SIunits.ApparentPower
S
=
3
*
Z
*
IRMS
^
2
"Total apparent power"
;
Modelica.SIunits.Angle
reference
=
referenceSensor.y
"Reference angle"
;
Modelica.SIunits.AbsoluteActivity
frequency
=
frequencySensor.y
"Frequency"
;
Modelica.SIunits.ComplexElectricPotential
potential[m]
=
potentialSensor.y
"Potential"
;
Modelica.SIunits.ComplexVoltage
voltage[m]
=
voltageSensor.y
"Voltage"
;
Modelica.SIunits.ComplexCurrent
current[m]
=
currentSensor.y
"Current"
;
Modelica.SIunits.ComplexPower
power
=
powerSensor.y
"Power"
;
Modelica.Electrical.QuasiStationary.MultiPhase.Sources.VoltageSource
sineVoltage(
final
m
=
m,
f
=
f,
V
=
fill
(VRMS, m),
gamma(fixed
=
true
, start
=
0
))
annotation (Placement(transformation(
origin={-20,-30},
extent={{10,-10},{-10,10}},
rotation=90)));
Modelica.Electrical.QuasiStationary.MultiPhase.Basic.Star
star(
final
m
=
m)
annotation (
Placement(transformation(
extent={{10,-10},{-10,10}},
rotation=90,
origin={-20,-70})));
Modelica.Electrical.QuasiStationary.SinglePhase.Basic.Ground
ground
annotation (Placement(
transformation(
origin={-20,-100},
extent={{-10,-10},{10,10}})));
Modelica.Electrical.QuasiStationary.MultiPhase.Basic.Resistor
resistor(m
=
m, R_ref
=
fill
(R, m))
annotation (Placement(transformation(
extent={{-10,-10},{10,10}},
rotation=270,
origin={20,-20})));
Modelica.Electrical.QuasiStationary.MultiPhase.Basic.Inductor
inductor(m
=
m, L
=
fill
(L, m))
annotation (Placement(transformation(
extent={{-10,-10},{10,10}},
rotation=270,
origin={20,-50})));
Modelica.Electrical.QuasiStationary.MultiPhase.Basic.Star
starLoad(m
=
m)
annotation (
Placement(transformation(
extent={{-10,-10},{10,10}},
rotation=270,
origin={20,-80})));
Modelica.Electrical.QuasiStationary.MultiPhase.Sensors.CurrentQuasiRMSSensor
currentQuasiRMSSensor(m
=
m)
annotation (Placement(transformation(
extent={{-10,10},{10,-10}},
rotation=90,
origin={-20,40})));
Modelica.Blocks.Math.Feedback
feedbackI
annotation (Placement(transformation(extent={{-70,30},{-90,50}})));
Modelica.Blocks.Sources.Constant
constI(k
=
IRMS)
annotation (Placement(
transformation(
extent={{10,-10},{-10,10}},
rotation=270,
origin={-80,10})));
Modelica.Electrical.QuasiStationary.MultiPhase.Sensors.VoltageQuasiRMSSensor
voltageQuasiRMSSensor(m
=
m)
annotation (Placement(transformation(
extent={{-10,-10},{10,10}},
rotation=270,
origin={-50,-30})));
Modelica.Blocks.Math.Feedback
feedbackV
annotation (Placement(transformation(extent={{-70,-40},{-90,-20}})));
Modelica.Blocks.Sources.Constant
constV(k
=
VRMS)
annotation (Placement(
transformation(
extent={{10,-10},{-10,10}},
rotation=270,
origin={-80,-60})));
Modelica.Electrical.QuasiStationary.MultiPhase.Sensors.PowerSensor
powerSensor(m
=
m)
annotation (Placement(transformation(
extent={{10,-10},{-10,10}},
rotation=90,
origin={20,10})));
Modelica.ComplexBlocks.ComplexMath.ComplexToReal
complexToReal
annotation (Placement(transformation(extent={{40,30},{60,10}})));
Modelica.Blocks.Math.Feedback
feedbackP
annotation (Placement(transformation(extent={{80,-10},{100,10}})));
Modelica.Blocks.Sources.RealExpression
realExpression(y
=
Modelica.Electrical.QuasiStationary.MultiPhase.Functions.activePower(
voltageQuasiRMSSensor.v, currentQuasiRMSSensor.i))
annotation (
Placement(transformation(
extent={{10,-10},{-10,10}},
rotation=180,
origin={70,-20})));
Modelica.Electrical.QuasiStationary.MultiPhase.Sensors.AronSensor
aronSensor
annotation (
Placement(transformation(
extent={{10,-10},{-10,10}},
rotation=90,
origin={20,40})));
Modelica.Blocks.Math.Feedback
feedbackPAron
annotation (Placement(transformation(extent={{80,30},{100,50}})));
Modelica.Electrical.QuasiStationary.MultiPhase.Sensors.ReactivePowerSensor
reactivePowerSensor
annotation (Placement(transformation(
extent={{10,-10},{-10,10}},
rotation=90,
origin={20,70})));
Modelica.Blocks.Math.Feedback
feedbackQ
annotation (Placement(transformation(extent={{40,60},{60,80}})));
Modelica.Electrical.QuasiStationary.MultiPhase.Sensors.ReferenceSensor
referenceSensor
annotation (Placement(transformation(extent={{-40,80},{-60,100}})));
Modelica.Electrical.QuasiStationary.MultiPhase.Sensors.FrequencySensor
frequencySensor
annotation (Placement(transformation(extent={{-40,50},{-60,70}})));
Modelica.Electrical.QuasiStationary.MultiPhase.Sensors.PotentialSensor
potentialSensor
annotation (Placement(transformation(extent={{20,80},{40,100}})));
Modelica.Electrical.QuasiStationary.MultiPhase.Sensors.CurrentSensor
currentSensor
annotation (Placement(transformation(
extent={{-10,10},{10,-10}},
rotation=90,
origin={-20,0})));
Modelica.Electrical.QuasiStationary.MultiPhase.Sensors.VoltageSensor
voltageSensor
annotation (Placement(transformation(
extent={{-10,10},{10,-10}},
rotation=270,
origin={50,-50})));
Modelica.ComplexBlocks.ComplexMath.Gain
gainCurrentSensor[m](k
=
fill
(Complex(
1
,
0
), m))
annotation (Placement(transformation(extent={{-40,-10},{-60,10}})));
Modelica.ComplexBlocks.ComplexMath.Gain
gainVoltageSensor[m](k
=
fill
(Complex(
1
,
0
), m))
annotation (Placement(transformation(extent={{70,-60},{90,-40}})));
Modelica.Blocks.Math.Gain
gainFrequencySensor(k
=
1
)
annotation (Placement(transformation(extent={{-72,50},{-92,70}})));
Modelica.Blocks.Math.Gain
gainReferenceSensor(k
=
1
)
annotation (Placement(transformation(extent={{-72,80},{-92,100}})));
Modelica.ComplexBlocks.ComplexMath.Gain
gainPotentialSensor[m](k
=
fill
(Complex(
1
,
0
), m))
annotation (Placement(transformation(extent={{60,80},{80,100}})));
equation
connect
(feedbackV.u1, voltageQuasiRMSSensor.V)
annotation (Line(
points={{-72,-30},{-61,-30}},
color={0,0,127}));
connect
(constV.y, feedbackV.u2)
annotation (Line(
points={{-80,-49},{-80,-38}},
color={0,0,127}));
connect
(realExpression.y, feedbackP.u2)
annotation (Line(points={{81,-20},{90,-20},{90,-8}},
color={0,0,127}));
connect
(voltageQuasiRMSSensor.plug_p, sineVoltage.plug_p)
annotation (Line(points={{-50,-20},{-20,-20}},
color={85,170,255}));
connect
(voltageQuasiRMSSensor.plug_n, sineVoltage.plug_n)
annotation (Line(points={{-50,-40},{-20,-40}},
color={85,170,255}));
connect
(powerSensor.currentP, aronSensor.plug_n)
annotation (Line(points={{20,20},{20,30}}, color={85,170,255}));
connect
(powerSensor.currentP, powerSensor.voltageP)
annotation (Line(points={{20,20},{10,20},{10,10}},
color={85,170,255}));
connect
(powerSensor.currentN, resistor.plug_p)
annotation (Line(points={{20,0},{20,-10}}, color={85,170,255}));
connect
(resistor.plug_n, inductor.plug_p)
annotation (Line(points={{20,-30},{20,-40}}, color={85,170,255}));
connect
(inductor.plug_n, starLoad.plug_p)
annotation (Line(points={{20,-60},{20,-70}}, color={85,170,255}));
View remainder of file in raw view
Back
|
FazBrowse Home
|
New Git URL