-
Notifications
You must be signed in to change notification settings - Fork 0
/
ExampleDemo1.mdl
executable file
·1124 lines (1124 loc) · 29.8 KB
/
ExampleDemo1.mdl
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
Model {
Name "ExampleDemo1"
Version 5.0
SaveDefaultBlockParams on
SampleTimeColors off
LibraryLinkDisplay "none"
WideLines off
ShowLineDimensions off
ShowPortDataTypes off
ShowLoopsOnError on
IgnoreBidirectionalLines off
ShowStorageClass off
ExecutionOrder off
RecordCoverage off
CovPath "/"
CovSaveName "covdata"
CovMetricSettings "dw"
CovNameIncrementing off
CovHtmlReporting on
covSaveCumulativeToWorkspaceVar on
CovSaveSingleToWorkspaceVar on
CovCumulativeVarName "covCumulativeData"
CovCumulativeReport off
DataTypeOverride "UseLocalSettings"
MinMaxOverflowLogging "UseLocalSettings"
MinMaxOverflowArchiveMode "Overwrite"
BlockNameDataTip off
BlockParametersDataTip off
BlockDescriptionStringDataTip off
ToolBar on
StatusBar on
BrowserShowLibraryLinks off
BrowserLookUnderMasks off
Created "Thu Apr 24 02:34:47 2003"
UpdateHistory "UpdateHistoryNever"
ModifiedByFormat "%<Auto>"
LastModifiedBy "Praveen"
ModifiedDateFormat "%<Auto>"
LastModifiedDate "Fri Apr 25 16:54:54 2003"
ModelVersionFormat "1.%<AutoIncrement:194>"
ConfigurationManager "None"
SimParamPage "Solver"
LinearizationMsg "none"
Profile off
ParamWorkspaceSource "MATLABWorkspace"
AccelSystemTargetFile "accel.tlc"
AccelTemplateMakefile "accel_default_tmf"
AccelMakeCommand "make_rtw"
TryForcingSFcnDF off
ExtModeMexFile "ext_comm"
ExtModeBatchMode off
ExtModeTrigType "manual"
ExtModeTrigMode "normal"
ExtModeTrigPort "1"
ExtModeTrigElement "any"
ExtModeTrigDuration 1000
ExtModeTrigHoldOff 0
ExtModeTrigDelay 0
ExtModeTrigDirection "rising"
ExtModeTrigLevel 0
ExtModeArchiveMode "off"
ExtModeAutoIncOneShot off
ExtModeIncDirWhenArm off
ExtModeAddSuffixToVar off
ExtModeWriteAllDataToWs off
ExtModeArmWhenConnect on
ExtModeSkipDownloadWhenConnect off
ExtModeLogAll on
ExtModeAutoUpdateStatusClock on
BufferReuse on
RTWExpressionDepthLimit 5
SimulationMode "normal"
Solver "ode45"
SolverMode "Auto"
StartTime "0.0"
StopTime "1.0"
MaxOrder 5
MaxStep "auto"
MinStep "auto"
MaxNumMinSteps "-1"
InitialStep "auto"
FixedStep "auto"
RelTol "1e-3"
AbsTol "auto"
OutputOption "RefineOutputTimes"
OutputTimes "[]"
Refine "1"
LoadExternalInput off
ExternalInput "[t, u]"
LoadInitialState off
InitialState "xInitial"
SaveTime on
TimeSaveName "tout"
SaveState off
StateSaveName "xout"
SaveOutput on
OutputSaveName "yout"
SaveFinalState off
FinalStateName "xFinal"
SaveFormat "Array"
Decimation "1"
LimitDataPoints on
MaxDataPoints "1000"
SignalLoggingName "sigsOut"
ConsistencyChecking "none"
ArrayBoundsChecking "none"
AlgebraicLoopMsg "warning"
BlockPriorityViolationMsg "warning"
MinStepSizeMsg "warning"
InheritedTsInSrcMsg "warning"
DiscreteInheritContinuousMsg "warning"
MultiTaskRateTransMsg "error"
SingleTaskRateTransMsg "none"
CheckForMatrixSingularity "none"
IntegerOverflowMsg "warning"
Int32ToFloatConvMsg "warning"
ParameterDowncastMsg "error"
ParameterOverflowMsg "error"
ParameterPrecisionLossMsg "warning"
UnderSpecifiedDataTypeMsg "none"
UnnecessaryDatatypeConvMsg "none"
VectorMatrixConversionMsg "none"
InvalidFcnCallConnMsg "error"
SignalLabelMismatchMsg "none"
UnconnectedInputMsg "warning"
UnconnectedOutputMsg "warning"
UnconnectedLineMsg "warning"
SfunCompatibilityCheckMsg "none"
RTWInlineParameters off
BlockReductionOpt on
BooleanDataType on
ConditionallyExecuteInputs on
ParameterPooling on
OptimizeBlockIOStorage on
ZeroCross on
AssertionControl "UseLocalSettings"
ProdHWDeviceType "Microprocessor"
ProdHWWordLengths "8,16,32,32"
RTWSystemTargetFile "grt.tlc"
RTWTemplateMakefile "grt_default_tmf"
RTWMakeCommand "make_rtw"
RTWGenerateCodeOnly off
RTWRetainRTWFile off
TLCProfiler off
TLCDebug off
TLCCoverage off
TLCAssertion off
BlockDefaults {
Orientation "right"
ForegroundColor "black"
BackgroundColor "white"
DropShadow off
NamePlacement "normal"
FontName "Helvetica"
FontSize 10
FontWeight "normal"
FontAngle "normal"
ShowName on
}
BlockParameterDefaults {
Block {
BlockType ComplexToMagnitudeAngle
Output "Magnitude and angle"
}
Block {
BlockType Constant
Value "1"
VectorParams1D on
ShowAdditionalParam off
OutDataTypeMode "Inherit from 'Constant value'"
OutDataType "sfix(16)"
ConRadixGroup "Use specified scaling"
OutScaling "2^0"
}
Block {
BlockType Demux
Outputs "4"
DisplayOption "none"
BusSelectionMode off
}
Block {
BlockType Display
Format "short"
Decimation "10"
Floating off
SampleTime "-1"
}
Block {
BlockType Gain
Gain "1"
Multiplication "Element-wise(K.*u)"
ShowAdditionalParam off
ParameterDataTypeMode "Same as input"
ParameterDataType "sfix(16)"
ParameterScalingMode "Best Precision: Matrix-wise"
ParameterScaling "2^0"
OutDataTypeMode "Same as input"
OutDataType "sfix(16)"
OutScaling "2^0"
LockScale off
RndMeth "Floor"
SaturateOnIntegerOverflow on
}
Block {
BlockType Inport
Port "1"
PortDimensions "-1"
SampleTime "-1"
ShowAdditionalParam off
LatchInput off
DataType "auto"
OutDataType "sfix(16)"
OutScaling "2^0"
SignalType "auto"
SamplingMode "auto"
Interpolate on
}
Block {
BlockType Mux
Inputs "4"
DisplayOption "none"
}
Block {
BlockType Outport
Port "1"
OutputWhenDisabled "held"
InitialOutput "[]"
}
Block {
BlockType Product
Inputs "2"
Multiplication "Element-wise(.*)"
ShowAdditionalParam off
InputSameDT on
OutDataTypeMode "Same as first input"
OutDataType "sfix(16)"
OutScaling "2^0"
LockScale off
RndMeth "Floor"
SaturateOnIntegerOverflow on
}
Block {
BlockType RealImagToComplex
Input "Real and imag"
ConstantPart "0"
}
Block {
BlockType Scope
Floating off
ModelBased off
TickLabels "OneTimeTick"
ZoomMode "on"
Grid "on"
TimeRange "auto"
YMin "-5"
YMax "5"
SaveToWorkspace off
SaveName "ScopeData"
LimitDataPoints on
MaxDataPoints "5000"
Decimation "1"
SampleInput off
SampleTime "0"
}
Block {
BlockType "S-Function"
FunctionName "system"
PortCounts "[]"
SFunctionModules "''"
}
Block {
BlockType Sin
SineType "Time based"
Amplitude "1"
Bias "0"
Frequency "1"
Phase "0"
Samples "10"
Offset "0"
SampleTime "-1"
VectorParams1D on
}
Block {
BlockType Step
Time "1"
Before "0"
After "1"
SampleTime "-1"
VectorParams1D on
ZeroCross on
}
Block {
BlockType SubSystem
ShowPortLabels on
Permissions "ReadWrite"
RTWSystemCode "Auto"
RTWFcnNameOpts "Auto"
RTWFileNameOpts "Auto"
SimViewingDevice off
DataTypeOverride "UseLocalSettings"
MinMaxOverflowLogging "UseLocalSettings"
}
Block {
BlockType Sum
IconShape "rectangular"
Inputs "++"
ShowAdditionalParam off
InputSameDT on
OutDataTypeMode "Same as first input"
OutDataType "sfix(16)"
OutScaling "2^0"
LockScale off
RndMeth "Floor"
SaturateOnIntegerOverflow on
}
Block {
BlockType TransferFcn
Numerator "[1]"
Denominator "[1 2 1]"
AbsoluteTolerance "auto"
Realization "auto"
}
Block {
BlockType ZeroOrderHold
SampleTime "1"
}
}
AnnotationDefaults {
HorizontalAlignment "center"
VerticalAlignment "middle"
ForegroundColor "black"
BackgroundColor "white"
DropShadow off
FontName "Helvetica"
FontSize 10
FontWeight "normal"
FontAngle "normal"
}
LineDefaults {
FontName "Helvetica"
FontSize 9
FontWeight "normal"
FontAngle "normal"
}
System {
Name "ExampleDemo1"
Location [6, 103, 1018, 716]
Open on
ModelBrowserVisibility off
ModelBrowserWidth 200
ScreenColor "white"
PaperOrientation "landscape"
PaperPositionMode "auto"
PaperType "usletter"
PaperUnits "inches"
ZoomFactor "100"
ReportName "C:\\MATLAB6p5\\toolbox\\rptgenext\\simulink-defau"
"lt.rpt"
Block {
BlockType SubSystem
Name " "
Ports [1, 1]
Position [325, 218, 375, 272]
TreatAsAtomicUnit off
MaskType "Data Adquisition Board"
MaskDescription "Takes the instantaneous value of the input sign"
"al and convert it to the data window of samples. "
MaskHelp "web(['file:///' which('dab.html')]);"
MaskPromptString "Disable Analog Filter|Filter approximation|Orde"
"r|Free expression filter: numerator(descending order of s)|Free expression fi"
"lter: denominator:|Cut-off frequency|Disable Vertical Resolution |Vertical Re"
"solution: No. of bits|Vertical Resolution: signal range|Window size|Gain|Samp"
"ling frequency"
MaskStyleString "checkbox,popup(Bessel|Tschebyscheff|Butterworth"
"|free expression),popup(2|3|4),edit,edit,edit,checkbox,popup(8|12|16),edit,ed"
"it,edit,edit"
MaskTunableValueString "on,on,on,on,on,on,on,on,on,on,on,on"
MaskCallbackString "|||||||||||"
MaskEnableString "on,on,on,on,on,on,on,on,on,on,on,on"
MaskVisibilityString "on,on,on,on,on,on,on,on,on,on,on,on"
MaskToolTipString "on,on,on,on,on,on,on,on,on,on,on,on"
MaskVarAliasString ",,,,,,,,,,,"
MaskVariables "filter=@1;approx=@2;order=@3;numerator=@4;denom"
"inator=@5;freq=@6;resdis=@7;vertres=@8;xmax=@9;winsize=@10;G=@11;fs=@12;"
MaskInitialization "dab1"
MaskDisplay "disp('DAB')"
MaskIconFrame on
MaskIconOpaque off
MaskIconRotate "none"
MaskIconUnits "autoscale"
MaskValueString "on|Butterworth|3|[]|[]|180|on|12|100|1|1.0|60*3"
"2"
System {
Name " "
Location [184, 290, 988, 847]
Open off
ModelBrowserVisibility off
ModelBrowserWidth 200
ScreenColor "white"
PaperOrientation "landscape"
PaperPositionMode "auto"
PaperType "usletter"
PaperUnits "inches"
ZoomFactor "100"
Block {
BlockType Inport
Name "a"
Position [15, 78, 45, 92]
}
Block {
BlockType "S-Function"
Name "A/D & Buffer"
Ports [1, 1]
Position [275, 70, 335, 100]
FunctionName "dab2"
Parameters "winsize,fs,dx,resdis"
}
Block {
BlockType TransferFcn
Name "Analog Filter"
Position [70, 67, 125, 103]
Numerator "num"
Denominator "den"
}
Block {
BlockType Gain
Name "Gain"
Position [145, 70, 175, 100]
Gain "G"
}
Block {
BlockType ZeroOrderHold
Name "Zero-Order\nHold"
Position [210, 70, 240, 100]
SampleTime "1/fs"
}
Block {
BlockType Outport
Name "d"
Position [360, 78, 390, 92]
InitialOutput "[zeros(winsize,1)]"
}
Line {
SrcBlock "Analog Filter"
SrcPort 1
DstBlock "Gain"
DstPort 1
}
Line {
SrcBlock "Gain"
SrcPort 1
DstBlock "Zero-Order\nHold"
DstPort 1
}
Line {
SrcBlock "Zero-Order\nHold"
SrcPort 1
DstBlock "A/D & Buffer"
DstPort 1
}
Line {
SrcBlock "a"
SrcPort 1
DstBlock "Analog Filter"
DstPort 1
}
Line {
SrcBlock "A/D & Buffer"
SrcPort 1
DstBlock "d"
DstPort 1
}
}
}
Block {
BlockType Display
Name "DC offset"
Ports [1]
Position [650, 397, 730, 443]
BackgroundColor "[0.839216, 0.839216, 0.839216]"
Decimation "1"
}
Block {
BlockType Demux
Name "Demux"
Ports [1, 1]
Position [400, 142, 435, 178]
Outputs "1"
}
Block {
BlockType Scope
Name "Display Analog & Digital\nSignals"
Ports [1]
Position [675, 80, 705, 110]
BackgroundColor "[1.000000, 1.000000, 0.000000]"
Location [5, 53, 1029, 743]
Open off
NumInputPorts "1"
TickLabels "on"
List {
ListType AxesTitles
axes1 "INPUT SIGNAL"
}
List {
ListType SelectedSignals
axes1 "ExampleDemo1/Signal Generator:1"
}
TimeRange "0.5032523851858244"
YMin "-1.00971"
YMax "1.01454"
SaveName "ScopeData2"
DataFormat "Array"
}
Block {
BlockType Scope
Name "Estimated Amplitude, Phase and DC offset"
Ports [3]
Position [650, 212, 730, 278]
BackgroundColor "[1.000000, 1.000000, 0.000000]"
Location [5, 80, 1020, 735]
Open on
NumInputPorts "3"
TickLabels "on"
List {
ListType AxesTitles
axes1 "ESTIMATED FUNDAMENTAL SIGNAL AMPLITUDE"
axes2 "PHASE ANGLE "
axes3 "DC OFFSET VALUE"
}
List {
ListType SelectedSignals
axes1 ""
axes2 ""
axes3 ""
}
TimeRange "1"
YMin "0~-200~-1.09984e-031"
YMax "1.5~200~1e-014"
DataFormat "StructureWithTime"
}
Block {
BlockType Mux
Name "Mux"
Ports [2, 1]
Position [500, 77, 535, 113]
Inputs "2"
}
Block {
BlockType Display
Name "Phase Angle (in degrees)"
Ports [1]
Position [645, 327, 725, 373]
BackgroundColor "[0.839216, 0.839216, 0.839216]"
Decimation "1"
}
Block {
BlockType SubSystem
Name "Recursive Kalman Filter Block"
Ports [1, 3]
Position [410, 207, 520, 283]
BackgroundColor "lightBlue"
TreatAsAtomicUnit off
MaskType "Kalman Block"
MaskDescription "Measures the Phasor voltage values using the Ka"
"lman filter. \nThe input to the block is 'Zs(n)', the signal at time nT. 'f' "
"is the fundamental frequency of the signal, and the harmonics are assumed to "
"be integral multiple of this.\n'C' is the ralationship between voltage and ph"
"asor values. The default value is [1,0,1] assuming zero imaginary component a"
"nd non-zero DC component.\nMeasurement noise variance 'sigman' models the noi"
"se during the voltage measurement.\nProcess variance 'sigmav' denotes the var"
"iation in the measurement of voltage values. \n'M' denotes the single step va"
"riation\nDecaying DC component models the decreasing nature of the DC."
MaskPromptString "Fundamental Frequency of Input Signal (f) in Hz"
"|Sampling Frequency (Fs) in samples per second|Initial State (x0)|Voltage-Pha"
"sor relation matrix (C)|Measurement Noise Variance (Sigma n)|Process noise va"
"riance (Sigma v)|Single step transition error covariance (M)|Decaying DC Para"
"meter (lambda)"
MaskStyleString "edit,edit,edit,edit,edit,edit,edit,edit"
MaskTunableValueString "on,on,on,on,on,on,on,on"
MaskCallbackString "|||||||"
MaskEnableString "on,on,on,on,on,on,on,on"
MaskVisibilityString "on,on,on,on,on,on,on,on"
MaskToolTipString "on,on,on,on,on,on,on,on"
MaskVarAliasString ",,,,,,,"
MaskVariables "f=@1;Fs=@2;X0=@3;C=@4;sigman=@5;sigmav=@6;M=@7;"
"lambda=@8;"
MaskIconFrame on
MaskIconOpaque on
MaskIconRotate "none"
MaskIconUnits "autoscale"
MaskValueString "60|32|[0;0;0]|[1 0 1]|0.01|0.005|[(0.24^2) 0 0;"
"0 (0.24^2) 0;0 0 (0.24^2)]|1000"
System {
Name "Recursive Kalman Filter Block"
Location [6, 94, 1018, 716]
Open off
ModelBrowserVisibility off
ModelBrowserWidth 200
ScreenColor "white"
PaperOrientation "landscape"
PaperPositionMode "auto"
PaperType "usletter"
PaperUnits "inches"
ZoomFactor "100"
Block {
BlockType Inport
Name "Zs"
Position [215, 203, 245, 217]
BackgroundColor "[0.980392, 0.647059, 0.447059]"
}
Block {
BlockType SubSystem
Name "Filter Module"
Ports [1, 3]
Position [520, 160, 630, 260]
BackgroundColor "lightBlue"
Priority "2"
TreatAsAtomicUnit off
System {
Name "Filter Module"
Location [2, 74, 1014, 724]
Open off
ModelBrowserVisibility off
ModelBrowserWidth 200
ScreenColor "white"
PaperOrientation "landscape"
PaperPositionMode "auto"
PaperType "usletter"
PaperUnits "inches"
ZoomFactor "100"
Block {
BlockType Inport
Name "Zs"
Position [215, 213, 245, 227]
BackgroundColor "[0.980392, 0.647059, 0.447059]"
}
Block {
BlockType ComplexToMagnitudeAngle
Name "Complex to\nMagnitude-Angle"
Ports [1, 2]
Position [540, 138, 570, 167]
Output "Magnitude and angle"
}
Block {
BlockType Demux
Name "Demux"
Ports [1, 3]
Position [385, 201, 390, 239]
BackgroundColor "black"
ShowName off
Outputs "3"
}
Block {
BlockType "S-Function"
Name "Kalman Filter"
Ports [1, 1]
Position [270, 180, 355, 260]
BackgroundColor "[0.686275, 0.823529, 0.960784]"
Priority "2"
FontName "Arial"
FontSize 11
FontWeight "bold"
FunctionName "kfamp"
Parameters "X0 C M"
MaskType "Kalman Filter Block"
MaskIconFrame on
MaskIconOpaque on
MaskIconRotate "none"
MaskIconUnits "autoscale"
}
Block {
BlockType Product
Name "Product1"
Ports [2, 1]
Position [655, 205, 700, 240]
ShowAdditionalParam on
InputSameDT off
}
Block {
BlockType Constant
Name "Rad2Degrees"
Position [545, 215, 575, 245]
Value "180/pi"
}
Block {
BlockType RealImagToComplex
Name "Real-Imag to\nComplex"
Ports [2, 1]
Position [465, 138, 495, 167]
Input "Real and imag"
}
Block {
BlockType Outport
Name "Signal Amplitude"
Position [750, 138, 780, 152]
BackgroundColor "[0.980392, 0.647059, 0.447059]"
}
Block {
BlockType Outport
Name "Phase Value"
Position [755, 218, 785, 232]
BackgroundColor "[0.980392, 0.647059, 0.447059]"
Port "2"
}
Block {
BlockType Outport
Name "DC Amplitude"
Position [755, 263, 785, 277]
BackgroundColor "[0.980392, 0.647059, 0.447059]"
Port "3"
}
Line {
SrcBlock "Zs"
SrcPort 1
DstBlock "Kalman Filter"
DstPort 1
}
Line {
SrcBlock "Kalman Filter"
SrcPort 1
DstBlock "Demux"
DstPort 1
}
Line {
SrcBlock "Demux"
SrcPort 1
Points [20, 0; 0, -65]
DstBlock "Real-Imag to\nComplex"
DstPort 1
}
Line {
SrcBlock "Demux"
SrcPort 2
Points [40, 0; 0, -60]
DstBlock "Real-Imag to\nComplex"
DstPort 2
}
Line {
SrcBlock "Demux"
SrcPort 3
Points [15, 0; 0, 40]
DstBlock "DC Amplitude"
DstPort 1
}
Line {
SrcBlock "Product1"
SrcPort 1
DstBlock "Phase Value"
DstPort 1
}
Line {
SrcBlock "Real-Imag to\nComplex"
SrcPort 1
DstBlock "Complex to\nMagnitude-Angle"
DstPort 1
}
Line {
SrcBlock "Complex to\nMagnitude-Angle"
SrcPort 1
DstBlock "Signal Amplitude"
DstPort 1
}
Line {
SrcBlock "Rad2Degrees"
SrcPort 1
DstBlock "Product1"
DstPort 2
}
Line {
SrcBlock "Complex to\nMagnitude-Angle"
SrcPort 2
Points [35, 0; 0, 55]
DstBlock "Product1"
DstPort 1
}
}
}
Block {
BlockType SubSystem
Name "Parameter Calculation Module"
Ports [1, 1]
Position [285, 161, 475, 259]
BackgroundColor "lightBlue"
Priority "1"
FontName "Arial"
FontSize 11
TreatAsAtomicUnit off
MaskDisplay "disp('PARAMETER MODULE');\nport_label('inpu"
"t',1,'Zs in');\nport_label('output',1,'Zs out');"
MaskIconFrame on
MaskIconOpaque on
MaskIconRotate "none"
MaskIconUnits "autoscale"
System {
Name "Parameter Calculation Module"
Location [2, 98, 1014, 720]
Open off
ModelBrowserVisibility off
ModelBrowserWidth 200
ScreenColor "white"
PaperOrientation "landscape"
PaperPositionMode "auto"
PaperType "usletter"
PaperUnits "inches"
ZoomFactor "100"
Block {
BlockType Inport
Name "Zs In"
Position [355, 228, 385, 242]
BackgroundColor "[1.000000, 0.176471, 0.176471]"
}
Block {
BlockType "S-Function"
Name "Kalman Parameter Block"
Ports []
Position [415, 165, 536, 193]
BackgroundColor "[0.686275, 0.823529, 0.960784]"
Priority "1"
FontName "Arial"
FontSize 11
FontWeight "bold"
FunctionName "KalmanParameters"
Parameters "Fs f sigman sigmav M lambda"
}
Block {
BlockType Outport
Name "Zs Out"
Position [565, 228, 595, 242]
BackgroundColor "[1.000000, 0.176471, 0.176471]"
}
Line {
SrcBlock "Zs In"
SrcPort 1
DstBlock "Zs Out"
DstPort 1
}
}
}
Block {
BlockType Outport
Name "Amplitude"
Position [675, 168, 705, 182]
BackgroundColor "[0.980392, 0.647059, 0.447059]"
}
Block {
BlockType Outport
Name "Phase"
Position [675, 203, 705, 217]
BackgroundColor "[0.980392, 0.647059, 0.447059]"
Port "2"
}
Block {
BlockType Outport
Name "DC Amplitude"
Position [680, 238, 710, 252]
BackgroundColor "[0.980392, 0.647059, 0.447059]"
Port "3"
}
Line {
SrcBlock "Zs"
SrcPort 1
DstBlock "Parameter Calculation Module"
DstPort 1
}
Line {
SrcBlock "Parameter Calculation Module"
SrcPort 1
DstBlock "Filter Module"
DstPort 1
}
Line {
SrcBlock "Filter Module"
SrcPort 1
DstBlock "Amplitude"
DstPort 1
}
Line {
SrcBlock "Filter Module"
SrcPort 3
DstBlock "DC Amplitude"
DstPort 1
}
Line {
SrcBlock "Filter Module"
SrcPort 2
DstBlock "Phase"
DstPort 1
}
}
}
Block {
BlockType SubSystem
Name "Signal\nGenerator"
Ports [0, 1]
Position [220, 223, 255, 267]
BackgroundColor "lightBlue"
TreatAsAtomicUnit off
MaskType "Signal Generator"
MaskPromptString "Fundamental Signal Amplitude in V|Fundamental F"
"requency in Hz|Harmonic Signal Amplitude 1 in V|Frequency of Harmonic Signal "
"1 in Hz|Harmonic Signal Amplitude 2 in V|Frequency of Harmonic Signal 2 in Hz"
"|Start time in sec"
MaskStyleString "edit,edit,edit,edit,edit,edit,edit"
MaskTunableValueString "on,on,on,on,on,on,on"
MaskCallbackString "||||||"
MaskEnableString "on,on,on,on,on,on,on"
MaskVisibilityString "on,on,on,on,on,on,on"
MaskToolTipString "on,on,on,on,on,on,on"
MaskVarAliasString ",,,,,,"
MaskVariables "A1=@1;f1=@2;A2=@3;f2=@4;A3=@5;f3=@6;tstart=@7;"
MaskIconFrame on
MaskIconOpaque on
MaskIconRotate "none"
MaskIconUnits "autoscale"
MaskValueString "1|60|0|3*60|0|5*60|0"
System {
Name "Signal\nGenerator"
Location [476, 373, 761, 610]
Open off
ModelBrowserVisibility off
ModelBrowserWidth 200
ScreenColor "white"
PaperOrientation "landscape"
PaperPositionMode "auto"
PaperType "usletter"
PaperUnits "inches"
ZoomFactor "100"
Block {
BlockType Product
Name "Product"
Ports [2, 1]
Position [175, 102, 205, 133]
}
Block {
BlockType Sin
Name "Sine Wave"
Position [25, 25, 55, 55]
SineType "Time based"
Amplitude "A1"
Frequency "f1*2*pi"
SampleTime "0"
}
Block {
BlockType Sin
Name "Sine Wave1"
Position [25, 95, 55, 125]
SineType "Time based"
Amplitude "A2"
Frequency "f2*2*pi"
SampleTime "0"
}
Block {
BlockType Sin
Name "Sine Wave2"
Position [25, 160, 55, 190]
SineType "Time based"
Amplitude "A3"
Frequency "f3*2*pi"
SampleTime "0"
}
Block {
BlockType Step
Name "Step"
Position [105, 180, 135, 210]
Time "tstart"
SampleTime "0"
}
Block {
BlockType Sum
Name "Sum"
Ports [3, 1]
Position [90, 66, 120, 154]
Inputs "+++"
}
Block {
BlockType Outport
Name "x"
Position [230, 113, 260, 127]
InitialOutput "0"
}
Line {
SrcBlock "Sine Wave"
SrcPort 1
Points [15, 0]
DstBlock "Sum"
DstPort 1
}
Line {
SrcBlock "Sine Wave1"
SrcPort 1
DstBlock "Sum"
DstPort 2
}
Line {
SrcBlock "Sine Wave2"
SrcPort 1
Points [5, 0; 0, -35]
DstBlock "Sum"
DstPort 3
}