SlideShare a Scribd company logo
1 of 152
Download to read offline
1
XCOS BLOCK DESCRIPTION
A SIMPLE NOTES
Arun Umrao
www.sites.google.com/view/arunumrao
DRAFT COPY - GPL LICENSING
Arun Umrao
2
Contents
I Xcos Blocks 5
1 Blocks Pallets 7
1.1 Source of Data Blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
1.1.1 Clock Block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
1.1.2 Sampling Clock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
1.1.3 Time Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
1.1.4 Constant Block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
1.1.5 Curve Block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
1.1.6 Counter Block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
1.1.7 Sine Wave Generator . . . . . . . . . . . . . . . . . . . . . . . . . . 14
1.1.8 Square Wave Generator . . . . . . . . . . . . . . . . . . . . . . . . 15
1.1.9 Saw-tooth Wave Generator . . . . . . . . . . . . . . . . . . . . . . 15
1.1.10 Pulse Wave Generator . . . . . . . . . . . . . . . . . . . . . . . . . 16
1.1.11 Step Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
1.1.12 Modulo Counter . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
1.1.13 Ramp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
1.1.14 Random Generator . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
1.1.15 Read From Input File . . . . . . . . . . . . . . . . . . . . . . . . . 20
1.1.16 Read ‘C’ Binary File . . . . . . . . . . . . . . . . . . . . . . . . . . 24
1.1.17 Read Sound File . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
1.1.18 Signal Builder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
1.1.19 TK Scale . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
1.2 Sink of Data Blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
1.2.1 Display Floating Number . . . . . . . . . . . . . . . . . . . . . . . 28
1.2.2 Bar XY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
1.2.3 Floating Point Scope . . . . . . . . . . . . . . . . . . . . . . . . . . 29
1.2.4 XY Animated Viewer . . . . . . . . . . . . . . . . . . . . . . . . . 29
1.2.5 XY 3D Animated Viewer . . . . . . . . . . . . . . . . . . . . . . . 30
1.2.6 3D Matrix Viewer . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
1.2.7 Matrix Viewer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
1.2.8 Single Display Scope . . . . . . . . . . . . . . . . . . . . . . . . . . 38
1.2.9 Multiple Display Scope . . . . . . . . . . . . . . . . . . . . . . . . 40
1.2.10 XY Single Display Scope . . . . . . . . . . . . . . . . . . . . . . . 41
1.2.11 XY 3D Single Display Scope . . . . . . . . . . . . . . . . . . . . . 42
1.2.12 Terminating Blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
1.2.13 Writing to Audio File . . . . . . . . . . . . . . . . . . . . . . . . . 44
1.2.14 Writing to ‘C’ Binary File . . . . . . . . . . . . . . . . . . . . . . . 44
1.3 Mathematical Blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
1.3.1 Max & Min . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
1.3.2 Max Only Block . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
1.3.3 Min Only Block . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
1.3.4 Square Root Block . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
1.3.5 Absolute Value . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
Arun
1.1.15 Read From Input File . . . . . . . . . . . . . . . . . . . . . . . . . 20
1.1.15 Read From Input File . . . . . . . . . . . . . . . . . . . . . . . . . 20
1.1.16 Read ‘C’ Binary File . . . . . . . . . . . . . . . . . . . . . . . . . . 24
1.1.16 Read ‘C’ Binary File . . . . . . . . . . . . . . . . . . . . . . . . . . 24
1.1.17 Read Sound File . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
1.1.17 Read Sound File . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
Umrao
1.1.15 Read From Input File . . . . . . . . . . . . . . . . . . . . . . . . . 20
1.1.15 Read From Input File . . . . . . . . . . . . . . . . . . . . . . . . . 20
1.1.16 Read ‘C’ Binary File . . . . . . . . . . . . . . . . . . . . . . . . . . 24
1.1.16 Read ‘C’ Binary File . . . . . . . . . . . . . . . . . . . . . . . . . . 24
1.1.17 Read Sound File . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
1.1.17 Read Sound File . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
3
1.3.6 Sum Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
1.3.7 Big Sum . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
1.3.8 Summation Block . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
1.3.9 Sine Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
1.3.10 Cosine Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
1.3.11 Tangent Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
1.3.12 Trigonometric Function . . . . . . . . . . . . . . . . . . . . . . . . 54
1.3.13 Product Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
1.3.14 Product Block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
1.3.15 Power Block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
1.3.16 Exponential . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
1.3.17 Gain of Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
1.3.18 Inverse Value . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
1.3.19 Logarithm Value . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
1.4 Matrix Blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
1.4.1 Cumulative Summation . . . . . . . . . . . . . . . . . . . . . . . . 61
1.4.2 Extraction of Line & Column . . . . . . . . . . . . . . . . . . . . . 62
1.4.3 Triangular Or Triangular Extraction . . . . . . . . . . . . . . . . . 62
1.4.4 Horizontal Concatenation . . . . . . . . . . . . . . . . . . . . . . . 63
1.4.5 Vertical Concatenation . . . . . . . . . . . . . . . . . . . . . . . . . 64
1.4.6 Determinant . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
1.4.7 Diagonal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
1.4.8 Matrix Division . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
1.4.9 Eigenvectors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
1.4.10 Exponential Matrix . . . . . . . . . . . . . . . . . . . . . . . . . . 68
1.4.11 Inverse Matrix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
1.4.12 Lower & Upper Triangular Matrix (LU) . . . . . . . . . . . . . . . 69
1.4.13 Magnitude and Phi . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
1.4.14 Matrix Multiplication . . . . . . . . . . . . . . . . . . . . . . . . . 70
1.4.15 Matrix Sum . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
1.4.16 Matrix Transformation . . . . . . . . . . . . . . . . . . . . . . . . . 72
1.4.17 Conjugate Matrix . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
1.4.18 Real & Imaginary Matrix . . . . . . . . . . . . . . . . . . . . . . . 73
1.4.19 Roots & Coefficients . . . . . . . . . . . . . . . . . . . . . . . . . . 74
1.4.20 Square Root of Matrix . . . . . . . . . . . . . . . . . . . . . . . . . 74
1.4.21 Sub Matrices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
1.4.22 Riccati Equation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
1.4.23 Singular Value Decomposition . . . . . . . . . . . . . . . . . . . . . 75
1.4.24 Pseudo Inverse Matrix . . . . . . . . . . . . . . . . . . . . . . . . . 80
1.4.25 Reshape Matrix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
1.5 Discrete & Continuum . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
1.5.1 Backlash . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
1.5.2 Deadband . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
1.5.3 Hystheresis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
1.5.4 Rate Limiter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
1.5.5 Discrete Transfer Function . . . . . . . . . . . . . . . . . . . . . . 85
1.5.6 Discrete Zero Pole . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
Arun
1.4.6 Determinant . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
1.4.6 Determinant . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
1.4.7 Diagonal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
1.4.7 Diagonal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
1.4.8 Matrix Division . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
1.4.8 Matrix Division . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
1.4.9 Eigenvectors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
1.4.9 Eigenvectors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
Umrao
1.4.6 Determinant . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
1.4.6 Determinant . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
1.4.7 Diagonal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
1.4.7 Diagonal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
1.4.8 Matrix Division . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
1.4.8 Matrix Division . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
1.4.9 Eigenvectors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
1.4.9 Eigenvectors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
4
1.5.7 Discrete State Space System . . . . . . . . . . . . . . . . . . . . . 86
1.5.8 Shift Register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
1.5.9 Dummy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
1.5.10 Continuous Transfer Function . . . . . . . . . . . . . . . . . . . . . 88
1.5.11 Continuous State Space System . . . . . . . . . . . . . . . . . . . . 88
1.5.12 Derivative . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
1.5.13 Integration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
1.5.14 PID Regulator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
1.5.15 Continuous Linear System With Jump . . . . . . . . . . . . . . . . 92
1.5.16 Unit Delay Operator . . . . . . . . . . . . . . . . . . . . . . . . . . 92
1.5.17 Continuous Time Delay . . . . . . . . . . . . . . . . . . . . . . . . 92
1.5.18 Discrete Time Delay . . . . . . . . . . . . . . . . . . . . . . . . . . 93
1.5.19 Variable Time Delay . . . . . . . . . . . . . . . . . . . . . . . . . . 94
1.5.20 Variable Time Delay Function . . . . . . . . . . . . . . . . . . . . 98
1.6 Electrical Blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
1.6.1 Electrical Resistor . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
1.6.2 Electrical Variable Resistor . . . . . . . . . . . . . . . . . . . . . . 100
1.6.3 Electrical Capacitor . . . . . . . . . . . . . . . . . . . . . . . . . . 101
1.6.4 Electrical Inductor . . . . . . . . . . . . . . . . . . . . . . . . . . . 102
1.6.5 Electrical DC Voltage Source . . . . . . . . . . . . . . . . . . . . . 103
1.6.6 Sine Wave Voltage Source . . . . . . . . . . . . . . . . . . . . . . . 104
1.6.7 Variable AC Voltage Source . . . . . . . . . . . . . . . . . . . . . . 105
1.6.8 Electrical AC Voltage Source . . . . . . . . . . . . . . . . . . . . . 105
1.6.9 Controllable Modelica Current Source . . . . . . . . . . . . . . . . 106
1.6.10 Controllable Modelica Voltage Source . . . . . . . . . . . . . . . . 107
1.6.11 Electrical Current Sensor . . . . . . . . . . . . . . . . . . . . . . . 107
1.6.12 Electrical Potential Sensor . . . . . . . . . . . . . . . . . . . . . . . 108
1.6.13 Electrical Voltage Sensor . . . . . . . . . . . . . . . . . . . . . . . 109
1.6.14 Electrical Diode . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110
1.6.15 Ground . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
1.6.16 Modelica Gyrator . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
1.6.17 Ideal Transformer . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
1.6.18 Ideal OpAmp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
1.6.19 PNP Transistor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
1.6.20 NPN Transistor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
1.6.21 Simple NMOS Transistor . . . . . . . . . . . . . . . . . . . . . . . 115
1.6.22 Simple PMOS Transistor . . . . . . . . . . . . . . . . . . . . . . . 115
1.6.23 NoN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115
1.6.24 Input Zero Crossing . . . . . . . . . . . . . . . . . . . . . . . . . . 115
1.6.25 Zero Crossing General Block . . . . . . . . . . . . . . . . . . . . . 115
1.6.26 Negative to Positive Zero Crossing . . . . . . . . . . . . . . . . . . 116
1.6.27 Positive to Negative Zero Crossing . . . . . . . . . . . . . . . . . . 116
1.7 Signal Processing Blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
1.7.1 Quantization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
1.7.2 Sample And Hold . . . . . . . . . . . . . . . . . . . . . . . . . . . 118
1.7.3 Demultiplexer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119
1.7.4 Extractor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119
Arun
1.6.6 Sine Wave Voltage Source . . . . . . . . . . . . . . . . . . . . . . . 104
1.6.6 Sine Wave Voltage Source . . . . . . . . . . . . . . . . . . . . . . . 104
1.6.7 Variable AC Voltage Source . . . . . . . . . . . . . . . . . . . . . . 105
1.6.7 Variable AC Voltage Source . . . . . . . . . . . . . . . . . . . . . . 105
1.6.8 Electrical AC Voltage Source . . . . . . . . . . . . . . . . . . . . . 105
1.6.8 Electrical AC Voltage Source . . . . . . . . . . . . . . . . . . . . . 105
1.6.9 Controllable Modelica Current Source . . . . . . . . . . . . . . . . 106
1.6.9 Controllable Modelica Current Source . . . . . . . . . . . . . . . . 106
Umrao
1.6.6 Sine Wave Voltage Source . . . . . . . . . . . . . . . . . . . . . . . 104
1.6.6 Sine Wave Voltage Source . . . . . . . . . . . . . . . . . . . . . . . 104
1.6.7 Variable AC Voltage Source . . . . . . . . . . . . . . . . . . . . . . 105
1.6.7 Variable AC Voltage Source . . . . . . . . . . . . . . . . . . . . . . 105
1.6.8 Electrical AC Voltage Source . . . . . . . . . . . . . . . . . . . . . 105
1.6.8 Electrical AC Voltage Source . . . . . . . . . . . . . . . . . . . . . 105
1.6.9 Controllable Modelica Current Source . . . . . . . . . . . . . . . . 106
1.6.9 Controllable Modelica Current Source . . . . . . . . . . . . . . . . 106
5
1.7.5 GOTO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120
1.7.6 FROM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120
1.7.7 GOTOMO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121
1.7.8 FROMMO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121
1.7.9 Scope Of GOTO . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122
1.7.10 Scope Of GOTOMO . . . . . . . . . . . . . . . . . . . . . . . . . . 124
1.7.11 Clock Goto . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125
1.7.12 Clock From . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126
1.7.13 Select . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126
1.7.14 Multiplexer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127
1.7.15 Multi Port Switch . . . . . . . . . . . . . . . . . . . . . . . . . . . 128
1.7.16 Merge Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128
1.7.17 Relay . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129
1.7.18 Select . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129
1.7.19 Switch2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129
1.7.20 Switch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129
1.7.21 Self Switch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130
1.8 User Defined Blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130
1.8.1 New C . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130
Simulation Function . . . . . . . . . . . . . . . . . . . . . . . . . . 130
Is Block Implicit . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130
Input Port Size . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131
Output Port Size . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132
Input Event Size . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133
Output Event Size . . . . . . . . . . . . . . . . . . . . . . . . . . . 133
Initial Continuous State . . . . . . . . . . . . . . . . . . . . . . . . 133
Number of Zero Crossing Surfaces . . . . . . . . . . . . . . . . . . 133
Initial Discrete State . . . . . . . . . . . . . . . . . . . . . . . . . . 133
Real Parameters Vector . . . . . . . . . . . . . . . . . . . . . . . . 133
Integer Parameters Vector . . . . . . . . . . . . . . . . . . . . . . . 133
Initial Firing Vector . . . . . . . . . . . . . . . . . . . . . . . . . . 134
Direct Feedthrough . . . . . . . . . . . . . . . . . . . . . . . . . . . 134
Time Dependence . . . . . . . . . . . . . . . . . . . . . . . . . . . 134
1.8.2 Masked Super Block . . . . . . . . . . . . . . . . . . . . . . . . . . 134
1.8.3 Mathematical Expression . . . . . . . . . . . . . . . . . . . . . . . 134
1.8.4 Modelica Generic Block . . . . . . . . . . . . . . . . . . . . . . . . 134
Input Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135
Input Variables Types . . . . . . . . . . . . . . . . . . . . . . . . . 135
Output Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135
Output Variables Types . . . . . . . . . . . . . . . . . . . . . . . . 135
Parameters in Modelica . . . . . . . . . . . . . . . . . . . . . . . . 135
Parameters Properties . . . . . . . . . . . . . . . . . . . . . . . . . 136
Function name . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136
Parameter values . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136
1.8.5 Super Block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137
Ports for Connections in Super Block . . . . . . . . . . . . . . . . 139
Regular Input Port . . . . . . . . . . . . . . . . . . . . . . . . . . . 140
Arun
Is Block Implicit . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130
Is Block Implicit . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130
Input Port Size . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131
Input Port Size . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131
Output Port Size . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132
Output Port Size . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132
Input Event Size . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133
Input Event Size . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133
Umrao
Is Block Implicit . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130
Is Block Implicit . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130
Input Port Size . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131
Input Port Size . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131
Output Port Size . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132
Output Port Size . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132
Input Event Size . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133
Input Event Size . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133
6
Regular Output Port . . . . . . . . . . . . . . . . . . . . . . . . . . 140
Implicit Input Port . . . . . . . . . . . . . . . . . . . . . . . . . . . 140
Implicit Output Port . . . . . . . . . . . . . . . . . . . . . . . . . . 141
Event Input Port . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141
Event Output Port . . . . . . . . . . . . . . . . . . . . . . . . . . . 141
1.8.6 C Language . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141
Function Name . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142
Input Port Size . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143
Output Port Size . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144
System Parameters Vector . . . . . . . . . . . . . . . . . . . . . . . 144
1.8.7 ForTran . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144
Function Name . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144
System parameters vector . . . . . . . . . . . . . . . . . . . . . . . 144
Input Port Size . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144
Output Port Size . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145
1.8.8 Generic Block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145
Simulation Function . . . . . . . . . . . . . . . . . . . . . . . . . . 145
Function Type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145
Input Port Size . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145
Input Port Type . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146
Output Port Size . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146
Output Port Type . . . . . . . . . . . . . . . . . . . . . . . . . . . 146
Input Port Event Size . . . . . . . . . . . . . . . . . . . . . . . . . 147
Output Port Event Size . . . . . . . . . . . . . . . . . . . . . . . . 147
Initial Continuous State . . . . . . . . . . . . . . . . . . . . . . . . 147
Initial Discrete State . . . . . . . . . . . . . . . . . . . . . . . . . . 147
Initial Object State . . . . . . . . . . . . . . . . . . . . . . . . . . 147
Real Parameters Vector . . . . . . . . . . . . . . . . . . . . . . . . 147
Integer Parameters Vector . . . . . . . . . . . . . . . . . . . . . . . 147
Object Parameters List . . . . . . . . . . . . . . . . . . . . . . . . 147
Number of Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . 148
Number of Zero Crossing . . . . . . . . . . . . . . . . . . . . . . . 148
Initial Firing Vector . . . . . . . . . . . . . . . . . . . . . . . . . . 148
Direct Feed-through . . . . . . . . . . . . . . . . . . . . . . . . . . 148
Time Dependence . . . . . . . . . . . . . . . . . . . . . . . . . . . 148
1.8.9 Scilab Function Block . . . . . . . . . . . . . . . . . . . . . . . . . 148
Input Port Size . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148
Output Port Size . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149
Input Event Port Size . . . . . . . . . . . . . . . . . . . . . . . . . 149
Output Event Port Size . . . . . . . . . . . . . . . . . . . . . . . . 149
Initial Continuous State . . . . . . . . . . . . . . . . . . . . . . . . 149
Initial Discrete State . . . . . . . . . . . . . . . . . . . . . . . . . . 149
System Parameter Vector . . . . . . . . . . . . . . . . . . . . . . . 149
Initial Firing Vector . . . . . . . . . . . . . . . . . . . . . . . . . . 149
Is Block Always Active . . . . . . . . . . . . . . . . . . . . . . . . 150
1.9 Other Blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150
1.9.1 Annotation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150
Arun
Output Port Size . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146
Output Port Size . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146
Output Port Type . . . . . . . . . . . . . . . . . . . . . . . . . . . 146
Output Port Type . . . . . . . . . . . . . . . . . . . . . . . . . . . 146
Input Port Event Size . . . . . . . . . . . . . . . . . . . . . . . . . 147
Input Port Event Size . . . . . . . . . . . . . . . . . . . . . . . . . 147
Output Port Event Size . . . . . . . . . . . . . . . . . . . . . . . . 147
Output Port Event Size . . . . . . . . . . . . . . . . . . . . . . . . 147
Umrao
Output Port Size . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146
Output Port Size . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146
Output Port Type . . . . . . . . . . . . . . . . . . . . . . . . . . . 146
Output Port Type . . . . . . . . . . . . . . . . . . . . . . . . . . . 146
Input Port Event Size . . . . . . . . . . . . . . . . . . . . . . . . . 147
Input Port Event Size . . . . . . . . . . . . . . . . . . . . . . . . . 147
Output Port Event Size . . . . . . . . . . . . . . . . . . . . . . . . 147
Output Port Event Size . . . . . . . . . . . . . . . . . . . . . . . . 147
Part I
Xcos Blocks
Arun Umrao
Arun Umrao
1.1. SOURCE OF DATA BLOCKS 9
1Blocks Pallets
A Xcos model is created in the Xcos diagram panel. The diagram panel setup dialog
can be opened by right clicking on the panel window and select of setup. From setup
dialogue window we can set the final integration time (time upto which simulation takes
place), real time scaling, Integrator absolute and relative tolerance (what amount of com-
puted data shall be different from actual one), tolerance on time, maximum integration
time interval, solver type and maximum step size etc. The same dialogue can be accessed
from Setup submenu from Simulation menubar. From Xcos diagram panel and pallets we
can create own simulating diagrams. There are ready-made blocks which are preinstall in
Xcos. These blocks are called core Xcos blocks. There are few generic and user defined
blocks through them we can access the other language in for analysis and computations.
In xcos, familiarity with data type and port size is crucial for simulations. There are three
main data arrangement in xcos. (i) Scalar data, (ii) Vector data and (iii) Matrix data.
A scalar data is continuous data whose dimension always remains 1 × 1. Scalar data has
infinite numbers of elements. Vector data is either of 1× n or m× 1 size. Vector data has
fixed number of elements. A matrix data is always represented as m×n. It has also fixed
number of elements. A function block accepts or transmits continuous data. A matrix
block accepts or transmits vector or matrix data. To differentiate between function blocks
and matrix blocks, their block name are ended with f and m (also contains MAT word
in their block name) respectively.
1.1 Source of Data Blocks
In Xcos, source blocks are those blocks where a pulse, signal or wave is generated.
1.1.1 Clock Block
Clock block in Xcos is module that trigger pulses to another block. The maximum
frequency of clock in Xcos is less than or equal to the processor frequency. The clock
symbol is
Figure 1.1: Clock (Clock c)
This clock has one command port. In clock block, its frequency and initial time can
be set as required. Following example uses the clock.
Arun
fixed number of elements. A matrix data is always represented as
fixed number of elements. A matrix data is always represented as
number of elements. A function block accepts or transmits continuous data. A matrix
number of elements. A function block accepts or transmits continuous data. A matrix
block accepts or transmits vector or matrix data. To differentiate between function blocks
block accepts or transmits vector or matrix data. To differentiate between function blocks
and matrix blocks, their block name are ended with
and matrix blocks, their block name are ended with
Umrao
fixed number of elements. A matrix data is always represented as
fixed number of elements. A matrix data is always represented as
number of elements. A function block accepts or transmits continuous data. A matrix
number of elements. A function block accepts or transmits continuous data. A matrix
block accepts or transmits vector or matrix data. To differentiate between function blocks
block accepts or transmits vector or matrix data. To differentiate between function blocks
and matrix blocks, their block name are ended with
and matrix blocks, their block name are ended with f and
f and m (also contains MAT word
m (also contains MAT word
10 Blocks Pallets
Clock c
CScope
GenSin f
Figure 1.2: In this configuration, a clock is used to refresh the single scope for showing
the sine wave generated by sine function generator.
The output will be like
−10
−5
0
5
10
0 3 6 9 12 15 18 21 24 27 30
y
t
Figure 1.3: Output of simulation 1.2.
A point to be noted that the period of clock is time period of one oscillation and its
reverse is frequency of clock.
T =
1
f
⇒ f =
1
T
1.1.2 Sampling Clock
Another clock is sample clock whose frequency is calculated as greatest common divisor
of all same offset blocks. Sampling clock has only one command port. Sampling rate and
offset numbers can be set as required. Sampling rate is given in seconds, i.e. at each
interval of this time, the clock send command signal to the connected block for reading
of the input value. Offset value is that time after which the clock is activated.
Arun
Arun Umrao
Umrao
1.1. SOURCE OF DATA BLOCKS 11
Figure 1.4: Sampling Clock (SampleCLK)
In the following example, a sampling clock is used with frequency of 5 seconds and
offset time as 1 second.
CScope
GenSin f
Figure 1.5: In this configuration, a sample clock is used to refresh the single scope for
showing the sine wave generated by sine function generator.
The output will be like
−1
0
1
0 3 6 9 12 15 18 21 24 27 30
y
t
Figure 1.6: Output of simulation 1.5.
1.1.3 Time Function
It is source of time. The data output at its output port is time increasing constantly by
integer one.
Figure 1.7: Time Function Block (TIME f)
Figure 1.5: In this configuration, a sample clock is used to refresh the
Figure 1.5: In this configuration, a sample clock is used to refresh the
showing the sine wave generated by sine function generator.
showing the sine wave generated by sine function generator.
The output will be like
The output will be like Umrao
Figure 1.5: In this configuration, a sample clock is used to refresh the
Figure 1.5: In this configuration, a sample clock is used to refresh the
showing the sine wave generated by sine function generator.
showing the sine wave generated by sine function generator.
12 Blocks Pallets
The time function is given as
f(t) = t 0 ≤ t < ∞
Example for the time function is
Clock c
CScope
TIME f
Figure 1.8: In this configuration, a clock is used to refresh the single scope for showing
the time function.
Output of this example is
−10
−5
0
5
10
0 3 6 9 12 15 18 21 24 27 30
y
t
Figure 1.9: Output of simulation 1.8.
1.1.4 Constant Block
As named, constant block gives output a constant value. User can set the constant value
as required. The constant symbol is
1
Figure 1.10: Constant Block (Const m)
Arun
Arun
Arun Umrao
Umrao
1.1. SOURCE OF DATA BLOCKS 13
There are three types of constant block. Constant block (Const), constant block of
function type (Const f) and constant block of matrix type (Const m). Constant block
also accepts a vector or matrix as its value. For example,

1 5
5 −8

Figure 1.11: Constant Block (Const m)
The schematic diagram of use of constant block is given below.
Clock c
CScope
3
Const m
Figure 1.12: In this configuration, a clock is used to refresh the single scope for showing
the constant value ‘3’.
This simulation has output like
−10
−8
−6
−4
−2
0 3 6 9 12 15 18 21 24 27 30
y
t
Figure 1.13: Output of simulation 1.12.
1.1.5 Curve Block
Curve block plots user data into graphics window. It has one output port. User can modify
xy-data from the setting option of the block. A graphical user interface is provided to edit
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Const
Const m
m
Figure 1.12: In this configuration, a clock is used to refresh the single
Figure 1.12: In this configuration, a clock is used to refresh the single
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
CScope
CScope
Figure 1.12: In this configuration, a clock is used to refresh the single
Figure 1.12: In this configuration, a clock is used to refresh the single scope for showing
14 Blocks Pallets
the xy-data. After completing the data it is required to save it to overwrite the previous
data.
Curve
Figure 1.14: Curve Function Generator (CURV f)
Clock c
CScope
Curve f
This simulation has output like
−10
−5
0
5
10
0 3 6 9 12 15 18 21 24 27 30
y
t
Figure 1.15: Output of simulation 1.1.5.
1.1.6 Counter Block
Counter block counts from lower limit, normally 0, to upper limit (n) either in increasing
order or in decreasing order as per user’s definition. Counter’s count (c) is controlled by
clock, at each clock triger count value is changed by one. Normally control pulses are
supplied by a clock. If clock frequency is low, counting is slow and if frequency of clock
is high then counting is fast. User can set the properties of counter block. The counter
symbol is
Arun
This simulation has output like
This simulation has output like
Arun Umrao
1.1. SOURCE OF DATA BLOCKS 15
Counter
0 → n
Figure 1.16: Counter block (Counter)
Counter block simulation is given below
Clock c
CScope
Counter
0 → 10
Counter
Figure 1.17: In this configuration, a clock is used to refresh the single scope for showing
the counter value from zero to fifteen.
The counter value is reset to lower limit when count value is equal to the upper limit.
Mathematically,
c =
(
c when c  n
0 when c = n
Or
c = c % n
This simulation has output like
−10
−5
0
5
10
0 3 6 9 12 15 18 21 24 27 30
y
t
Figure 1.18: Output of simulation 1.17.
Arun
the counter value from zero to fifteen.
the counter value from zero to fifteen.
The counter value is reset to lower limit when count value is equal to the upper limit.
The counter value is reset to lower limit when count value is equal to the upper limit.
Mathematically,
Mathematically, Umrao
The counter value is reset to lower limit when count value is equal to the upper limit.
The counter value is reset to lower limit when count value is equal to the upper limit.
16 Blocks Pallets
1.1.7 Sine Wave Generator
This block generates a sine wave of desired amplitude, frequency and initial time. Sine
wave generated by this block has numerical relation as
y = a sin ωt
Amplitude, frequency and phase values can be set at the setting dialog of the block. The
sine wave generator block is shown in below figure.
Figure 1.19: Sine wave generator (GenSin f)
Sine wave generator example is
Clock c
CScope
GenSin f
Figure 1.20: In this configuration, a clock is used to refresh the single scope for showing
the sine wave.
−1
0
1
0 1 2 3 4 5 6 7 8
Figure 1.21: Simulated output of simulation block (1.20).
Arun
Arun Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
1.1. SOURCE OF DATA BLOCKS 17
1.1.8 Square Wave Generator
Square wave generator produces a sinusoidal wave of square type. It has one control port
and one output port. The width of square wave depends on the trigger pulse supplied
by the clock through control port. A pulse trigger the lower level of square wave into
upper level and vice-versa on next trigger pulse. Low frequency of trigger pulse (here a
sinusoidal clock) gives larger width of square wave. Amplitude of square wave determines
its height.
Figure 1.22: Square Wave Generator (GENSQR f)
Clock c
CScope
GENSQR f
Figure 1.23: In this configuration, a clock is used to refresh the single scope for showing
the square wave.
Simulated output of circuit (1.23) is
−1
0
1
0 1 2 3 4 5 6 7 8
1.1.9 Saw-tooth Wave Generator
Sawtooth wave generator produces a wave whose shape is like a saw teeth. It has one
control port and one output port. The shape is determined by the period of control pulse.
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun
Arun Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
18 Blocks Pallets
It has slope of 450
and height and width of saw tooth depends on the period value of
control pulse. The sawtooth wave generator block symbol is
Figure 1.24: Saw-tooth Wave Generator (SAWTOOTH f)
Clock c
CScope
SAWTOOTH f
Figure 1.25: In this configuration, a clock is used to refresh the single scope for showing
the saw-tooth wave.
Simulated output of circuit (1.25) is
−1
0
1
0 1 2 3 4 5 6 7 8
1.1.10 Pulse Wave Generator
Pulse wave generator produces a square wave having different width in upper  lower
levels. It has one output port. The width of pulse wave can be defined by user as required.
The pulse width is a fraction of period of the wave.
Arun
Figure 1.25: In this configuration, a clock is used to refresh the single
Figure 1.25: In this configuration, a clock is used to refresh the single
the saw-tooth wave.
the saw-tooth wave.
Umrao
Figure 1.25: In this configuration, a clock is used to refresh the single
Figure 1.25: In this configuration, a clock is used to refresh the single scope for showing
scope for showing
1.1. SOURCE OF DATA BLOCKS 19
Figure 1.26: Pulse Wave Generator (PULSE SC)
The duration of time for which, the pulse wave remains active is known as “duty
time”. Pulse width of the pulse wave is percentage ratio of the period of the wave.
Clock c
CScope
PULSE SC
Figure 1.27: In this configuration, a clock is used to refresh the single scope for showing
of the pulse wave.
Simulated output of circuit (1.27) is
−1
0
1
2
0 1 2 3 4 5 6 7 8
1.1.11 Step Function
Step function changes step from upper level to lower level or vice-versa. User can assign
level change time and the upper  lower level values (initial  final values). The properties
of this block are visible when it is double clicked. It has one output port.
Figure 1.28: Step Function Generator (STEP FUNCTION)
Arun
Figure 1.27: In this configuration, a clock is used to refresh the single
Figure 1.27: In this configuration, a clock is used to refresh the single
of the pulse wave.
of the pulse wave.
Simulated output of circuit (1.27) is
Simulated output of circuit (1.27) is
Umrao
Figure 1.27: In this configuration, a clock is used to refresh the single
Figure 1.27: In this configuration, a clock is used to refresh the single scope for showing
20 Blocks Pallets
STEP FUNCTION is used to rise the level of value at and after any instant of time.
Mathematically, step function is defined as givne below:
f(t) =
(
0 when t  a
1 when t ≥ a
A simplest form of simulation circuit is shown in figure below.
Clock c
CScope
STEP FUNCTION
Figure 1.29: In this configuration, a clock is used to refresh the single scope for showing
of the steps.
Simulated output of circuit (1.29) is
−1
0
1
2
0 1 2 3 4 5 6 7 8
1.1.12 Modulo Counter
Counter modulo block counts the values, c, from zero to upper limit and when it encoun-
ters to upper limit, it reset to zero. It has one control and one output ports.
Counter
Modulo n
Figure 1.30: Counter Modulo block (Counter)
Mathematically, modulo value c of given input i for upper limit n is represented as
c = i mod n = i % n (1.1)
Arun
Simulated output of circuit (1.29) is
Simulated output of circuit (1.29) is
Umrao
1.1. SOURCE OF DATA BLOCKS 21
Here, % sign is used to represent modulo in numerical programming. Modulo counter
block simulation is given below
Clock c
CScope
Counter
Modulo 10
Modulo Counter
Figure 1.31: In this configuration, a clock is used to refresh the single scope for showing
the counter modulo 10.
1.1.13 Ramp
Ramp block provide output values according to the relation
y = mt + c
Where y is value provided by ramp at any instant of time t. m, t  c are ramp parameters.
m is slope of ramp that determines how fast the output values varies. t is time function
that increases continuously from its initial value. c is initial value of ramp output. Ramp
has only one output port. Derivating to ramp relation
m =
dy
dt
The right side of above relation represent to velocity parameter, therefore, ramp function
also represents to velocity function. The symbol of ramp function is
Figure 1.32: Ramp block (Ramp)
1.1.14 Random Generator
Random generator block generates random values within the two given ranges. The
random value generated by this block is received when clock triggers the block. It has
one control port and one output port. Mathematically
r = R(t)
where, r is sampled random value and R(t) is random value generated by the random
block at time t. The random value r has range a ≤ r ≤ b, i.e. within domain of [a, b].
Arun
is value provided by ramp at any instant of time
is value provided by ramp at any instant of time
is slope of ramp that determines how fast the output values varies.
is slope of ramp that determines how fast the output values varies.
Umrao
mt +
+ c
is value provided by ramp at any instant of time
is value provided by ramp at any instant of time t.
. m,
, t
t 
 c
c are ramp parameters.
are ramp parameters.
is slope of ramp that determines how fast the output values varies.
is slope of ramp that determines how fast the output values varies. t
t
22 Blocks Pallets
−2
−1
0
1
2
0 1 2 3 4 5
r
t
The block symbol is given below:
Random
Generator
Figure 1.33: Random Generator block (Rand m)
Each random block uses random number algorithm. User can defined own random
block generator by using “Function Block”..
Clock c
CScope
Random
Generator
1.1.15 Read From Input File
This block is used to read data from input file stored in temporary directory or in “my
document” folder. It has one control port and one output control port.
Read data
from input file
Figure 1.34: Read from input file (RFILE f).
This block uses configure options.
1. Time record selection : It is either an empty matrix or an strictly positive integer
 0. If it is empty, there is no output event exists. If an integer value, ‘i’, is given,
Arun
block generator by using “Function Block”..
block generator by using “Function Block”..
Umrao
block generator by using “Function Block”..
block generator by using “Function Block”..
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Clock
Clock c
1.1. SOURCE OF DATA BLOCKS 23
then ith
element of the read record is assumed to be the date of the output event,
i.e. this record is treated as value of t-axis (time variable).
2. Outputs record selection : It is a vector of positive integers like [1, 2, 5]. If read data
is like a vector [k1, k2, . . . kn] then kth
i elements of the read records, i.e. the vector
made of elements [k1, k2, k5] is given in output.
3. Input file name is a file name or path file name. Its value is string of characters.
4. Buffer size : It is similar to the number of bytes read by fread function of C language.
To improve efficiency of input read, file is only done after each Buffer size call to
the block.
For example, consider a data file myfle.txt with following data except label row
Arun Umrao
24 Blocks Pallets
C1 C2 C3
01 0.100 -0.100
02 0.199 -0.199
03 0.296 -0.296
04 0.389 -0.389
05 0.479 -0.479
06 0.565 -0.565
07 0.644 -0.644
08 0.717 -0.717
09 0.783 -0.783
10 0.841 -0.841
11 0.891 -0.891
12 0.932 -0.932
13 0.964 -0.964
14 0.985 -0.985
15 0.997 -0.997
16 1.000 -1.000
17 0.992 -0.992
18 0.974 -0.974
19 0.946 -0.946
20 0.909 -0.909
21 0.863 -0.863
22 0.808 -0.808
23 0.746 -0.746
24 0.675 -0.675
25 0.598 -0.598
26 0.516 -0.516
27 0.427 -0.427
28 0.335 -0.335
29 0.239 -0.239
30 0.141 -0.141
31 0.042 -0.042
32 -0.058 0.058
Each row has data record for different entity. Hence the unique data vector for each
row is [k1, k2, k3]. If time record selection is 1, then first column will be used at t values,
i.e. time event values. If this option has value 2, then second column is used at time even
values. Note that, time value is always  0 and continuous increasing, hence block stops
reading of data when either time becomes negative or time starts decreasing. So, time
Arun
16 1.000 -1.000
17
1
18 0.974 -0.974
8 0.974 -0.974
Umrao
6 1.000 -1.000
6 1.000 -1.000
0. -0.992
8 0.974 -0.974
8 0.974 -0.974
1.1. SOURCE OF DATA BLOCKS 25
column should be positive, greater than zero and continuous increasing. There are three
output records. If output record selection has value 1 then only data of first column is
sent as output of this block. If the output record selection has value [123] then values in
first, second and third columns will be sent as output of this block.
Clock c
CScope
Read data
from input file
RFILE f
The time record selection is 1 and output record selection is [2, 3]. The output will be
as
−1
0
1
0 3 6 9 12 15 18 21 24 27 30
y
t
If the time record selection is 2 and output record selection is [2, 3], then time for data
read shall be from t = 0 to t = 1 seconds. After than time starts decreasing hence reading
block will stop reading of data from input data file. And the output will be as
−1
0
1
0 3 6 9 12 15 18 21 24 27 30
y
t
If the time record selection is 3 and output record selection is [2, 3], then time for data
read shall be from t = 0 to t = 0 seconds as time value is negative. There will be no
output. Similarly, if time record selection option value is empty, then there is null time,
hence no output.
Arun
Arun
Arun Umrao
Umrao
Umrao
26 Blocks Pallets
−1
0
1
0 3 6 9 12 15 18 21 24 27 30
y
t
The ForTran data edit descriptors are LOGICAL, CHARACTER, INTEGER, REAL,
DOUBLE PRECISION and COMPLEX which are represented by L, A, I, D, E, F or G
descriptors respectively. ForTran descriptor is written as Iw.m where ‘I’ is data type,
here it is integer, ‘w’ is total field width and it must be greater than zero, ‘m’ is minimum
number of digits produced on output and it may be zero, ‘d’ is number of digits to the
right of the decimal point and it may be zero, and ‘e’ number of digits in the exponent
part and it must be greater than zero. ‘BN’ is blank space controller. While using this
format control descriptor, all embedded and trailing blanks are treated as null and ignored.
Similarly, in ‘BZ’ black control descriptor, all embedded and trailing blanks are treated
as zeros. Blank space format control descriptor applies only to input and is ignored on
output. ‘S’ format control descriptor restore the system default for printing plus ‘+’ signs.
This is normally ‘SS’ which suppress the printing of plus ‘+’ signs in front of numerical
data for the remainder of the FORMAT description. Format control descriptor ‘SP’ force
the printing of plus ‘+’ signs in front of numerical data for the remainder of the FORMAT
description. Plus sign format control descriptor are applies only to output and is ignored
on input. There are column control descriptors in the ForTrans too. These are ‘nX’
which shifts right n spaces from current position. ‘Tn’ which shifts to column n in the
record. ‘TLn’ which shifts left n spaces from current position. Note that you cannot shift
left past column 1. This descriptor allows you to reread records on input and overwrite
records on output. ‘TRn’ which shifts right n spaces from current position. Note that
‘TRn’ is exactly equivalent to ‘nX’. The slash ‘/’ descriptor begins a new line (record)
on output and skips to the next line on input, ignoring any unread information on the
current record. Two slashes ‘//’ skips one line, three slashes ‘///’ skips two lines, etc.
The format descriptor may be repeated if it is defined as r(Fw.d) or r(Fw.d, Iw.d). Here,
‘r’ is an integer greater than one which specify, how many times the format descriptor
inside the parentheses will be repeated. For example, 2(Fw.d) is equal to Fw.d, Fw.d.
1.1.16 Read ‘C’ Binary File
This block is used to read ‘C’ binary file stored in temporary directory or in “my doc-
ument” folder written by WRITEC f block. It has one control port and one output
control port if Time Record Selection option has empty value. Otherwise, it also has one
command port. Before reading this section, it is strongly recommended to read section
explaining WRITEC f block.
Arun
data for the remainder of the FORMAT description. Format control descriptor ‘SP’ force
data for the remainder of the FORMAT description. Format control descriptor ‘SP’ force
the printing of plus ‘+’ signs in front of numerical data for the remainder of the FORMAT
the printing of plus ‘+’ signs in front of numerical data for the remainder of the FORMAT
description. Plus sign format control descriptor are applies only to output and is ignored
description. Plus sign format control descriptor are applies only to output and is ignored
on input. There are column control descriptors in the ForTrans too. These are ‘nX’
on input. There are column control descriptors in the ForTrans too. These are ‘nX’
Umrao
data for the remainder of the FORMAT description. Format control descriptor ‘SP’ force
data for the remainder of the FORMAT description. Format control descriptor ‘SP’ force
the printing of plus ‘+’ signs in front of numerical data for the remainder of the FORMAT
the printing of plus ‘+’ signs in front of numerical data for the remainder of the FORMAT
description. Plus sign format control descriptor are applies only to output and is ignored
description. Plus sign format control descriptor are applies only to output and is ignored
on input. There are column control descriptors in the ForTrans too. These are ‘nX’
on input. There are column control descriptors in the ForTrans too. These are ‘nX’
1.1. SOURCE OF DATA BLOCKS 27
Read from
‘C’ binary file
Figure 1.35: Read from ‘C’ binary file (READC f).
This block uses configure options.
1. Time Record Selection : It is either an empty matrix or an strictly positive integer
greater than zero (scalar). If it is empty, there is no output event port exists. If
an integer value, ‘i’, is given, then ith
element of the read record is assumed to be
the time event value of the output event port, i.e. this record is treated as value of
t-axis (time variable). If this option has value greater than zero, then one command
port is created in this block and ith
will be used as time axis value and also may be
used to control scope viewers.
2. Outputs Record Selection : It is a vector of positive integers like [1, 2, 5]. If read
data is like a vector [k1, k2, . . . kn] then kth
i elements of the read records, i.e. the
vector made of elements [k1, k2, k5] is given in output.
3. Input File Name : It is a file name or path file name. Its value is string of characters.
4. Input Format : A character string defining the data format to use. Strings “l”, “i”,
“s”, “ul”, “ui”, “us”, “d”, “f”, “c”, “uc” are used respectively to write int32, int16,
int8, uint32, uint16, uint8, double, float, char or unsigned char data type. This
value must be same as the value of Output Format option of WRITEC f block.
5. Record Size : This specify the number of columns to be read from C binary file.
This should be same as the input size option of WRITEC f block. If this value is
2 and data being read from C binary file is integer type, then 8 bytes data shall be
read for one record. It is vector of size one.
6. Buffer Size : It is similar to the number of bytes read by fread function of C language.
7. Initial Record Index : This fixes the first record of the file to use. For example, if
record of each entity is arranged in one line and this option is set four, then file will
be read from the fourth line in place of first line.
8. Swap Mode : If Swap mode=1 then file is supposed to be coded in “little endian
IEEE format” and data are swapped if necessary to match the IEEE format of the
processor. If Swap mode=0 then automatic bytes swap is disabled.
A simple block arrangement is shown below:
Arun
4. Input Format : A character string defining the data format to use. Strings “l”, “i”,
4. Input Format : A character string defining the data format to use. Strings “l”, “i”,
“s”, “ul”, “ui”, “us”, “d”, “f”, “c”, “uc” are used respectively to write int32, int16,
“s”, “ul”, “ui”, “us”, “d”, “f”, “c”, “uc” are used respectively to write int32, int16,
int8, uint32, uint16, uint8, double, float, char or unsigned char data type. This
int8, uint32, uint16, uint8, double, float, char or unsigned char data type. This
Umrao
4. Input Format : A character string defining the data format to use. Strings “l”, “i”,
4. Input Format : A character string defining the data format to use. Strings “l”, “i”,
“s”, “ul”, “ui”, “us”, “d”, “f”, “c”, “uc” are used respectively to write int32, int16,
“s”, “ul”, “ui”, “us”, “d”, “f”, “c”, “uc” are used respectively to write int32, int16,
int8, uint32, uint16, uint8, double, float, char or unsigned char data type. This
int8, uint32, uint16, uint8, double, float, char or unsigned char data type. This
28 Blocks Pallets
Clock c
CScope
Read From
c binary file
READC f
−1
0
1
0 3 6 9 12 15 18 21 24 27 30
y
t
If first column of read record is time value then Time Record Selection option shall
have value 1. The block arrangement will be changed as
CScope
Read From
c binary file
READC f
−1
0
1
0 3 6 9 12 15 18 21 24 27 30
y
t
1.1.17 Read Sound File
This block is used to read data sound file stored in temporary directory or in “my docu-
ment” folder. It has one control port and one output control port.
Arun
have value 1. The block arrangement will be changed as
have value 1. The block arrangement will be changed as
Arun
Arun Umrao
have value 1. The block arrangement will be changed as
have value 1. The block arrangement will be changed as
Umrao
Umrao
1.1. SOURCE OF DATA BLOCKS 29
Read from .au
sound file
Figure 1.36: Read from sound file (READAU f).
1.1.18 Signal Builder
Signal builder is used to draw a signals in any form as required. Signal builder uses x-y
data for generating a signal. It has one output port and one command port.
Signal
Builder
Figure 1.37: Signal Builder block (Sigbuilder)
1.1.19 TK Scale
It is Tk powered slider scale window. Input value is adjusted by sliding the pointer of
slider scale. This block has three parameters, (i) minimum value, (ii) maximum value
and (iii) normalization. Normalization (h) controls the number of steps between minimum
and maximum values. For example, if normalization is h, then total number of sliding
steps shall be
n =
xmax − xmin
h
and vice-versa. Smaller the normalization value, larger the number of steps of Tk sliding
scale and finer the input value. Hence there shall be larger steps and smaller normalization
value for high precision input. Normalization is some times also known as step difference
value of Tk sliding scale. This scale is used for tuning the signals. This block has one
control port and one output port.
TK Scale
Figure 1.38: Signal Builder block (TKSCALE)
Signals are stimulated by clock pulse. On stimulation, Tk slider scale supplies the
value pointed by the pointer of the scale. Its minimum block requirement is shown below:
Arun
It is Tk powered slider scale window. Input value is adjusted by sliding the pointer of
It is Tk powered slider scale window. Input value is adjusted by sliding the pointer of
slider scale. This block has three parameters, (i) minimum value, (ii) maximum value
slider scale. This block has three parameters, (i) minimum value, (ii) maximum value
and (iii) normalization. Normalization (
and (iii) normalization. Normalization (
and maximum values. For example, if normalization is
and maximum values. For example, if normalization is
Umrao
It is Tk powered slider scale window. Input value is adjusted by sliding the pointer of
It is Tk powered slider scale window. Input value is adjusted by sliding the pointer of
slider scale. This block has three parameters, (i) minimum value, (ii) maximum value
slider scale. This block has three parameters, (i) minimum value, (ii) maximum value
) controls the number of steps between minimum
) controls the number of steps between minimum
and maximum values. For example, if normalization is
and maximum values. For example, if normalization is h
h, then total number of sliding
, then total number of sliding
30 Blocks Pallets
Clock c
CScope
TK Scale
This simulation has output like
−10
−5
0
5
10
0 3 6 9 12 15 18 21 24 27 30
y
t
Figure 1.39: Output of simulation 1.1.19.
1.2 Sink of Data Blocks
Sinks is that point where all data is ended in form of graphs, numerical values or event.
Following sinks are used in Xcos.
1.2.1 Display Floating Number
This block is used to show the output in numeric form rather than graphical representa-
tion. It has one input port and one command port.
1.2.2 Bar XY
This block uses relation y = f(x) to plot the data. Here x is independent value while y
is a function of x. This block shows results in bar lines.
Arun
Arun
Arun
Arun
Arun
Arun
0 3 6 9 12 15 18 21 24 27 30
0 3 6 9 12 15 18 21 24 27 30
Arun Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
0 3 6 9 12 15 18 21 24 27 30
0 3 6 9 12 15 18 21 24 27 30
1.2. SINK OF DATA BLOCKS 31
1.2.3 Floating Point Scope
Floating point scope, shows output of floating points ranges between zero to one. It has
one control port. The output viewed in this scope is
y = (float)x
Figure 1.40: Floating Point Scope (CFSCOPE)
Following parameters of the block can be set as and when required.
Color Set the number for color of output graph.
Output Window Number Output windows are assigned an identification numbers for
processing of data. By default it is ‘-1’. It means the window number will automatically
assigned an ID. Apart from it, user defined ID can also be assigned to the window.
Output Window Position Position of window tell the window that where it will posi-
tioned after opening. By default it is positioned in center of screen. The xy-coordinates
of window position are assigned like [x; y]. The coordinates are calculated from the top
left corner of the screen of computer system.
Output Window Sizes It determines the size of output window. The coordinates are
syntax as [x; y].
Ymin It is the minimum value of the output to be displayed in the output window.
Ymin is used to set the lower scale point of the y-axis in output display.
YMax It is the maximum value of the output to be displayed in the output window.
Ymax is used to set the upper scale point of the y-axis in output display.
Refresh Period It is the maximum range of independent variable to be displayed in
the output window.
Buffer Size The size of output values to be stored in the memory. The drawing is
only done after each Buffer size call to the block.
1.2.4 XY Animated Viewer
XY animated viewer visualized the second input with respect first input as a function of
first input at instant simulated time. Mathematically
y = f(x)
The output plot is two dimensional. It has two input ports and one control port. One of
the two input ports is for variable and second is for function of variable.
Arun
Output Window Position
Output Window Position Position of window tell the window that where it will posi-
Position of window tell the window that where it will posi-
ioned after opening. By default it is positioned in center of screen. The xy-coordinates
ioned after opening. By default it is positioned in center of screen. The xy-coordinates
of window position are assigned like [
of window position are assigned like [ Umrao
Position of window tell the window that where it will posi-
Position of window tell the window that where it will posi-
ioned after opening. By default it is positioned in center of screen. The xy-coordinates
ioned after opening. By default it is positioned in center of screen. The xy-coordinates
y]. The coordinates are calculated from the top
]. The coordinates are calculated from the top
32 Blocks Pallets
Figure 1.41: XY Animation Viewer block (CANIMXY)
The simplest form of block arrangement is given in the following figure.
Clock c
CANIMXY
TIME f
SIN
SINBLK f
A moving dot is used to show the instantaneous x and y value. It is animated like the
figure given below:
−1
−0.5
0
0.5
1.0
0 1 2 3 4 5 6 7
1.2.5 XY 3D Animated Viewer
XY 3D animated viewer block draw a graph of function like
f(z) = f(x, y)
Where x, y are two independent values. The α and φ values can be defined as required by
user to change the viewing point. This block has one control port and three input ports.
Figure 1.42: XY 3D Animated Viewer block (CANIMXY3D)
The simplest form of block arrangement is given in the following figure.
Arun
A moving dot is used to show the instantaneous
A moving dot is used to show the instantaneous
figure given below:
figure given below:
Umrao
A moving dot is used to show the instantaneous
A moving dot is used to show the instantaneous x and y value. It is animated like the
1.2. SINK OF DATA BLOCKS 33
Clock c
CANIMXY3D
TIME f
SIN
SINBLK f
A moving dot is used to show the instantaneous x, y and z values. It is animated like
the figure given below:
x
y
z
1.2.6 3D Matrix Viewer
3D Matrix Viewer is a scope that shows matrix values as z values on a xy grid. It has
one input port and one control port. The input to this block is always a matrix.
Mat 3D
Figure 1.43: 3D Matrix Viewer block (CMAT3D)
The drawing of block arrangement is shown in the following figure.
Clock c
Mat 3D
Mat. 3D


1 2 1
2 1 1
2 3 1


Arun
Arun
Arun
Arun
y
y
Arun Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
34 Blocks Pallets
Simulate this block arrangement to see the result. The output is computed as following
methods. In CMAT3D matrix viewer, a ruled mess grid is created. Each point where x
and y lines intersects to each other is called a node. At these nodes matrix elements are
placed and element value is the height of the point in z-axis. The nodes parallel to the
x-axis are column elements of the supplied matrix and nodes parallel to the y-axis are
row elements of the supplied matrix. For a given matrix of 3 × 3,
A =


1 2 1
2 1 1
2 3 1


The mess is looked like
x
y
z
The index of row or column numbers in CMAT3D viewer is started from zero. So, the
elements of the matrix will be placed as shown in the following figure. Note that, column
elements are placed parallel to the x-axis. Now,
x
y
z
A00
A10
A20
A01
A11
A21
A02
A12
A22
1
2
1
2
1
1
2
3
1
Now connect the zij from its neighbouring z. Four neighbouring z nodes form a facet
of the 3D surface. The mesh thus form is three dimensional plot of the given function.
Arun
elements of the matrix will be placed as shown in the following figure. Note that, column
elements of the matrix will be placed as shown in the following figure. Note that, column
elements are placed parallel to the
elements are placed parallel to the x
x-axis. Now,
-axis. Now,
Umrao
elements of the matrix will be placed as shown in the following figure. Note that, column
elements of the matrix will be placed as shown in the following figure. Note that, column
-axis. Now,
-axis. Now,
1.2. SINK OF DATA BLOCKS 35
x
y
z
A00
A10
A20
A01
A11
A21
A02
A12
A22
1
2
1
2
1
1
2
3
1
Now, fill each quadrilateral surface with different color or using colormaps. This is
output of the CMAT3D viewer block.
x
y
z
A00
A10
A20
A01
A11
A21
A02
A12
A22
1
2
1
2
1
1
2
3
1
1.2.7 Matrix Viewer
Matrix Viewer is a scope that shows matrix values on colormap grid. It has one input
port and one control port. The input to this block is always a matrix. The colormap
grid is a range color linked to the window output of the scope. There are three types of
color maps, (i) jetcolormap, (ii) hotcolormap and (iii) graycolormap. These colormaps
accepts a level (n) of color map and it constructs color levels of size n × 3 where n ≥ 3.
For example,

1 -- graycolormap (10)


divides white to perfect gray color into ten different gray color shades as shown in the
following output.

ans =
0. 0. 0.
0.1111111 0.1111111 0.1111111
0.2222222 0.2222222 0.2222222
0.3333333 0.3333333 0.3333333
0.4444444 0.4444444 0.4444444
0.5555556 0.5555556 0.5555556
0.6666667 0.6666667 0.6666667
Arun
Arun
Arun
Arun
1
Arun Umrao
Umrao
A00
A00
Umrao
A10
A10
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
36 Blocks Pallets
0.7777778 0.7777778 0.7777778
0.8888889 0.8888889 0.8888889
1. 1. 1.


Each shade contains equal components of red, green and blue colors. Hence rgb(0.1
0.1 0.1) is equal to the gray(0.1). All rgb components are zero means perfect black and all
component of rgb are one means perfect white. The difference between two gray shades
is computed as
d =
1 − 0
n − 1
and levels are
l = 0 + i × d
The minimum level range is the minimum value who comes in the regular input port.
It would be linked to the ‘cold value’ of the colormap. The maximum level range is the
maximum value who comes in the regular input port. It would be linked to the ‘hot value’
of the colormap. Minimum and maximum values are scalars.
Mat View
Figure 1.44: Matrix Viewer block (CMATVIEW)
The drawing of block arrangement is shown in the following figure.
Clock c
Mat View




0. 1. 2.
2. 3. 4.
4. 5. 6.
6. 7. 8.




Computation method of this block is explained as given below. Assume that the input
matrix has elements from minimum value 0 to maximum value 8. There are eight levels
of gray colourmap. So the list of actual gray colourmap codes, those will be used to fill
the plot are

1 -- graycolourmap (8)



ans =
0.
0.1428571
0.2857143
Arun
F
Figure 1.44: Matrix Viewer block (CMATVIEW)
igure 1.44: Matrix Viewer block (CMATVIEW)
Umrao
igure 1.44: Matrix Viewer block (CMATVIEW)
igure 1.44: Matrix Viewer block (CMATVIEW)
1.2. SINK OF DATA BLOCKS 37
0.4285714
0.5714286
0.7142857
0.8571429
1.


Let the matrix elements are arranged in the xy-plane taking x-axis as rows and y-axis as
columns. The experimental matrix is

1 -- M=[0 1 2; 2 3 4; 4 5 6;6 7 8]



M=
0. 1. 2.
2. 3. 4.
4. 5. 6.
6. 7. 8.


Now, the minimum matrix value (say 0) is set to gray color level 0 and maximum matrix
value (say 8) is set to gray color level 1. The intermediate distinct matrix elements are
assigned proposed gray color code from equally distributed gray colormap values ranging
from 0 to 1 as shown in the below table.
Matrix Element Proposed Gray Code
0 0.000
1 0.125
2 0.250
3 0.375
4 0.500
5 0.625
6 0.750
7 0.875
8 1.000
As there are 8 colormap levels and 9 distinct matrix elements, hence the proposed
gray color codes are rounded to near gray colormap values of actual gray colormap. Thus
the actual table will be
Arun
Matrix Elemen
Umrao
Proposed Gray Code
0.000
38 Blocks Pallets
Elements Proposed Gray Code Actual Gray Code
0 0.000 0.000
1 0.125 0.143
2 0.250 0.286
3 0.375 0.429
4 0.500 0.571
5 0.625 0.714
6 0.750 0.857
7 0.875 1.000
8 1.000 1.000
The matrix nodes are as
cols
rows
(0,0.000)
(1,0.143)
(2,0.286)
(2,0.286)
(3,0.429)
(4,0.571)
(4,0.571)
(5,0.714)
(6,0.857)
(6,0.857)
(7,1.000)
(8,1.000)
These matrix arrangement creates grid blocks/cells as shown below:
cols
rows
(0,0.000)
(1,0.143)
(2,0.286)
(2,0.286)
(3,0.429)
(4,0.571)
(4,0.571)
(5,0.714)
(6,0.857)
(6,0.857)
(7,1.000)
(8,1.000)
Arun
Arun
(1,0.143)
(3,0.429)
(3,0.429) Umrao
(5,0.714)
(5,0.714)
(7,1.000)
(7,1.000)
1.2. SINK OF DATA BLOCKS 39
Now, for each cell, its corner values are used for calculation of average gray scale for
that cell. So, the first cell has gray value as
g =
0.000 + 0.286 + 0.143 + 0.429
4
= 0.2145
cols
rows
(0,0.000)
(1,0.143)
(2,0.286)
(2,0.286)
(3,0.429)
(4,0.571)
(4,0.571)
(5,0.714)
(6,0.857)
(6,0.857)
(7,1.000)
(8,1.000)
0.215
The shading of this cell be like
cols
rows
(0,0.000)
(1,0.143)
(2,0.286)
(2,0.286)
(3,0.429)
(4,0.571)
(4,0.571)
(5,0.714)
(6,0.857)
(6,0.857)
(7,1.000)
(8,1.000)
0.215
Now, we can calculate average gray scales/levels for other cells and their background
can be filled by appropriate gray colors as shown in the following figure.
Arun
(0,0.000)
0,0.000) (2,0.286)
The shading of this cell be like
The shading of this cell be like
Umrao
(4,0.571)
(4,0.571) (6,0.857)
40 Blocks Pallets
cols
rows
(0,0.000)
(1,0.143)
(2,0.286)
(2,0.286)
(3,0.429)
(4,0.571)
(4,0.571)
(5,0.714)
(6,0.857)
(6,0.857)
(7,1.000)
(8,1.000)
0.215 0.500 0.785
0.357 0.642 0.892
1.2.8 Single Display Scope
Single display scope displays its input with respect to simulation time. User can change
the refresh time, maximum and minimum value of axes. It has one control port and one
input port.
Figure 1.45: Single Display Scope (CSCOPE)
This scope can be customized from the setting dialogue which can be opened by double
clicking one it. The default input size of this scope is 8, i.e. data vector size shall be
less than or equal to ‘8’. The color is a vector of integers. The ith
element is the color
number or marker type used to draw the evolution of the ith
input port signal. Colors
are defined by positive integers i.e. color index relative to the current colormap and
markers are defined by negative integers. The marker type are identified by an integer
in range of 0 to -14 which stands respectively for: dot, plus, cross, star, filled diamond,
diamond, triangle up, triangle down, diamond plus, circle, asterisk, square, triangle right,
triangle left and pentagram. Note that, this scope automatically detects the number of
data groups coming inside and plots different/multiple plots in same graphics window.
In the following figure, a sine wave is plotted at single scope window.
Arun Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
1.2. SINK OF DATA BLOCKS 41
Clock c
CScope
GenSin f
The output will be like
−2
−1
0
1
2
0 3 6 9 12 15 18 21 24 27 30
y
t
For grouping of multiple data, Multiplexure is used. In the following figure, two sine
wave data is multiplexed before passing it to input port of single scope viewer. Here both
data are plotted in same graph window as shown in the output.
Clock c
CScope
GenSin f
GenSin f
The output will be like
Arun
Arun
Arun
Arun
Arun
Arun
3 6 9 12 15 18 21 24 27 30
3 6 9 12 15 18 21 24 27 30
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
3 6 9 12 15 18 21 24 27 30
3 6 9 12 15 18 21 24 27 30
42 Blocks Pallets
−2
−1
0
1
2
0 3 6 9 12 15 18 21 24 27 30
y
t
1.2.9 Multiple Display Scope
Multiple display scope displays its different input values simultaneously with respect to
simulation time . User can change the refresh time, number of input port  its size and
type, maximum and minimum value of axes for each input ports and buffer size etc. The
size of input port of the multiple display scope should be equal to the size of data received
from the output port of other block. It accepts continuous data or row matrix or column
matrix or vector data types. For continuous data type, input port size is 1, and for row
or column matrix or vector data, the input port size is size of row or column matrix or
vector. The size of input port is set accordingly. Matrix data of m × n type can not be
directly fed to this display scope. It has one control port and user defined multiple input
port. This scope draws subplots in different subgraphics windows for each input port
data.
Figure 1.46: Multiple Display Scope (CMSCOPE)
For the input ports of this block, user must be familiar with size of the ports and type
of the ports. For example, in the field ‘input port sizes’ in setting dialogue, if data is
placed as ‘1 1’ then it represents to two input ports as ‘1’ is written two times separated
with space. Similarly, ‘1 1 1’ represents to three input ports. ‘1 2 1’ is also represents
to three input ports but these ports are of different type. ‘1’ represents that a port
can receives or transmits only one column vector (1 × 1 vector), which is also known as
continuous scalar data. While ‘2’ represents that a port can receives or transmits only
two column vector (1 × 2 vector). It is also known as row matrix data. Similarly ‘7’
represents a vector having seven columns (1 × 7 vector) and so on. Remember that a
Scope needs the drawing color equal to the sum of size of all ports. If there are two ports
of size 3 and 7 respectively, then there is required to define 3+7 = 10 colours in ‘Drawing
colors or marks’ field. There are also required to set the separate values of Ymin, Ymax
and refresh rate for each input port.
Arun
matrix or vector data types. For continuous data type, input port size is 1, and for row
matrix or vector data types. For continuous data type, input port size is 1, and for row
or column matrix or vector data, the input port size is size of row or column matrix or
or column matrix or vector data, the input port size is size of row or column matrix or
vector. The size of input port is set accordingly. Matrix data of
vector. The size of input port is set accordingly. Matrix data of
directly fed to this display scope. It has one control port and user defined multiple input
directly fed to this display scope. It has one control port and user defined multiple input
Umrao
matrix or vector data types. For continuous data type, input port size is 1, and for row
matrix or vector data types. For continuous data type, input port size is 1, and for row
or column matrix or vector data, the input port size is size of row or column matrix or
or column matrix or vector data, the input port size is size of row or column matrix or
vector. The size of input port is set accordingly. Matrix data of
vector. The size of input port is set accordingly. Matrix data of m
m × n
n
directly fed to this display scope. It has one control port and user defined multiple input
directly fed to this display scope. It has one control port and user defined multiple input
1.2. SINK OF DATA BLOCKS 43
Clock c
CScope
GenSin f
GenSin f
The output will be like
−2
−1
0
0 3 6 9 12 15 18 21 24 27 30
−2
−1
0
0 3 6 9 12 15 18 21 24 27 30
1.2.10 XY Single Display Scope
This block visualize the two inputs signals by drawing the second input as a function of
the first input at any instant of time. When a point is drawn on screen it stays until the
simulation is finished. It has two input ports and one control ports. One of the two input
ports is for variable and second is for function of variable.
y = f(x)
Figure 1.47: XY Single Display Scope (CSCOPXY)
The simplest form of block arrangement is given in the following figure.
Arun
Arun Umrao
Umrao
44 Blocks Pallets
Clock c
CSCOPXY
TIME f
SIN
SINBLK f
A moving dot with trailing curve is used to show the animated path. It is animated
like the figure given below:
−1
−0.5
0
0.5
1.0
0 1 2 3 4 5 6 7
1.2.11 XY 3D Single Display Scope
This block visualize the two inputs signals by drawing the second input as a function of
the first input at any instant of time. When a point is drawn on screen it stays until
the simulation is finished. It has two input ports and one control ports. Two of the
three input ports are for variables and third is for function of variables. The mathematics
behind the visualization is
f(z) = f(x, y)
Figure 1.48: XY 3D Single Display Scope (CSCOPXY3D)
The simplest form of block arrangement is given in the following figure.
Arun
0 1 2
1.2.11 XY 3D Single Display Scope
1.2.11 XY 3D Single Display Scope
Umrao
3
3 4 5 6 7
1.2.11 XY 3D Single Display Scope
1.2.11 XY 3D Single Display Scope
1.2. SINK OF DATA BLOCKS 45
Clock c
CSCOPXY3D
TIME f
SIN
SINBLK f
A moving dot with trailing curve is used to show the animated path. It is animated
like the figure given below:
x
y
z
1.2.12 Terminating Blocks
A terminating block ends the simulation when simulation time is encounter to the time
specified in terminating blocks. There are three types of terminating blocks. First is ‘End
Block’: it ends the simulation after the time specified in the end block. It has no ports.
END
Figure 1.49: End Block (ENDBLK)
Second type of terminating block is ending counter. It received current time from
control port and matches with defined final time in itself. If both are equal, it instructs
final simulation time otherwise passes current time from command port. This block has
one control port and one command port.
END
Figure 1.50: End Block (END c)
Arun
Arun
Arun
Arun
y
y
Arun
Arun Umrao
Umrao
Umrao
Umrao
46 Blocks Pallets
Third is halt block.
HALT
Figure 1.51: Halt Block (HALT f)
Some times, there is situation when one or more ports are need to keep open but
simulation can not be processed if one or more ports are hanging. So to keep these ports
close we use trash block. It just make port close and all the data received at this port is
considered as junk. This block works as terminating blocks and do nothing.
Trash
Figure 1.52: Trash Function block (TRASH f)
1.2.13 Writing to Audio File
This block writes the sound data in *.au file format. It has one control port and one
input port. Generally file is saved in the same directory where *.xcos file is saved but
user can change the name and path of the writing file. Before using this block, user must
have writing permissions.
Write to audio
Figure 1.53: Write AU to devaudio (WRITEAU f)
1.2.14 Writing to ‘C’ Binary File
This block writes the data in binary ‘C’ file. It has one control port and one input port.
Generally file is saved in the same directory where *.xcos file is saved but user can change
the name and path of the writing file. Before using this block, user must have writing
permissions.
Write to C
Figure 1.54: Write To Binary ‘C’ (WRITEC f)
Arun
.2.13 Writing to Audio File
.2.13 Writing to Audio File
This block writes the sound data in *.au file format. It has one control port and one
This block writes the sound data in *.au file format. It has one control port and one
input port. Generally file is saved in the same directory where *.xcos file is saved but
input port. Generally file is saved in the same directory where *.xcos file is saved but
Umrao
This block writes the sound data in *.au file format. It has one control port and one
This block writes the sound data in *.au file format. It has one control port and one
input port. Generally file is saved in the same directory where *.xcos file is saved but
input port. Generally file is saved in the same directory where *.xcos file is saved but
1.2. SINK OF DATA BLOCKS 47
1. Input Size : It is size of input column vector. A scalar that determines the how
many columns of data values are used to form a record. This description must
be read with the data output format description. Suppose, we have define integer
datatype data format and input size is 2 then total 8 bytes shall be used to write a
record of data in binary form. The data received at input port of WRITEC f block
must be of same size as defined in the Input Size option.
2. Output File Name : It is a file name or path file name where data would be written.
Its value is string of characters.
3. Output Format : A character string defining the data format to use. Strings “l”,
“i”, “s”, “ul”, “ui”, “us”, “d”, “f”, “c”, “uc” are used respectively to write int32,
int16, int8, uint32, uint16, uint8, double, float, char or unsigned char data type.
4. Buffer Size : It is similar to the number of bytes read by fread function of C language.
5. Swap Mode : If swap mode=1 then file is supposed to be coded in “little endian
IEEE format” and data are swapped if necessary to match the IEEE format of the
processor. If Swap mode=0 then automatic bytes swap is disabled.
Clock c
Write to C
GenSin f
The above block diagram is indicative purpose about the use of WRITEC f. The data
written by this block is in format as shown below:
rec[4]
20 4
byte[1] byte[2]
rec[5]
40 12
byte[1] byte[2]
rec[6]
60 20
byte[1] byte[2]
rec[7]
80 28
byte[1] byte[2]
wr
In this figure, we have explained that the character type data with size two is saved in
binary format. First byte is for one of the two data elements of a record and second byte
is for other of the two data elements of a record. The number of bytes required depends
on the type of data and size of data. A character data type requires one byte memory
space and if record size is two then two bytes are required to save a record. If data type
is integer type and data size is two, then memory arrangement shall be like
rec[4]
0 0 20 4
byte[1] byte[2] byte[3] byte[4]
rec[5]
0 0 40 12
byte[1] byte[2] byte[3] byte[4]
rec[6]
0 0 60 20
byte[1] byte[2] byte[3] byte[4]
wr
Arun Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
Umrao
48 Blocks Pallets
Note that, index origin has been implemented in different programming languages
differently. The equivalent decimal number in each memory byte represents the binary
value saved in that memory cell.
1.3 Mathematical Blocks
In this section, those blocks are discussed which are used in mathematical operations.
1.3.1 Max  Min
Max  min block compares the two input values and returns the minimum or maximum
value as the conditions are defined. This block can be used in vector mode only i.e. input
should be supplied only vector values. If zero crossing is set true then negative value
would also be returned.
MAX
Figure 1.55: Max-Min block (MAXMIN)
This block acts as Min block if min/max input option is set to 1 and acts as Max
block if min/max input option is set to 2. It may be set for one input or two inputs. A
schematic diagram is shown for working of Max/Min block.
Clock c
CScope
TIME f
SIN
SINBLK f
TIME f
COS
COSBLK f
MAX
In this block two inputs, one sine value and other cosine value are entered into the
max/min block. The block is set to max state, i.e. the maximum value of the two inputs
will be found at its output port. Therefore, the final plot shall be plot of the maximum
value between sine and cosine values. The time clock starts from 0 to continue. The
number of input ports in max/min block is set to two and zero crossing is allowed. The
output of this schematic diagram will be as shown below:
Arun
This block acts as Min block if min/max input option is set to 1 and acts as Max
This block acts as Min block if min/max input option is set to 1 and acts as Max
block if min/max input option is set to 2. It may be set for one input or two inputs. A
block if min/max input option is set to 2. It may be set for one input or two inputs. A
Umrao
This block acts as Min block if min/max input option is set to 1 and acts as Max
This block acts as Min block if min/max input option is set to 1 and acts as Max
block if min/max input option is set to 2. It may be set for one input or two inputs. A
block if min/max input option is set to 2. It may be set for one input or two inputs. A
1.3. MATHEMATICAL BLOCKS 49
−1
−0.5
0
0.5
1.0
0 3 6 9 12 15 18 21 24 27 30
−1
−0.5
0
0.5
1.0
0 3 6 9 12 15 18 21 24 27 30
−1
−0.5
0
0.5
1.0
0 3 6 9 12 15 18 21 24 27 30
When the max/min block is set to minimum state, the output of updated configured
schematic block diagram will be as shown below:
−1
−0.5
0
0.5
1.0
0 3 6 9 12 15 18 21 24 27 30
−1
−0.5
0
0.5
1.0
0 3 6 9 12 15 18 21 24 27 30
−1
−0.5
0
0.5
1.0
0 3 6 9 12 15 18 21 24 27 30
Arun
When the max/min block is set to minimum state, the output of updated
When the max/min block is set to minimum state, the output of updated
schematic block diagram will be as shown below:
schematic block diagram will be as shown below:
Umrao
When the max/min block is set to minimum state, the output of updated
When the max/min block is set to minimum state, the output of updated
schematic block diagram will be as shown below:
schematic block diagram will be as shown below:
50 Blocks Pallets
1.3.2 Max Only Block
Max block returns the maximum value of all supplied values. Max block can be used in
matrix mode of input data. It has only one input port and one output port. The max
block is
MAX
Figure 1.56: Max block (MAX f)
If
A =
4 8 6
9 1 12
4 7 3
is input to this block then it gives 12 as its output. The value 12 is maximum among all
elements of the given matrix.
1.3.3 Min Only Block
Min block returns the minimum value of all supplied values. Min block can be used in
matrix mode of input data. It has only one input port and one output port. Min block is
MIN
Figure 1.57: Min block (MIN f)
If
A =
4 8 6
9 1 12
4 7 3
is input to this block then it gives 1 as its output. The value 1 is minimum among all
elements of the given matrix.
1.3.4 Square Root Block
A function f(x) =
√
x is called square root function of x. The type of roots can be set
by user. It has only one input port and one output port.
SQRT
Figure 1.58: Square root block (SQRT)
Arun
Min block returns the minimum value of all supplied values. Min block can be used in
Min block returns the minimum value of all supplied values. Min block can be used in
matrix mode of input data. It has only one input port and one output port. Min block is
matrix mode of input data. It has only one input port and one output port. Min block is
Umrao
Min block returns the minimum value of all supplied values. Min block can be used in
Min block returns the minimum value of all supplied values. Min block can be used in
matrix mode of input data. It has only one input port and one output port. Min block is
matrix mode of input data. It has only one input port and one output port. Min block is
1.3. MATHEMATICAL BLOCKS 51
If square root block is set to real only (data type = 1) then it gives output when input
is only positive value as
√
−n is an imaginary value. There is NULL result if input is a
negative number. It can also be set to complex mode by changing its data type to 2 in
setting dialogue.
1.3.5 Absolute Value
Absolute value is mod value of a real number. If given number is positive or negative its
absolute value is always positive in nature. The absolute block returns only positive form
of a positive or negative real number. The absolute block is
ABS
Figure 1.59: Absolute value block (ABS VALUE)
Mathematically
f(x) =

−a when a  0
a when a ≥ 0
A schematic diagram is shown for working of absolute block.
Clock c
CScope
TIME f
COS
COSBLK f
ABS
The output of this schematic diagram will be as shown below:
Arun
A schematic diagram is shown for working of absolute block.
A schematic diagram is shown for working of absolute block.
Umrao
A schematic diagram is shown for working of absolute block.
A schematic diagram is shown for working of absolute block.
Notes and Description for Xcos Scilab Block Simulation with Suitable Examples by Arun Umrao
Notes and Description for Xcos Scilab Block Simulation with Suitable Examples by Arun Umrao
Notes and Description for Xcos Scilab Block Simulation with Suitable Examples by Arun Umrao
Notes and Description for Xcos Scilab Block Simulation with Suitable Examples by Arun Umrao
Notes and Description for Xcos Scilab Block Simulation with Suitable Examples by Arun Umrao
Notes and Description for Xcos Scilab Block Simulation with Suitable Examples by Arun Umrao
Notes and Description for Xcos Scilab Block Simulation with Suitable Examples by Arun Umrao
Notes and Description for Xcos Scilab Block Simulation with Suitable Examples by Arun Umrao
Notes and Description for Xcos Scilab Block Simulation with Suitable Examples by Arun Umrao
Notes and Description for Xcos Scilab Block Simulation with Suitable Examples by Arun Umrao
Notes and Description for Xcos Scilab Block Simulation with Suitable Examples by Arun Umrao
Notes and Description for Xcos Scilab Block Simulation with Suitable Examples by Arun Umrao
Notes and Description for Xcos Scilab Block Simulation with Suitable Examples by Arun Umrao
Notes and Description for Xcos Scilab Block Simulation with Suitable Examples by Arun Umrao
Notes and Description for Xcos Scilab Block Simulation with Suitable Examples by Arun Umrao
Notes and Description for Xcos Scilab Block Simulation with Suitable Examples by Arun Umrao
Notes and Description for Xcos Scilab Block Simulation with Suitable Examples by Arun Umrao
Notes and Description for Xcos Scilab Block Simulation with Suitable Examples by Arun Umrao
Notes and Description for Xcos Scilab Block Simulation with Suitable Examples by Arun Umrao
Notes and Description for Xcos Scilab Block Simulation with Suitable Examples by Arun Umrao
Notes and Description for Xcos Scilab Block Simulation with Suitable Examples by Arun Umrao
Notes and Description for Xcos Scilab Block Simulation with Suitable Examples by Arun Umrao
Notes and Description for Xcos Scilab Block Simulation with Suitable Examples by Arun Umrao
Notes and Description for Xcos Scilab Block Simulation with Suitable Examples by Arun Umrao
Notes and Description for Xcos Scilab Block Simulation with Suitable Examples by Arun Umrao
Notes and Description for Xcos Scilab Block Simulation with Suitable Examples by Arun Umrao
Notes and Description for Xcos Scilab Block Simulation with Suitable Examples by Arun Umrao
Notes and Description for Xcos Scilab Block Simulation with Suitable Examples by Arun Umrao
Notes and Description for Xcos Scilab Block Simulation with Suitable Examples by Arun Umrao
Notes and Description for Xcos Scilab Block Simulation with Suitable Examples by Arun Umrao
Notes and Description for Xcos Scilab Block Simulation with Suitable Examples by Arun Umrao
Notes and Description for Xcos Scilab Block Simulation with Suitable Examples by Arun Umrao
Notes and Description for Xcos Scilab Block Simulation with Suitable Examples by Arun Umrao
Notes and Description for Xcos Scilab Block Simulation with Suitable Examples by Arun Umrao
Notes and Description for Xcos Scilab Block Simulation with Suitable Examples by Arun Umrao
Notes and Description for Xcos Scilab Block Simulation with Suitable Examples by Arun Umrao
Notes and Description for Xcos Scilab Block Simulation with Suitable Examples by Arun Umrao
Notes and Description for Xcos Scilab Block Simulation with Suitable Examples by Arun Umrao
Notes and Description for Xcos Scilab Block Simulation with Suitable Examples by Arun Umrao
Notes and Description for Xcos Scilab Block Simulation with Suitable Examples by Arun Umrao
Notes and Description for Xcos Scilab Block Simulation with Suitable Examples by Arun Umrao
Notes and Description for Xcos Scilab Block Simulation with Suitable Examples by Arun Umrao
Notes and Description for Xcos Scilab Block Simulation with Suitable Examples by Arun Umrao
Notes and Description for Xcos Scilab Block Simulation with Suitable Examples by Arun Umrao
Notes and Description for Xcos Scilab Block Simulation with Suitable Examples by Arun Umrao
Notes and Description for Xcos Scilab Block Simulation with Suitable Examples by Arun Umrao
Notes and Description for Xcos Scilab Block Simulation with Suitable Examples by Arun Umrao
Notes and Description for Xcos Scilab Block Simulation with Suitable Examples by Arun Umrao
Notes and Description for Xcos Scilab Block Simulation with Suitable Examples by Arun Umrao
Notes and Description for Xcos Scilab Block Simulation with Suitable Examples by Arun Umrao
Notes and Description for Xcos Scilab Block Simulation with Suitable Examples by Arun Umrao
Notes and Description for Xcos Scilab Block Simulation with Suitable Examples by Arun Umrao
Notes and Description for Xcos Scilab Block Simulation with Suitable Examples by Arun Umrao
Notes and Description for Xcos Scilab Block Simulation with Suitable Examples by Arun Umrao
Notes and Description for Xcos Scilab Block Simulation with Suitable Examples by Arun Umrao
Notes and Description for Xcos Scilab Block Simulation with Suitable Examples by Arun Umrao
Notes and Description for Xcos Scilab Block Simulation with Suitable Examples by Arun Umrao
Notes and Description for Xcos Scilab Block Simulation with Suitable Examples by Arun Umrao
Notes and Description for Xcos Scilab Block Simulation with Suitable Examples by Arun Umrao
Notes and Description for Xcos Scilab Block Simulation with Suitable Examples by Arun Umrao
Notes and Description for Xcos Scilab Block Simulation with Suitable Examples by Arun Umrao
Notes and Description for Xcos Scilab Block Simulation with Suitable Examples by Arun Umrao
Notes and Description for Xcos Scilab Block Simulation with Suitable Examples by Arun Umrao
Notes and Description for Xcos Scilab Block Simulation with Suitable Examples by Arun Umrao
Notes and Description for Xcos Scilab Block Simulation with Suitable Examples by Arun Umrao
Notes and Description for Xcos Scilab Block Simulation with Suitable Examples by Arun Umrao
Notes and Description for Xcos Scilab Block Simulation with Suitable Examples by Arun Umrao
Notes and Description for Xcos Scilab Block Simulation with Suitable Examples by Arun Umrao
Notes and Description for Xcos Scilab Block Simulation with Suitable Examples by Arun Umrao
Notes and Description for Xcos Scilab Block Simulation with Suitable Examples by Arun Umrao
Notes and Description for Xcos Scilab Block Simulation with Suitable Examples by Arun Umrao
Notes and Description for Xcos Scilab Block Simulation with Suitable Examples by Arun Umrao
Notes and Description for Xcos Scilab Block Simulation with Suitable Examples by Arun Umrao
Notes and Description for Xcos Scilab Block Simulation with Suitable Examples by Arun Umrao
Notes and Description for Xcos Scilab Block Simulation with Suitable Examples by Arun Umrao
Notes and Description for Xcos Scilab Block Simulation with Suitable Examples by Arun Umrao
Notes and Description for Xcos Scilab Block Simulation with Suitable Examples by Arun Umrao

More Related Content

What's hot

Mech tech power plant 09
Mech tech power plant 09Mech tech power plant 09
Mech tech power plant 09Yuri Melliza
 
Elementary algebra notes 001.pdf
Elementary algebra notes 001.pdfElementary algebra notes 001.pdf
Elementary algebra notes 001.pdfCyprianObota
 
Gauss Seidel Method of Power Flow
Gauss Seidel Method of Power FlowGauss Seidel Method of Power Flow
Gauss Seidel Method of Power FlowYunusAhmad9
 
11kVby400v, 20kVA three phase core type distribution transformer.
11kVby400v, 20kVA three phase core type distribution transformer.11kVby400v, 20kVA three phase core type distribution transformer.
11kVby400v, 20kVA three phase core type distribution transformer.Anamul Hasan
 
0620_s14_qp_33
0620_s14_qp_330620_s14_qp_33
0620_s14_qp_33King Ali
 
0580 w03 qp_2
0580 w03 qp_20580 w03 qp_2
0580 w03 qp_2King Ali
 
Optimization of an Energy-Generating Turnstile
Optimization of an Energy-Generating TurnstileOptimization of an Energy-Generating Turnstile
Optimization of an Energy-Generating TurnstileWayne Smith
 
Physics 0625 - Paper 3 version 2 - Question Paper - May Jun 2014
Physics 0625 - Paper 3 version 2 - Question Paper - May Jun 2014Physics 0625 - Paper 3 version 2 - Question Paper - May Jun 2014
Physics 0625 - Paper 3 version 2 - Question Paper - May Jun 2014JakKy Kitmanacharounpong
 
0580_s14_qp_43
0580_s14_qp_430580_s14_qp_43
0580_s14_qp_43King Ali
 
Design and Optimization of Knuckle Joint Using Trusses
Design and Optimization of Knuckle Joint Using TrussesDesign and Optimization of Knuckle Joint Using Trusses
Design and Optimization of Knuckle Joint Using TrussesAbdul Farhan
 
0625 m15 qp_32
0625 m15 qp_320625 m15 qp_32
0625 m15 qp_32Omniya Jay
 
Manish1 washing machine control
Manish1 washing machine controlManish1 washing machine control
Manish1 washing machine controlmanish rishi
 
3 phase Induction Motor frequency of induced emf current and power factor -...
3 phase Induction Motor   frequency of induced emf current and power factor -...3 phase Induction Motor   frequency of induced emf current and power factor -...
3 phase Induction Motor frequency of induced emf current and power factor -...karthi1017
 
0580_w13_qp_42
0580_w13_qp_420580_w13_qp_42
0580_w13_qp_42King Ali
 
0625 w10 ms_32
0625 w10 ms_320625 w10 ms_32
0625 w10 ms_32King Ali
 
vector control of induction motor
vector control of induction motorvector control of induction motor
vector control of induction motorDwaraka Pilla
 
Solution of skill Assessment Control Systems Engineering By Norman S.Nise 6t...
Solution of skill Assessment  Control Systems Engineering By Norman S.Nise 6t...Solution of skill Assessment  Control Systems Engineering By Norman S.Nise 6t...
Solution of skill Assessment Control Systems Engineering By Norman S.Nise 6t...janicetiong
 

What's hot (20)

Mech tech power plant 09
Mech tech power plant 09Mech tech power plant 09
Mech tech power plant 09
 
Elementary algebra notes 001.pdf
Elementary algebra notes 001.pdfElementary algebra notes 001.pdf
Elementary algebra notes 001.pdf
 
Gauss Seidel Method of Power Flow
Gauss Seidel Method of Power FlowGauss Seidel Method of Power Flow
Gauss Seidel Method of Power Flow
 
11kVby400v, 20kVA three phase core type distribution transformer.
11kVby400v, 20kVA three phase core type distribution transformer.11kVby400v, 20kVA three phase core type distribution transformer.
11kVby400v, 20kVA three phase core type distribution transformer.
 
0620_s14_qp_33
0620_s14_qp_330620_s14_qp_33
0620_s14_qp_33
 
Wind Tunnel Report
Wind Tunnel ReportWind Tunnel Report
Wind Tunnel Report
 
0580 w03 qp_2
0580 w03 qp_20580 w03 qp_2
0580 w03 qp_2
 
Optimization of an Energy-Generating Turnstile
Optimization of an Energy-Generating TurnstileOptimization of an Energy-Generating Turnstile
Optimization of an Energy-Generating Turnstile
 
Physics 0625 - Paper 3 version 2 - Question Paper - May Jun 2014
Physics 0625 - Paper 3 version 2 - Question Paper - May Jun 2014Physics 0625 - Paper 3 version 2 - Question Paper - May Jun 2014
Physics 0625 - Paper 3 version 2 - Question Paper - May Jun 2014
 
0580_s14_qp_43
0580_s14_qp_430580_s14_qp_43
0580_s14_qp_43
 
Control chap2
Control chap2Control chap2
Control chap2
 
Design and Optimization of Knuckle Joint Using Trusses
Design and Optimization of Knuckle Joint Using TrussesDesign and Optimization of Knuckle Joint Using Trusses
Design and Optimization of Knuckle Joint Using Trusses
 
0625 m15 qp_32
0625 m15 qp_320625 m15 qp_32
0625 m15 qp_32
 
Manish1 washing machine control
Manish1 washing machine controlManish1 washing machine control
Manish1 washing machine control
 
3 phase Induction Motor frequency of induced emf current and power factor -...
3 phase Induction Motor   frequency of induced emf current and power factor -...3 phase Induction Motor   frequency of induced emf current and power factor -...
3 phase Induction Motor frequency of induced emf current and power factor -...
 
Hormonics in induction motor
Hormonics in induction motorHormonics in induction motor
Hormonics in induction motor
 
0580_w13_qp_42
0580_w13_qp_420580_w13_qp_42
0580_w13_qp_42
 
0625 w10 ms_32
0625 w10 ms_320625 w10 ms_32
0625 w10 ms_32
 
vector control of induction motor
vector control of induction motorvector control of induction motor
vector control of induction motor
 
Solution of skill Assessment Control Systems Engineering By Norman S.Nise 6t...
Solution of skill Assessment  Control Systems Engineering By Norman S.Nise 6t...Solution of skill Assessment  Control Systems Engineering By Norman S.Nise 6t...
Solution of skill Assessment Control Systems Engineering By Norman S.Nise 6t...
 

Similar to Notes and Description for Xcos Scilab Block Simulation with Suitable Examples by Arun Umrao

Notes for C++ Programming / Object Oriented C++ Programming for MCA, BCA and ...
Notes for C++ Programming / Object Oriented C++ Programming for MCA, BCA and ...Notes for C++ Programming / Object Oriented C++ Programming for MCA, BCA and ...
Notes for C++ Programming / Object Oriented C++ Programming for MCA, BCA and ...ssuserd6b1fd
 
Introduction to c++ (cpp)
Introduction to c++ (cpp)Introduction to c++ (cpp)
Introduction to c++ (cpp)Arun Umrao
 
Think Like Scilab and Become a Numerical Programming Expert- Notes for Beginn...
Think Like Scilab and Become a Numerical Programming Expert- Notes for Beginn...Think Like Scilab and Become a Numerical Programming Expert- Notes for Beginn...
Think Like Scilab and Become a Numerical Programming Expert- Notes for Beginn...ssuserd6b1fd
 
Scilab help book 1 of 2
Scilab help book 1 of 2Scilab help book 1 of 2
Scilab help book 1 of 2Arun Umrao
 
Fortran programming help book
Fortran programming help bookFortran programming help book
Fortran programming help bookArun Umrao
 
Basic ForTran Programming - for Beginners - An Introduction by Arun Umrao
Basic ForTran Programming - for Beginners - An Introduction by Arun UmraoBasic ForTran Programming - for Beginners - An Introduction by Arun Umrao
Basic ForTran Programming - for Beginners - An Introduction by Arun Umraossuserd6b1fd
 
Math for programmers
Math for programmersMath for programmers
Math for programmersmustafa sarac
 
Notes for C Programming for MCA, BCA, B. Tech CSE, ECE and MSC (CS) 1 of 5 by...
Notes for C Programming for MCA, BCA, B. Tech CSE, ECE and MSC (CS) 1 of 5 by...Notes for C Programming for MCA, BCA, B. Tech CSE, ECE and MSC (CS) 1 of 5 by...
Notes for C Programming for MCA, BCA, B. Tech CSE, ECE and MSC (CS) 1 of 5 by...ssuserd6b1fd
 
Notes for c programming for mca, bca, b. tech cse, ece and msc (cs) 1 of 5 by...
Notes for c programming for mca, bca, b. tech cse, ece and msc (cs) 1 of 5 by...Notes for c programming for mca, bca, b. tech cse, ece and msc (cs) 1 of 5 by...
Notes for c programming for mca, bca, b. tech cse, ece and msc (cs) 1 of 5 by...ssuserd6b1fd
 
Cac he dong luc hoc rat hay
Cac he dong luc hoc rat hayCac he dong luc hoc rat hay
Cac he dong luc hoc rat hayĐức Hữu
 
Tinyos programming
Tinyos programmingTinyos programming
Tinyos programmingssuserf04f61
 
The C Preprocessor
The C PreprocessorThe C Preprocessor
The C Preprocessoriuui
 
Java Programming Notes for Beginners by Arun Umrao
Java Programming Notes for Beginners by Arun UmraoJava Programming Notes for Beginners by Arun Umrao
Java Programming Notes for Beginners by Arun Umraossuserd6b1fd
 
Modlica an introduction by Arun Umrao
Modlica an introduction by Arun UmraoModlica an introduction by Arun Umrao
Modlica an introduction by Arun Umraossuserd6b1fd
 
Modelica programming help book
Modelica programming help bookModelica programming help book
Modelica programming help bookArun Umrao
 

Similar to Notes and Description for Xcos Scilab Block Simulation with Suitable Examples by Arun Umrao (20)

Thats How We C
Thats How We CThats How We C
Thats How We C
 
Notes for C++ Programming / Object Oriented C++ Programming for MCA, BCA and ...
Notes for C++ Programming / Object Oriented C++ Programming for MCA, BCA and ...Notes for C++ Programming / Object Oriented C++ Programming for MCA, BCA and ...
Notes for C++ Programming / Object Oriented C++ Programming for MCA, BCA and ...
 
Introduction to c++ (cpp)
Introduction to c++ (cpp)Introduction to c++ (cpp)
Introduction to c++ (cpp)
 
Think Like Scilab and Become a Numerical Programming Expert- Notes for Beginn...
Think Like Scilab and Become a Numerical Programming Expert- Notes for Beginn...Think Like Scilab and Become a Numerical Programming Expert- Notes for Beginn...
Think Like Scilab and Become a Numerical Programming Expert- Notes for Beginn...
 
Scilab help book 1 of 2
Scilab help book 1 of 2Scilab help book 1 of 2
Scilab help book 1 of 2
 
Fortran programming help book
Fortran programming help bookFortran programming help book
Fortran programming help book
 
Basic ForTran Programming - for Beginners - An Introduction by Arun Umrao
Basic ForTran Programming - for Beginners - An Introduction by Arun UmraoBasic ForTran Programming - for Beginners - An Introduction by Arun Umrao
Basic ForTran Programming - for Beginners - An Introduction by Arun Umrao
 
Math for programmers
Math for programmersMath for programmers
Math for programmers
 
Notes for C Programming for MCA, BCA, B. Tech CSE, ECE and MSC (CS) 1 of 5 by...
Notes for C Programming for MCA, BCA, B. Tech CSE, ECE and MSC (CS) 1 of 5 by...Notes for C Programming for MCA, BCA, B. Tech CSE, ECE and MSC (CS) 1 of 5 by...
Notes for C Programming for MCA, BCA, B. Tech CSE, ECE and MSC (CS) 1 of 5 by...
 
c programming
c programmingc programming
c programming
 
Notes for c programming for mca, bca, b. tech cse, ece and msc (cs) 1 of 5 by...
Notes for c programming for mca, bca, b. tech cse, ece and msc (cs) 1 of 5 by...Notes for c programming for mca, bca, b. tech cse, ece and msc (cs) 1 of 5 by...
Notes for c programming for mca, bca, b. tech cse, ece and msc (cs) 1 of 5 by...
 
Cac he dong luc hoc rat hay
Cac he dong luc hoc rat hayCac he dong luc hoc rat hay
Cac he dong luc hoc rat hay
 
Tinyos programming
Tinyos programmingTinyos programming
Tinyos programming
 
10.1.1.652.4894
10.1.1.652.489410.1.1.652.4894
10.1.1.652.4894
 
The C Preprocessor
The C PreprocessorThe C Preprocessor
The C Preprocessor
 
Notes of Java
Notes of JavaNotes of Java
Notes of Java
 
Java Programming Notes for Beginners by Arun Umrao
Java Programming Notes for Beginners by Arun UmraoJava Programming Notes for Beginners by Arun Umrao
Java Programming Notes for Beginners by Arun Umrao
 
Electrónica digital: Logicsim
Electrónica digital: LogicsimElectrónica digital: Logicsim
Electrónica digital: Logicsim
 
Modlica an introduction by Arun Umrao
Modlica an introduction by Arun UmraoModlica an introduction by Arun Umrao
Modlica an introduction by Arun Umrao
 
Modelica programming help book
Modelica programming help bookModelica programming help book
Modelica programming help book
 

More from ssuserd6b1fd

Decreasing increasing functions by arun umrao
Decreasing increasing functions by arun umraoDecreasing increasing functions by arun umrao
Decreasing increasing functions by arun umraossuserd6b1fd
 
Distribution of normal data understanding it numerical way by arun umrao
Distribution of normal data   understanding it numerical way by arun umraoDistribution of normal data   understanding it numerical way by arun umrao
Distribution of normal data understanding it numerical way by arun umraossuserd6b1fd
 
Decreasing and increasing functions by arun umrao
Decreasing and increasing functions by arun umraoDecreasing and increasing functions by arun umrao
Decreasing and increasing functions by arun umraossuserd6b1fd
 
What is meaning of epsilon and delta in limits of a function by Arun Umrao
What is meaning of epsilon and delta in limits of a function by Arun UmraoWhat is meaning of epsilon and delta in limits of a function by Arun Umrao
What is meaning of epsilon and delta in limits of a function by Arun Umraossuserd6b1fd
 
Notes for GNU Octave - Numerical Programming - for Students - 02 of 02 by aru...
Notes for GNU Octave - Numerical Programming - for Students - 02 of 02 by aru...Notes for GNU Octave - Numerical Programming - for Students - 02 of 02 by aru...
Notes for GNU Octave - Numerical Programming - for Students - 02 of 02 by aru...ssuserd6b1fd
 
Notes for GNU Octave - Numerical Programming - for Students 01 of 02 by Arun ...
Notes for GNU Octave - Numerical Programming - for Students 01 of 02 by Arun ...Notes for GNU Octave - Numerical Programming - for Students 01 of 02 by Arun ...
Notes for GNU Octave - Numerical Programming - for Students 01 of 02 by Arun ...ssuserd6b1fd
 
Notes for C++ Programming / Object Oriented C++ Programming for MCA, BCA and ...
Notes for C++ Programming / Object Oriented C++ Programming for MCA, BCA and ...Notes for C++ Programming / Object Oriented C++ Programming for MCA, BCA and ...
Notes for C++ Programming / Object Oriented C++ Programming for MCA, BCA and ...ssuserd6b1fd
 
Think Like Scilab and Become a Numerical Programming Expert- Notes for Beginn...
Think Like Scilab and Become a Numerical Programming Expert- Notes for Beginn...Think Like Scilab and Become a Numerical Programming Expert- Notes for Beginn...
Think Like Scilab and Become a Numerical Programming Expert- Notes for Beginn...ssuserd6b1fd
 
Notes for C Programming for MCA, BCA, B. Tech CSE, ECE and MSC (CS) 5 of 5 by...
Notes for C Programming for MCA, BCA, B. Tech CSE, ECE and MSC (CS) 5 of 5 by...Notes for C Programming for MCA, BCA, B. Tech CSE, ECE and MSC (CS) 5 of 5 by...
Notes for C Programming for MCA, BCA, B. Tech CSE, ECE and MSC (CS) 5 of 5 by...ssuserd6b1fd
 
Notes for C Programming for MCA, BCA, B. Tech CSE, ECE and MSC (CS) 4 of 5 by...
Notes for C Programming for MCA, BCA, B. Tech CSE, ECE and MSC (CS) 4 of 5 by...Notes for C Programming for MCA, BCA, B. Tech CSE, ECE and MSC (CS) 4 of 5 by...
Notes for C Programming for MCA, BCA, B. Tech CSE, ECE and MSC (CS) 4 of 5 by...ssuserd6b1fd
 
Notes for C Programming for MCA, BCA, B. Tech CSE, ECE and MSC (CS) 3 of 5 b...
Notes for C Programming for MCA, BCA, B. Tech CSE, ECE and MSC (CS) 3 of 5  b...Notes for C Programming for MCA, BCA, B. Tech CSE, ECE and MSC (CS) 3 of 5  b...
Notes for C Programming for MCA, BCA, B. Tech CSE, ECE and MSC (CS) 3 of 5 b...ssuserd6b1fd
 
Notes for C Programming for MCA, BCA, B. Tech CSE, ECE and MSC (CS) 2 of 5 by...
Notes for C Programming for MCA, BCA, B. Tech CSE, ECE and MSC (CS) 2 of 5 by...Notes for C Programming for MCA, BCA, B. Tech CSE, ECE and MSC (CS) 2 of 5 by...
Notes for C Programming for MCA, BCA, B. Tech CSE, ECE and MSC (CS) 2 of 5 by...ssuserd6b1fd
 
Work and Energy Notes by Arun Umrao
Work and Energy Notes by Arun UmraoWork and Energy Notes by Arun Umrao
Work and Energy Notes by Arun Umraossuserd6b1fd
 
Notes of Units, Dimensions & Errors for IIT JEE by Arun Umrao
Notes of Units, Dimensions & Errors for IIT JEE by Arun UmraoNotes of Units, Dimensions & Errors for IIT JEE by Arun Umrao
Notes of Units, Dimensions & Errors for IIT JEE by Arun Umraossuserd6b1fd
 
Physics dictionary for CBSE, ISCE, Class X Students by Arun Umrao
Physics dictionary for CBSE, ISCE, Class X Students by Arun UmraoPhysics dictionary for CBSE, ISCE, Class X Students by Arun Umrao
Physics dictionary for CBSE, ISCE, Class X Students by Arun Umraossuserd6b1fd
 
Notes of 8085 micro processor Programming for BCA, MCA, MSC (CS), MSC (IT) &...
Notes of 8085 micro processor Programming  for BCA, MCA, MSC (CS), MSC (IT) &...Notes of 8085 micro processor Programming  for BCA, MCA, MSC (CS), MSC (IT) &...
Notes of 8085 micro processor Programming for BCA, MCA, MSC (CS), MSC (IT) &...ssuserd6b1fd
 
Notes of 8051 Micro Controller for BCA, MCA, MSC (CS), MSC (IT) & AMIE IEI- b...
Notes of 8051 Micro Controller for BCA, MCA, MSC (CS), MSC (IT) & AMIE IEI- b...Notes of 8051 Micro Controller for BCA, MCA, MSC (CS), MSC (IT) & AMIE IEI- b...
Notes of 8051 Micro Controller for BCA, MCA, MSC (CS), MSC (IT) & AMIE IEI- b...ssuserd6b1fd
 
Maxima CAS an introduction
Maxima CAS an introductionMaxima CAS an introduction
Maxima CAS an introductionssuserd6b1fd
 
Maxima & Minima of Functions - Differential Calculus by Arun Umrao
Maxima & Minima of Functions - Differential Calculus by Arun UmraoMaxima & Minima of Functions - Differential Calculus by Arun Umrao
Maxima & Minima of Functions - Differential Calculus by Arun Umraossuserd6b1fd
 
Principles of Linear Motion of Objects - Physics - Explained by Arun Umrao
Principles of Linear Motion of Objects - Physics - Explained by Arun UmraoPrinciples of Linear Motion of Objects - Physics - Explained by Arun Umrao
Principles of Linear Motion of Objects - Physics - Explained by Arun Umraossuserd6b1fd
 

More from ssuserd6b1fd (20)

Decreasing increasing functions by arun umrao
Decreasing increasing functions by arun umraoDecreasing increasing functions by arun umrao
Decreasing increasing functions by arun umrao
 
Distribution of normal data understanding it numerical way by arun umrao
Distribution of normal data   understanding it numerical way by arun umraoDistribution of normal data   understanding it numerical way by arun umrao
Distribution of normal data understanding it numerical way by arun umrao
 
Decreasing and increasing functions by arun umrao
Decreasing and increasing functions by arun umraoDecreasing and increasing functions by arun umrao
Decreasing and increasing functions by arun umrao
 
What is meaning of epsilon and delta in limits of a function by Arun Umrao
What is meaning of epsilon and delta in limits of a function by Arun UmraoWhat is meaning of epsilon and delta in limits of a function by Arun Umrao
What is meaning of epsilon and delta in limits of a function by Arun Umrao
 
Notes for GNU Octave - Numerical Programming - for Students - 02 of 02 by aru...
Notes for GNU Octave - Numerical Programming - for Students - 02 of 02 by aru...Notes for GNU Octave - Numerical Programming - for Students - 02 of 02 by aru...
Notes for GNU Octave - Numerical Programming - for Students - 02 of 02 by aru...
 
Notes for GNU Octave - Numerical Programming - for Students 01 of 02 by Arun ...
Notes for GNU Octave - Numerical Programming - for Students 01 of 02 by Arun ...Notes for GNU Octave - Numerical Programming - for Students 01 of 02 by Arun ...
Notes for GNU Octave - Numerical Programming - for Students 01 of 02 by Arun ...
 
Notes for C++ Programming / Object Oriented C++ Programming for MCA, BCA and ...
Notes for C++ Programming / Object Oriented C++ Programming for MCA, BCA and ...Notes for C++ Programming / Object Oriented C++ Programming for MCA, BCA and ...
Notes for C++ Programming / Object Oriented C++ Programming for MCA, BCA and ...
 
Think Like Scilab and Become a Numerical Programming Expert- Notes for Beginn...
Think Like Scilab and Become a Numerical Programming Expert- Notes for Beginn...Think Like Scilab and Become a Numerical Programming Expert- Notes for Beginn...
Think Like Scilab and Become a Numerical Programming Expert- Notes for Beginn...
 
Notes for C Programming for MCA, BCA, B. Tech CSE, ECE and MSC (CS) 5 of 5 by...
Notes for C Programming for MCA, BCA, B. Tech CSE, ECE and MSC (CS) 5 of 5 by...Notes for C Programming for MCA, BCA, B. Tech CSE, ECE and MSC (CS) 5 of 5 by...
Notes for C Programming for MCA, BCA, B. Tech CSE, ECE and MSC (CS) 5 of 5 by...
 
Notes for C Programming for MCA, BCA, B. Tech CSE, ECE and MSC (CS) 4 of 5 by...
Notes for C Programming for MCA, BCA, B. Tech CSE, ECE and MSC (CS) 4 of 5 by...Notes for C Programming for MCA, BCA, B. Tech CSE, ECE and MSC (CS) 4 of 5 by...
Notes for C Programming for MCA, BCA, B. Tech CSE, ECE and MSC (CS) 4 of 5 by...
 
Notes for C Programming for MCA, BCA, B. Tech CSE, ECE and MSC (CS) 3 of 5 b...
Notes for C Programming for MCA, BCA, B. Tech CSE, ECE and MSC (CS) 3 of 5  b...Notes for C Programming for MCA, BCA, B. Tech CSE, ECE and MSC (CS) 3 of 5  b...
Notes for C Programming for MCA, BCA, B. Tech CSE, ECE and MSC (CS) 3 of 5 b...
 
Notes for C Programming for MCA, BCA, B. Tech CSE, ECE and MSC (CS) 2 of 5 by...
Notes for C Programming for MCA, BCA, B. Tech CSE, ECE and MSC (CS) 2 of 5 by...Notes for C Programming for MCA, BCA, B. Tech CSE, ECE and MSC (CS) 2 of 5 by...
Notes for C Programming for MCA, BCA, B. Tech CSE, ECE and MSC (CS) 2 of 5 by...
 
Work and Energy Notes by Arun Umrao
Work and Energy Notes by Arun UmraoWork and Energy Notes by Arun Umrao
Work and Energy Notes by Arun Umrao
 
Notes of Units, Dimensions & Errors for IIT JEE by Arun Umrao
Notes of Units, Dimensions & Errors for IIT JEE by Arun UmraoNotes of Units, Dimensions & Errors for IIT JEE by Arun Umrao
Notes of Units, Dimensions & Errors for IIT JEE by Arun Umrao
 
Physics dictionary for CBSE, ISCE, Class X Students by Arun Umrao
Physics dictionary for CBSE, ISCE, Class X Students by Arun UmraoPhysics dictionary for CBSE, ISCE, Class X Students by Arun Umrao
Physics dictionary for CBSE, ISCE, Class X Students by Arun Umrao
 
Notes of 8085 micro processor Programming for BCA, MCA, MSC (CS), MSC (IT) &...
Notes of 8085 micro processor Programming  for BCA, MCA, MSC (CS), MSC (IT) &...Notes of 8085 micro processor Programming  for BCA, MCA, MSC (CS), MSC (IT) &...
Notes of 8085 micro processor Programming for BCA, MCA, MSC (CS), MSC (IT) &...
 
Notes of 8051 Micro Controller for BCA, MCA, MSC (CS), MSC (IT) & AMIE IEI- b...
Notes of 8051 Micro Controller for BCA, MCA, MSC (CS), MSC (IT) & AMIE IEI- b...Notes of 8051 Micro Controller for BCA, MCA, MSC (CS), MSC (IT) & AMIE IEI- b...
Notes of 8051 Micro Controller for BCA, MCA, MSC (CS), MSC (IT) & AMIE IEI- b...
 
Maxima CAS an introduction
Maxima CAS an introductionMaxima CAS an introduction
Maxima CAS an introduction
 
Maxima & Minima of Functions - Differential Calculus by Arun Umrao
Maxima & Minima of Functions - Differential Calculus by Arun UmraoMaxima & Minima of Functions - Differential Calculus by Arun Umrao
Maxima & Minima of Functions - Differential Calculus by Arun Umrao
 
Principles of Linear Motion of Objects - Physics - Explained by Arun Umrao
Principles of Linear Motion of Objects - Physics - Explained by Arun UmraoPrinciples of Linear Motion of Objects - Physics - Explained by Arun Umrao
Principles of Linear Motion of Objects - Physics - Explained by Arun Umrao
 

Recently uploaded

Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - InfographicHr365.us smith
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanyChristoph Pohl
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Velvetech LLC
 
Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Hr365.us smith
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样umasea
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfAlina Yurenko
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureDinusha Kumarasiri
 
What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....kzayra69
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWave PLM
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Andreas Granig
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...Christina Lin
 
英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作qr0udbr0
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based projectAnoyGreter
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaHanief Utama
 
The Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfThe Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfPower Karaoke
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideChristina Lin
 

Recently uploaded (20)

Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - Infographic
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...
 
Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with Azure
 
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort ServiceHot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
 
What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need It
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
 
英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based project
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief Utama
 
The Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfThe Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdf
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
 

Notes and Description for Xcos Scilab Block Simulation with Suitable Examples by Arun Umrao

  • 1. 1 XCOS BLOCK DESCRIPTION A SIMPLE NOTES Arun Umrao www.sites.google.com/view/arunumrao DRAFT COPY - GPL LICENSING Arun Umrao
  • 2. 2 Contents I Xcos Blocks 5 1 Blocks Pallets 7 1.1 Source of Data Blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 1.1.1 Clock Block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 1.1.2 Sampling Clock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 1.1.3 Time Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 1.1.4 Constant Block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 1.1.5 Curve Block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 1.1.6 Counter Block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 1.1.7 Sine Wave Generator . . . . . . . . . . . . . . . . . . . . . . . . . . 14 1.1.8 Square Wave Generator . . . . . . . . . . . . . . . . . . . . . . . . 15 1.1.9 Saw-tooth Wave Generator . . . . . . . . . . . . . . . . . . . . . . 15 1.1.10 Pulse Wave Generator . . . . . . . . . . . . . . . . . . . . . . . . . 16 1.1.11 Step Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 1.1.12 Modulo Counter . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 1.1.13 Ramp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 1.1.14 Random Generator . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 1.1.15 Read From Input File . . . . . . . . . . . . . . . . . . . . . . . . . 20 1.1.16 Read ‘C’ Binary File . . . . . . . . . . . . . . . . . . . . . . . . . . 24 1.1.17 Read Sound File . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 1.1.18 Signal Builder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 1.1.19 TK Scale . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 1.2 Sink of Data Blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 1.2.1 Display Floating Number . . . . . . . . . . . . . . . . . . . . . . . 28 1.2.2 Bar XY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 1.2.3 Floating Point Scope . . . . . . . . . . . . . . . . . . . . . . . . . . 29 1.2.4 XY Animated Viewer . . . . . . . . . . . . . . . . . . . . . . . . . 29 1.2.5 XY 3D Animated Viewer . . . . . . . . . . . . . . . . . . . . . . . 30 1.2.6 3D Matrix Viewer . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 1.2.7 Matrix Viewer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 1.2.8 Single Display Scope . . . . . . . . . . . . . . . . . . . . . . . . . . 38 1.2.9 Multiple Display Scope . . . . . . . . . . . . . . . . . . . . . . . . 40 1.2.10 XY Single Display Scope . . . . . . . . . . . . . . . . . . . . . . . 41 1.2.11 XY 3D Single Display Scope . . . . . . . . . . . . . . . . . . . . . 42 1.2.12 Terminating Blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . 43 1.2.13 Writing to Audio File . . . . . . . . . . . . . . . . . . . . . . . . . 44 1.2.14 Writing to ‘C’ Binary File . . . . . . . . . . . . . . . . . . . . . . . 44 1.3 Mathematical Blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46 1.3.1 Max & Min . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46 1.3.2 Max Only Block . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48 1.3.3 Min Only Block . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48 1.3.4 Square Root Block . . . . . . . . . . . . . . . . . . . . . . . . . . . 48 1.3.5 Absolute Value . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49 Arun 1.1.15 Read From Input File . . . . . . . . . . . . . . . . . . . . . . . . . 20 1.1.15 Read From Input File . . . . . . . . . . . . . . . . . . . . . . . . . 20 1.1.16 Read ‘C’ Binary File . . . . . . . . . . . . . . . . . . . . . . . . . . 24 1.1.16 Read ‘C’ Binary File . . . . . . . . . . . . . . . . . . . . . . . . . . 24 1.1.17 Read Sound File . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 1.1.17 Read Sound File . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 Umrao 1.1.15 Read From Input File . . . . . . . . . . . . . . . . . . . . . . . . . 20 1.1.15 Read From Input File . . . . . . . . . . . . . . . . . . . . . . . . . 20 1.1.16 Read ‘C’ Binary File . . . . . . . . . . . . . . . . . . . . . . . . . . 24 1.1.16 Read ‘C’ Binary File . . . . . . . . . . . . . . . . . . . . . . . . . . 24 1.1.17 Read Sound File . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 1.1.17 Read Sound File . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
  • 3. 3 1.3.6 Sum Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50 1.3.7 Big Sum . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51 1.3.8 Summation Block . . . . . . . . . . . . . . . . . . . . . . . . . . . 52 1.3.9 Sine Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52 1.3.10 Cosine Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53 1.3.11 Tangent Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54 1.3.12 Trigonometric Function . . . . . . . . . . . . . . . . . . . . . . . . 54 1.3.13 Product Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55 1.3.14 Product Block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56 1.3.15 Power Block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56 1.3.16 Exponential . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58 1.3.17 Gain of Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59 1.3.18 Inverse Value . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60 1.3.19 Logarithm Value . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61 1.4 Matrix Blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61 1.4.1 Cumulative Summation . . . . . . . . . . . . . . . . . . . . . . . . 61 1.4.2 Extraction of Line & Column . . . . . . . . . . . . . . . . . . . . . 62 1.4.3 Triangular Or Triangular Extraction . . . . . . . . . . . . . . . . . 62 1.4.4 Horizontal Concatenation . . . . . . . . . . . . . . . . . . . . . . . 63 1.4.5 Vertical Concatenation . . . . . . . . . . . . . . . . . . . . . . . . . 64 1.4.6 Determinant . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65 1.4.7 Diagonal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65 1.4.8 Matrix Division . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66 1.4.9 Eigenvectors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67 1.4.10 Exponential Matrix . . . . . . . . . . . . . . . . . . . . . . . . . . 68 1.4.11 Inverse Matrix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68 1.4.12 Lower & Upper Triangular Matrix (LU) . . . . . . . . . . . . . . . 69 1.4.13 Magnitude and Phi . . . . . . . . . . . . . . . . . . . . . . . . . . . 70 1.4.14 Matrix Multiplication . . . . . . . . . . . . . . . . . . . . . . . . . 70 1.4.15 Matrix Sum . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71 1.4.16 Matrix Transformation . . . . . . . . . . . . . . . . . . . . . . . . . 72 1.4.17 Conjugate Matrix . . . . . . . . . . . . . . . . . . . . . . . . . . . 73 1.4.18 Real & Imaginary Matrix . . . . . . . . . . . . . . . . . . . . . . . 73 1.4.19 Roots & Coefficients . . . . . . . . . . . . . . . . . . . . . . . . . . 74 1.4.20 Square Root of Matrix . . . . . . . . . . . . . . . . . . . . . . . . . 74 1.4.21 Sub Matrices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75 1.4.22 Riccati Equation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75 1.4.23 Singular Value Decomposition . . . . . . . . . . . . . . . . . . . . . 75 1.4.24 Pseudo Inverse Matrix . . . . . . . . . . . . . . . . . . . . . . . . . 80 1.4.25 Reshape Matrix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80 1.5 Discrete & Continuum . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81 1.5.1 Backlash . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81 1.5.2 Deadband . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82 1.5.3 Hystheresis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83 1.5.4 Rate Limiter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83 1.5.5 Discrete Transfer Function . . . . . . . . . . . . . . . . . . . . . . 85 1.5.6 Discrete Zero Pole . . . . . . . . . . . . . . . . . . . . . . . . . . . 85 Arun 1.4.6 Determinant . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65 1.4.6 Determinant . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65 1.4.7 Diagonal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65 1.4.7 Diagonal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65 1.4.8 Matrix Division . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66 1.4.8 Matrix Division . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66 1.4.9 Eigenvectors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67 1.4.9 Eigenvectors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67 Umrao 1.4.6 Determinant . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65 1.4.6 Determinant . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65 1.4.7 Diagonal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65 1.4.7 Diagonal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65 1.4.8 Matrix Division . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66 1.4.8 Matrix Division . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66 1.4.9 Eigenvectors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67 1.4.9 Eigenvectors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
  • 4. 4 1.5.7 Discrete State Space System . . . . . . . . . . . . . . . . . . . . . 86 1.5.8 Shift Register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86 1.5.9 Dummy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87 1.5.10 Continuous Transfer Function . . . . . . . . . . . . . . . . . . . . . 88 1.5.11 Continuous State Space System . . . . . . . . . . . . . . . . . . . . 88 1.5.12 Derivative . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89 1.5.13 Integration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90 1.5.14 PID Regulator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91 1.5.15 Continuous Linear System With Jump . . . . . . . . . . . . . . . . 92 1.5.16 Unit Delay Operator . . . . . . . . . . . . . . . . . . . . . . . . . . 92 1.5.17 Continuous Time Delay . . . . . . . . . . . . . . . . . . . . . . . . 92 1.5.18 Discrete Time Delay . . . . . . . . . . . . . . . . . . . . . . . . . . 93 1.5.19 Variable Time Delay . . . . . . . . . . . . . . . . . . . . . . . . . . 94 1.5.20 Variable Time Delay Function . . . . . . . . . . . . . . . . . . . . 98 1.6 Electrical Blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98 1.6.1 Electrical Resistor . . . . . . . . . . . . . . . . . . . . . . . . . . . 99 1.6.2 Electrical Variable Resistor . . . . . . . . . . . . . . . . . . . . . . 100 1.6.3 Electrical Capacitor . . . . . . . . . . . . . . . . . . . . . . . . . . 101 1.6.4 Electrical Inductor . . . . . . . . . . . . . . . . . . . . . . . . . . . 102 1.6.5 Electrical DC Voltage Source . . . . . . . . . . . . . . . . . . . . . 103 1.6.6 Sine Wave Voltage Source . . . . . . . . . . . . . . . . . . . . . . . 104 1.6.7 Variable AC Voltage Source . . . . . . . . . . . . . . . . . . . . . . 105 1.6.8 Electrical AC Voltage Source . . . . . . . . . . . . . . . . . . . . . 105 1.6.9 Controllable Modelica Current Source . . . . . . . . . . . . . . . . 106 1.6.10 Controllable Modelica Voltage Source . . . . . . . . . . . . . . . . 107 1.6.11 Electrical Current Sensor . . . . . . . . . . . . . . . . . . . . . . . 107 1.6.12 Electrical Potential Sensor . . . . . . . . . . . . . . . . . . . . . . . 108 1.6.13 Electrical Voltage Sensor . . . . . . . . . . . . . . . . . . . . . . . 109 1.6.14 Electrical Diode . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110 1.6.15 Ground . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111 1.6.16 Modelica Gyrator . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112 1.6.17 Ideal Transformer . . . . . . . . . . . . . . . . . . . . . . . . . . . 113 1.6.18 Ideal OpAmp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113 1.6.19 PNP Transistor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114 1.6.20 NPN Transistor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114 1.6.21 Simple NMOS Transistor . . . . . . . . . . . . . . . . . . . . . . . 115 1.6.22 Simple PMOS Transistor . . . . . . . . . . . . . . . . . . . . . . . 115 1.6.23 NoN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115 1.6.24 Input Zero Crossing . . . . . . . . . . . . . . . . . . . . . . . . . . 115 1.6.25 Zero Crossing General Block . . . . . . . . . . . . . . . . . . . . . 115 1.6.26 Negative to Positive Zero Crossing . . . . . . . . . . . . . . . . . . 116 1.6.27 Positive to Negative Zero Crossing . . . . . . . . . . . . . . . . . . 116 1.7 Signal Processing Blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117 1.7.1 Quantization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117 1.7.2 Sample And Hold . . . . . . . . . . . . . . . . . . . . . . . . . . . 118 1.7.3 Demultiplexer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119 1.7.4 Extractor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119 Arun 1.6.6 Sine Wave Voltage Source . . . . . . . . . . . . . . . . . . . . . . . 104 1.6.6 Sine Wave Voltage Source . . . . . . . . . . . . . . . . . . . . . . . 104 1.6.7 Variable AC Voltage Source . . . . . . . . . . . . . . . . . . . . . . 105 1.6.7 Variable AC Voltage Source . . . . . . . . . . . . . . . . . . . . . . 105 1.6.8 Electrical AC Voltage Source . . . . . . . . . . . . . . . . . . . . . 105 1.6.8 Electrical AC Voltage Source . . . . . . . . . . . . . . . . . . . . . 105 1.6.9 Controllable Modelica Current Source . . . . . . . . . . . . . . . . 106 1.6.9 Controllable Modelica Current Source . . . . . . . . . . . . . . . . 106 Umrao 1.6.6 Sine Wave Voltage Source . . . . . . . . . . . . . . . . . . . . . . . 104 1.6.6 Sine Wave Voltage Source . . . . . . . . . . . . . . . . . . . . . . . 104 1.6.7 Variable AC Voltage Source . . . . . . . . . . . . . . . . . . . . . . 105 1.6.7 Variable AC Voltage Source . . . . . . . . . . . . . . . . . . . . . . 105 1.6.8 Electrical AC Voltage Source . . . . . . . . . . . . . . . . . . . . . 105 1.6.8 Electrical AC Voltage Source . . . . . . . . . . . . . . . . . . . . . 105 1.6.9 Controllable Modelica Current Source . . . . . . . . . . . . . . . . 106 1.6.9 Controllable Modelica Current Source . . . . . . . . . . . . . . . . 106
  • 5. 5 1.7.5 GOTO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120 1.7.6 FROM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120 1.7.7 GOTOMO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121 1.7.8 FROMMO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121 1.7.9 Scope Of GOTO . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122 1.7.10 Scope Of GOTOMO . . . . . . . . . . . . . . . . . . . . . . . . . . 124 1.7.11 Clock Goto . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125 1.7.12 Clock From . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126 1.7.13 Select . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126 1.7.14 Multiplexer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127 1.7.15 Multi Port Switch . . . . . . . . . . . . . . . . . . . . . . . . . . . 128 1.7.16 Merge Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128 1.7.17 Relay . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129 1.7.18 Select . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129 1.7.19 Switch2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129 1.7.20 Switch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129 1.7.21 Self Switch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130 1.8 User Defined Blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130 1.8.1 New C . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130 Simulation Function . . . . . . . . . . . . . . . . . . . . . . . . . . 130 Is Block Implicit . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130 Input Port Size . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131 Output Port Size . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132 Input Event Size . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133 Output Event Size . . . . . . . . . . . . . . . . . . . . . . . . . . . 133 Initial Continuous State . . . . . . . . . . . . . . . . . . . . . . . . 133 Number of Zero Crossing Surfaces . . . . . . . . . . . . . . . . . . 133 Initial Discrete State . . . . . . . . . . . . . . . . . . . . . . . . . . 133 Real Parameters Vector . . . . . . . . . . . . . . . . . . . . . . . . 133 Integer Parameters Vector . . . . . . . . . . . . . . . . . . . . . . . 133 Initial Firing Vector . . . . . . . . . . . . . . . . . . . . . . . . . . 134 Direct Feedthrough . . . . . . . . . . . . . . . . . . . . . . . . . . . 134 Time Dependence . . . . . . . . . . . . . . . . . . . . . . . . . . . 134 1.8.2 Masked Super Block . . . . . . . . . . . . . . . . . . . . . . . . . . 134 1.8.3 Mathematical Expression . . . . . . . . . . . . . . . . . . . . . . . 134 1.8.4 Modelica Generic Block . . . . . . . . . . . . . . . . . . . . . . . . 134 Input Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135 Input Variables Types . . . . . . . . . . . . . . . . . . . . . . . . . 135 Output Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135 Output Variables Types . . . . . . . . . . . . . . . . . . . . . . . . 135 Parameters in Modelica . . . . . . . . . . . . . . . . . . . . . . . . 135 Parameters Properties . . . . . . . . . . . . . . . . . . . . . . . . . 136 Function name . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136 Parameter values . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136 1.8.5 Super Block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137 Ports for Connections in Super Block . . . . . . . . . . . . . . . . 139 Regular Input Port . . . . . . . . . . . . . . . . . . . . . . . . . . . 140 Arun Is Block Implicit . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130 Is Block Implicit . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130 Input Port Size . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131 Input Port Size . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131 Output Port Size . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132 Output Port Size . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132 Input Event Size . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133 Input Event Size . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133 Umrao Is Block Implicit . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130 Is Block Implicit . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130 Input Port Size . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131 Input Port Size . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131 Output Port Size . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132 Output Port Size . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132 Input Event Size . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133 Input Event Size . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133
  • 6. 6 Regular Output Port . . . . . . . . . . . . . . . . . . . . . . . . . . 140 Implicit Input Port . . . . . . . . . . . . . . . . . . . . . . . . . . . 140 Implicit Output Port . . . . . . . . . . . . . . . . . . . . . . . . . . 141 Event Input Port . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141 Event Output Port . . . . . . . . . . . . . . . . . . . . . . . . . . . 141 1.8.6 C Language . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141 Function Name . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142 Input Port Size . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143 Output Port Size . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144 System Parameters Vector . . . . . . . . . . . . . . . . . . . . . . . 144 1.8.7 ForTran . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144 Function Name . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144 System parameters vector . . . . . . . . . . . . . . . . . . . . . . . 144 Input Port Size . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144 Output Port Size . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145 1.8.8 Generic Block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145 Simulation Function . . . . . . . . . . . . . . . . . . . . . . . . . . 145 Function Type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145 Input Port Size . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145 Input Port Type . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146 Output Port Size . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146 Output Port Type . . . . . . . . . . . . . . . . . . . . . . . . . . . 146 Input Port Event Size . . . . . . . . . . . . . . . . . . . . . . . . . 147 Output Port Event Size . . . . . . . . . . . . . . . . . . . . . . . . 147 Initial Continuous State . . . . . . . . . . . . . . . . . . . . . . . . 147 Initial Discrete State . . . . . . . . . . . . . . . . . . . . . . . . . . 147 Initial Object State . . . . . . . . . . . . . . . . . . . . . . . . . . 147 Real Parameters Vector . . . . . . . . . . . . . . . . . . . . . . . . 147 Integer Parameters Vector . . . . . . . . . . . . . . . . . . . . . . . 147 Object Parameters List . . . . . . . . . . . . . . . . . . . . . . . . 147 Number of Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . 148 Number of Zero Crossing . . . . . . . . . . . . . . . . . . . . . . . 148 Initial Firing Vector . . . . . . . . . . . . . . . . . . . . . . . . . . 148 Direct Feed-through . . . . . . . . . . . . . . . . . . . . . . . . . . 148 Time Dependence . . . . . . . . . . . . . . . . . . . . . . . . . . . 148 1.8.9 Scilab Function Block . . . . . . . . . . . . . . . . . . . . . . . . . 148 Input Port Size . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148 Output Port Size . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149 Input Event Port Size . . . . . . . . . . . . . . . . . . . . . . . . . 149 Output Event Port Size . . . . . . . . . . . . . . . . . . . . . . . . 149 Initial Continuous State . . . . . . . . . . . . . . . . . . . . . . . . 149 Initial Discrete State . . . . . . . . . . . . . . . . . . . . . . . . . . 149 System Parameter Vector . . . . . . . . . . . . . . . . . . . . . . . 149 Initial Firing Vector . . . . . . . . . . . . . . . . . . . . . . . . . . 149 Is Block Always Active . . . . . . . . . . . . . . . . . . . . . . . . 150 1.9 Other Blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150 1.9.1 Annotation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150 Arun Output Port Size . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146 Output Port Size . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146 Output Port Type . . . . . . . . . . . . . . . . . . . . . . . . . . . 146 Output Port Type . . . . . . . . . . . . . . . . . . . . . . . . . . . 146 Input Port Event Size . . . . . . . . . . . . . . . . . . . . . . . . . 147 Input Port Event Size . . . . . . . . . . . . . . . . . . . . . . . . . 147 Output Port Event Size . . . . . . . . . . . . . . . . . . . . . . . . 147 Output Port Event Size . . . . . . . . . . . . . . . . . . . . . . . . 147 Umrao Output Port Size . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146 Output Port Size . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146 Output Port Type . . . . . . . . . . . . . . . . . . . . . . . . . . . 146 Output Port Type . . . . . . . . . . . . . . . . . . . . . . . . . . . 146 Input Port Event Size . . . . . . . . . . . . . . . . . . . . . . . . . 147 Input Port Event Size . . . . . . . . . . . . . . . . . . . . . . . . . 147 Output Port Event Size . . . . . . . . . . . . . . . . . . . . . . . . 147 Output Port Event Size . . . . . . . . . . . . . . . . . . . . . . . . 147
  • 9. 1.1. SOURCE OF DATA BLOCKS 9 1Blocks Pallets A Xcos model is created in the Xcos diagram panel. The diagram panel setup dialog can be opened by right clicking on the panel window and select of setup. From setup dialogue window we can set the final integration time (time upto which simulation takes place), real time scaling, Integrator absolute and relative tolerance (what amount of com- puted data shall be different from actual one), tolerance on time, maximum integration time interval, solver type and maximum step size etc. The same dialogue can be accessed from Setup submenu from Simulation menubar. From Xcos diagram panel and pallets we can create own simulating diagrams. There are ready-made blocks which are preinstall in Xcos. These blocks are called core Xcos blocks. There are few generic and user defined blocks through them we can access the other language in for analysis and computations. In xcos, familiarity with data type and port size is crucial for simulations. There are three main data arrangement in xcos. (i) Scalar data, (ii) Vector data and (iii) Matrix data. A scalar data is continuous data whose dimension always remains 1 × 1. Scalar data has infinite numbers of elements. Vector data is either of 1× n or m× 1 size. Vector data has fixed number of elements. A matrix data is always represented as m×n. It has also fixed number of elements. A function block accepts or transmits continuous data. A matrix block accepts or transmits vector or matrix data. To differentiate between function blocks and matrix blocks, their block name are ended with f and m (also contains MAT word in their block name) respectively. 1.1 Source of Data Blocks In Xcos, source blocks are those blocks where a pulse, signal or wave is generated. 1.1.1 Clock Block Clock block in Xcos is module that trigger pulses to another block. The maximum frequency of clock in Xcos is less than or equal to the processor frequency. The clock symbol is Figure 1.1: Clock (Clock c) This clock has one command port. In clock block, its frequency and initial time can be set as required. Following example uses the clock. Arun fixed number of elements. A matrix data is always represented as fixed number of elements. A matrix data is always represented as number of elements. A function block accepts or transmits continuous data. A matrix number of elements. A function block accepts or transmits continuous data. A matrix block accepts or transmits vector or matrix data. To differentiate between function blocks block accepts or transmits vector or matrix data. To differentiate between function blocks and matrix blocks, their block name are ended with and matrix blocks, their block name are ended with Umrao fixed number of elements. A matrix data is always represented as fixed number of elements. A matrix data is always represented as number of elements. A function block accepts or transmits continuous data. A matrix number of elements. A function block accepts or transmits continuous data. A matrix block accepts or transmits vector or matrix data. To differentiate between function blocks block accepts or transmits vector or matrix data. To differentiate between function blocks and matrix blocks, their block name are ended with and matrix blocks, their block name are ended with f and f and m (also contains MAT word m (also contains MAT word
  • 10. 10 Blocks Pallets Clock c CScope GenSin f Figure 1.2: In this configuration, a clock is used to refresh the single scope for showing the sine wave generated by sine function generator. The output will be like −10 −5 0 5 10 0 3 6 9 12 15 18 21 24 27 30 y t Figure 1.3: Output of simulation 1.2. A point to be noted that the period of clock is time period of one oscillation and its reverse is frequency of clock. T = 1 f ⇒ f = 1 T 1.1.2 Sampling Clock Another clock is sample clock whose frequency is calculated as greatest common divisor of all same offset blocks. Sampling clock has only one command port. Sampling rate and offset numbers can be set as required. Sampling rate is given in seconds, i.e. at each interval of this time, the clock send command signal to the connected block for reading of the input value. Offset value is that time after which the clock is activated. Arun Arun Umrao Umrao
  • 11. 1.1. SOURCE OF DATA BLOCKS 11 Figure 1.4: Sampling Clock (SampleCLK) In the following example, a sampling clock is used with frequency of 5 seconds and offset time as 1 second. CScope GenSin f Figure 1.5: In this configuration, a sample clock is used to refresh the single scope for showing the sine wave generated by sine function generator. The output will be like −1 0 1 0 3 6 9 12 15 18 21 24 27 30 y t Figure 1.6: Output of simulation 1.5. 1.1.3 Time Function It is source of time. The data output at its output port is time increasing constantly by integer one. Figure 1.7: Time Function Block (TIME f) Figure 1.5: In this configuration, a sample clock is used to refresh the Figure 1.5: In this configuration, a sample clock is used to refresh the showing the sine wave generated by sine function generator. showing the sine wave generated by sine function generator. The output will be like The output will be like Umrao Figure 1.5: In this configuration, a sample clock is used to refresh the Figure 1.5: In this configuration, a sample clock is used to refresh the showing the sine wave generated by sine function generator. showing the sine wave generated by sine function generator.
  • 12. 12 Blocks Pallets The time function is given as f(t) = t 0 ≤ t < ∞ Example for the time function is Clock c CScope TIME f Figure 1.8: In this configuration, a clock is used to refresh the single scope for showing the time function. Output of this example is −10 −5 0 5 10 0 3 6 9 12 15 18 21 24 27 30 y t Figure 1.9: Output of simulation 1.8. 1.1.4 Constant Block As named, constant block gives output a constant value. User can set the constant value as required. The constant symbol is 1 Figure 1.10: Constant Block (Const m) Arun Arun Arun Umrao Umrao
  • 13. 1.1. SOURCE OF DATA BLOCKS 13 There are three types of constant block. Constant block (Const), constant block of function type (Const f) and constant block of matrix type (Const m). Constant block also accepts a vector or matrix as its value. For example, 1 5 5 −8 Figure 1.11: Constant Block (Const m) The schematic diagram of use of constant block is given below. Clock c CScope 3 Const m Figure 1.12: In this configuration, a clock is used to refresh the single scope for showing the constant value ‘3’. This simulation has output like −10 −8 −6 −4 −2 0 3 6 9 12 15 18 21 24 27 30 y t Figure 1.13: Output of simulation 1.12. 1.1.5 Curve Block Curve block plots user data into graphics window. It has one output port. User can modify xy-data from the setting option of the block. A graphical user interface is provided to edit Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Const Const m m Figure 1.12: In this configuration, a clock is used to refresh the single Figure 1.12: In this configuration, a clock is used to refresh the single Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao CScope CScope Figure 1.12: In this configuration, a clock is used to refresh the single Figure 1.12: In this configuration, a clock is used to refresh the single scope for showing
  • 14. 14 Blocks Pallets the xy-data. After completing the data it is required to save it to overwrite the previous data. Curve Figure 1.14: Curve Function Generator (CURV f) Clock c CScope Curve f This simulation has output like −10 −5 0 5 10 0 3 6 9 12 15 18 21 24 27 30 y t Figure 1.15: Output of simulation 1.1.5. 1.1.6 Counter Block Counter block counts from lower limit, normally 0, to upper limit (n) either in increasing order or in decreasing order as per user’s definition. Counter’s count (c) is controlled by clock, at each clock triger count value is changed by one. Normally control pulses are supplied by a clock. If clock frequency is low, counting is slow and if frequency of clock is high then counting is fast. User can set the properties of counter block. The counter symbol is Arun This simulation has output like This simulation has output like Arun Umrao
  • 15. 1.1. SOURCE OF DATA BLOCKS 15 Counter 0 → n Figure 1.16: Counter block (Counter) Counter block simulation is given below Clock c CScope Counter 0 → 10 Counter Figure 1.17: In this configuration, a clock is used to refresh the single scope for showing the counter value from zero to fifteen. The counter value is reset to lower limit when count value is equal to the upper limit. Mathematically, c = ( c when c n 0 when c = n Or c = c % n This simulation has output like −10 −5 0 5 10 0 3 6 9 12 15 18 21 24 27 30 y t Figure 1.18: Output of simulation 1.17. Arun the counter value from zero to fifteen. the counter value from zero to fifteen. The counter value is reset to lower limit when count value is equal to the upper limit. The counter value is reset to lower limit when count value is equal to the upper limit. Mathematically, Mathematically, Umrao The counter value is reset to lower limit when count value is equal to the upper limit. The counter value is reset to lower limit when count value is equal to the upper limit.
  • 16. 16 Blocks Pallets 1.1.7 Sine Wave Generator This block generates a sine wave of desired amplitude, frequency and initial time. Sine wave generated by this block has numerical relation as y = a sin ωt Amplitude, frequency and phase values can be set at the setting dialog of the block. The sine wave generator block is shown in below figure. Figure 1.19: Sine wave generator (GenSin f) Sine wave generator example is Clock c CScope GenSin f Figure 1.20: In this configuration, a clock is used to refresh the single scope for showing the sine wave. −1 0 1 0 1 2 3 4 5 6 7 8 Figure 1.21: Simulated output of simulation block (1.20). Arun Arun Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao
  • 17. 1.1. SOURCE OF DATA BLOCKS 17 1.1.8 Square Wave Generator Square wave generator produces a sinusoidal wave of square type. It has one control port and one output port. The width of square wave depends on the trigger pulse supplied by the clock through control port. A pulse trigger the lower level of square wave into upper level and vice-versa on next trigger pulse. Low frequency of trigger pulse (here a sinusoidal clock) gives larger width of square wave. Amplitude of square wave determines its height. Figure 1.22: Square Wave Generator (GENSQR f) Clock c CScope GENSQR f Figure 1.23: In this configuration, a clock is used to refresh the single scope for showing the square wave. Simulated output of circuit (1.23) is −1 0 1 0 1 2 3 4 5 6 7 8 1.1.9 Saw-tooth Wave Generator Sawtooth wave generator produces a wave whose shape is like a saw teeth. It has one control port and one output port. The shape is determined by the period of control pulse. Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Arun Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao
  • 18. 18 Blocks Pallets It has slope of 450 and height and width of saw tooth depends on the period value of control pulse. The sawtooth wave generator block symbol is Figure 1.24: Saw-tooth Wave Generator (SAWTOOTH f) Clock c CScope SAWTOOTH f Figure 1.25: In this configuration, a clock is used to refresh the single scope for showing the saw-tooth wave. Simulated output of circuit (1.25) is −1 0 1 0 1 2 3 4 5 6 7 8 1.1.10 Pulse Wave Generator Pulse wave generator produces a square wave having different width in upper lower levels. It has one output port. The width of pulse wave can be defined by user as required. The pulse width is a fraction of period of the wave. Arun Figure 1.25: In this configuration, a clock is used to refresh the single Figure 1.25: In this configuration, a clock is used to refresh the single the saw-tooth wave. the saw-tooth wave. Umrao Figure 1.25: In this configuration, a clock is used to refresh the single Figure 1.25: In this configuration, a clock is used to refresh the single scope for showing scope for showing
  • 19. 1.1. SOURCE OF DATA BLOCKS 19 Figure 1.26: Pulse Wave Generator (PULSE SC) The duration of time for which, the pulse wave remains active is known as “duty time”. Pulse width of the pulse wave is percentage ratio of the period of the wave. Clock c CScope PULSE SC Figure 1.27: In this configuration, a clock is used to refresh the single scope for showing of the pulse wave. Simulated output of circuit (1.27) is −1 0 1 2 0 1 2 3 4 5 6 7 8 1.1.11 Step Function Step function changes step from upper level to lower level or vice-versa. User can assign level change time and the upper lower level values (initial final values). The properties of this block are visible when it is double clicked. It has one output port. Figure 1.28: Step Function Generator (STEP FUNCTION) Arun Figure 1.27: In this configuration, a clock is used to refresh the single Figure 1.27: In this configuration, a clock is used to refresh the single of the pulse wave. of the pulse wave. Simulated output of circuit (1.27) is Simulated output of circuit (1.27) is Umrao Figure 1.27: In this configuration, a clock is used to refresh the single Figure 1.27: In this configuration, a clock is used to refresh the single scope for showing
  • 20. 20 Blocks Pallets STEP FUNCTION is used to rise the level of value at and after any instant of time. Mathematically, step function is defined as givne below: f(t) = ( 0 when t a 1 when t ≥ a A simplest form of simulation circuit is shown in figure below. Clock c CScope STEP FUNCTION Figure 1.29: In this configuration, a clock is used to refresh the single scope for showing of the steps. Simulated output of circuit (1.29) is −1 0 1 2 0 1 2 3 4 5 6 7 8 1.1.12 Modulo Counter Counter modulo block counts the values, c, from zero to upper limit and when it encoun- ters to upper limit, it reset to zero. It has one control and one output ports. Counter Modulo n Figure 1.30: Counter Modulo block (Counter) Mathematically, modulo value c of given input i for upper limit n is represented as c = i mod n = i % n (1.1) Arun Simulated output of circuit (1.29) is Simulated output of circuit (1.29) is Umrao
  • 21. 1.1. SOURCE OF DATA BLOCKS 21 Here, % sign is used to represent modulo in numerical programming. Modulo counter block simulation is given below Clock c CScope Counter Modulo 10 Modulo Counter Figure 1.31: In this configuration, a clock is used to refresh the single scope for showing the counter modulo 10. 1.1.13 Ramp Ramp block provide output values according to the relation y = mt + c Where y is value provided by ramp at any instant of time t. m, t c are ramp parameters. m is slope of ramp that determines how fast the output values varies. t is time function that increases continuously from its initial value. c is initial value of ramp output. Ramp has only one output port. Derivating to ramp relation m = dy dt The right side of above relation represent to velocity parameter, therefore, ramp function also represents to velocity function. The symbol of ramp function is Figure 1.32: Ramp block (Ramp) 1.1.14 Random Generator Random generator block generates random values within the two given ranges. The random value generated by this block is received when clock triggers the block. It has one control port and one output port. Mathematically r = R(t) where, r is sampled random value and R(t) is random value generated by the random block at time t. The random value r has range a ≤ r ≤ b, i.e. within domain of [a, b]. Arun is value provided by ramp at any instant of time is value provided by ramp at any instant of time is slope of ramp that determines how fast the output values varies. is slope of ramp that determines how fast the output values varies. Umrao mt + + c is value provided by ramp at any instant of time is value provided by ramp at any instant of time t. . m, , t t c c are ramp parameters. are ramp parameters. is slope of ramp that determines how fast the output values varies. is slope of ramp that determines how fast the output values varies. t t
  • 22. 22 Blocks Pallets −2 −1 0 1 2 0 1 2 3 4 5 r t The block symbol is given below: Random Generator Figure 1.33: Random Generator block (Rand m) Each random block uses random number algorithm. User can defined own random block generator by using “Function Block”.. Clock c CScope Random Generator 1.1.15 Read From Input File This block is used to read data from input file stored in temporary directory or in “my document” folder. It has one control port and one output control port. Read data from input file Figure 1.34: Read from input file (RFILE f). This block uses configure options. 1. Time record selection : It is either an empty matrix or an strictly positive integer 0. If it is empty, there is no output event exists. If an integer value, ‘i’, is given, Arun block generator by using “Function Block”.. block generator by using “Function Block”.. Umrao block generator by using “Function Block”.. block generator by using “Function Block”.. Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Clock Clock c
  • 23. 1.1. SOURCE OF DATA BLOCKS 23 then ith element of the read record is assumed to be the date of the output event, i.e. this record is treated as value of t-axis (time variable). 2. Outputs record selection : It is a vector of positive integers like [1, 2, 5]. If read data is like a vector [k1, k2, . . . kn] then kth i elements of the read records, i.e. the vector made of elements [k1, k2, k5] is given in output. 3. Input file name is a file name or path file name. Its value is string of characters. 4. Buffer size : It is similar to the number of bytes read by fread function of C language. To improve efficiency of input read, file is only done after each Buffer size call to the block. For example, consider a data file myfle.txt with following data except label row Arun Umrao
  • 24. 24 Blocks Pallets C1 C2 C3 01 0.100 -0.100 02 0.199 -0.199 03 0.296 -0.296 04 0.389 -0.389 05 0.479 -0.479 06 0.565 -0.565 07 0.644 -0.644 08 0.717 -0.717 09 0.783 -0.783 10 0.841 -0.841 11 0.891 -0.891 12 0.932 -0.932 13 0.964 -0.964 14 0.985 -0.985 15 0.997 -0.997 16 1.000 -1.000 17 0.992 -0.992 18 0.974 -0.974 19 0.946 -0.946 20 0.909 -0.909 21 0.863 -0.863 22 0.808 -0.808 23 0.746 -0.746 24 0.675 -0.675 25 0.598 -0.598 26 0.516 -0.516 27 0.427 -0.427 28 0.335 -0.335 29 0.239 -0.239 30 0.141 -0.141 31 0.042 -0.042 32 -0.058 0.058 Each row has data record for different entity. Hence the unique data vector for each row is [k1, k2, k3]. If time record selection is 1, then first column will be used at t values, i.e. time event values. If this option has value 2, then second column is used at time even values. Note that, time value is always 0 and continuous increasing, hence block stops reading of data when either time becomes negative or time starts decreasing. So, time Arun 16 1.000 -1.000 17 1 18 0.974 -0.974 8 0.974 -0.974 Umrao 6 1.000 -1.000 6 1.000 -1.000 0. -0.992 8 0.974 -0.974 8 0.974 -0.974
  • 25. 1.1. SOURCE OF DATA BLOCKS 25 column should be positive, greater than zero and continuous increasing. There are three output records. If output record selection has value 1 then only data of first column is sent as output of this block. If the output record selection has value [123] then values in first, second and third columns will be sent as output of this block. Clock c CScope Read data from input file RFILE f The time record selection is 1 and output record selection is [2, 3]. The output will be as −1 0 1 0 3 6 9 12 15 18 21 24 27 30 y t If the time record selection is 2 and output record selection is [2, 3], then time for data read shall be from t = 0 to t = 1 seconds. After than time starts decreasing hence reading block will stop reading of data from input data file. And the output will be as −1 0 1 0 3 6 9 12 15 18 21 24 27 30 y t If the time record selection is 3 and output record selection is [2, 3], then time for data read shall be from t = 0 to t = 0 seconds as time value is negative. There will be no output. Similarly, if time record selection option value is empty, then there is null time, hence no output. Arun Arun Arun Umrao Umrao Umrao
  • 26. 26 Blocks Pallets −1 0 1 0 3 6 9 12 15 18 21 24 27 30 y t The ForTran data edit descriptors are LOGICAL, CHARACTER, INTEGER, REAL, DOUBLE PRECISION and COMPLEX which are represented by L, A, I, D, E, F or G descriptors respectively. ForTran descriptor is written as Iw.m where ‘I’ is data type, here it is integer, ‘w’ is total field width and it must be greater than zero, ‘m’ is minimum number of digits produced on output and it may be zero, ‘d’ is number of digits to the right of the decimal point and it may be zero, and ‘e’ number of digits in the exponent part and it must be greater than zero. ‘BN’ is blank space controller. While using this format control descriptor, all embedded and trailing blanks are treated as null and ignored. Similarly, in ‘BZ’ black control descriptor, all embedded and trailing blanks are treated as zeros. Blank space format control descriptor applies only to input and is ignored on output. ‘S’ format control descriptor restore the system default for printing plus ‘+’ signs. This is normally ‘SS’ which suppress the printing of plus ‘+’ signs in front of numerical data for the remainder of the FORMAT description. Format control descriptor ‘SP’ force the printing of plus ‘+’ signs in front of numerical data for the remainder of the FORMAT description. Plus sign format control descriptor are applies only to output and is ignored on input. There are column control descriptors in the ForTrans too. These are ‘nX’ which shifts right n spaces from current position. ‘Tn’ which shifts to column n in the record. ‘TLn’ which shifts left n spaces from current position. Note that you cannot shift left past column 1. This descriptor allows you to reread records on input and overwrite records on output. ‘TRn’ which shifts right n spaces from current position. Note that ‘TRn’ is exactly equivalent to ‘nX’. The slash ‘/’ descriptor begins a new line (record) on output and skips to the next line on input, ignoring any unread information on the current record. Two slashes ‘//’ skips one line, three slashes ‘///’ skips two lines, etc. The format descriptor may be repeated if it is defined as r(Fw.d) or r(Fw.d, Iw.d). Here, ‘r’ is an integer greater than one which specify, how many times the format descriptor inside the parentheses will be repeated. For example, 2(Fw.d) is equal to Fw.d, Fw.d. 1.1.16 Read ‘C’ Binary File This block is used to read ‘C’ binary file stored in temporary directory or in “my doc- ument” folder written by WRITEC f block. It has one control port and one output control port if Time Record Selection option has empty value. Otherwise, it also has one command port. Before reading this section, it is strongly recommended to read section explaining WRITEC f block. Arun data for the remainder of the FORMAT description. Format control descriptor ‘SP’ force data for the remainder of the FORMAT description. Format control descriptor ‘SP’ force the printing of plus ‘+’ signs in front of numerical data for the remainder of the FORMAT the printing of plus ‘+’ signs in front of numerical data for the remainder of the FORMAT description. Plus sign format control descriptor are applies only to output and is ignored description. Plus sign format control descriptor are applies only to output and is ignored on input. There are column control descriptors in the ForTrans too. These are ‘nX’ on input. There are column control descriptors in the ForTrans too. These are ‘nX’ Umrao data for the remainder of the FORMAT description. Format control descriptor ‘SP’ force data for the remainder of the FORMAT description. Format control descriptor ‘SP’ force the printing of plus ‘+’ signs in front of numerical data for the remainder of the FORMAT the printing of plus ‘+’ signs in front of numerical data for the remainder of the FORMAT description. Plus sign format control descriptor are applies only to output and is ignored description. Plus sign format control descriptor are applies only to output and is ignored on input. There are column control descriptors in the ForTrans too. These are ‘nX’ on input. There are column control descriptors in the ForTrans too. These are ‘nX’
  • 27. 1.1. SOURCE OF DATA BLOCKS 27 Read from ‘C’ binary file Figure 1.35: Read from ‘C’ binary file (READC f). This block uses configure options. 1. Time Record Selection : It is either an empty matrix or an strictly positive integer greater than zero (scalar). If it is empty, there is no output event port exists. If an integer value, ‘i’, is given, then ith element of the read record is assumed to be the time event value of the output event port, i.e. this record is treated as value of t-axis (time variable). If this option has value greater than zero, then one command port is created in this block and ith will be used as time axis value and also may be used to control scope viewers. 2. Outputs Record Selection : It is a vector of positive integers like [1, 2, 5]. If read data is like a vector [k1, k2, . . . kn] then kth i elements of the read records, i.e. the vector made of elements [k1, k2, k5] is given in output. 3. Input File Name : It is a file name or path file name. Its value is string of characters. 4. Input Format : A character string defining the data format to use. Strings “l”, “i”, “s”, “ul”, “ui”, “us”, “d”, “f”, “c”, “uc” are used respectively to write int32, int16, int8, uint32, uint16, uint8, double, float, char or unsigned char data type. This value must be same as the value of Output Format option of WRITEC f block. 5. Record Size : This specify the number of columns to be read from C binary file. This should be same as the input size option of WRITEC f block. If this value is 2 and data being read from C binary file is integer type, then 8 bytes data shall be read for one record. It is vector of size one. 6. Buffer Size : It is similar to the number of bytes read by fread function of C language. 7. Initial Record Index : This fixes the first record of the file to use. For example, if record of each entity is arranged in one line and this option is set four, then file will be read from the fourth line in place of first line. 8. Swap Mode : If Swap mode=1 then file is supposed to be coded in “little endian IEEE format” and data are swapped if necessary to match the IEEE format of the processor. If Swap mode=0 then automatic bytes swap is disabled. A simple block arrangement is shown below: Arun 4. Input Format : A character string defining the data format to use. Strings “l”, “i”, 4. Input Format : A character string defining the data format to use. Strings “l”, “i”, “s”, “ul”, “ui”, “us”, “d”, “f”, “c”, “uc” are used respectively to write int32, int16, “s”, “ul”, “ui”, “us”, “d”, “f”, “c”, “uc” are used respectively to write int32, int16, int8, uint32, uint16, uint8, double, float, char or unsigned char data type. This int8, uint32, uint16, uint8, double, float, char or unsigned char data type. This Umrao 4. Input Format : A character string defining the data format to use. Strings “l”, “i”, 4. Input Format : A character string defining the data format to use. Strings “l”, “i”, “s”, “ul”, “ui”, “us”, “d”, “f”, “c”, “uc” are used respectively to write int32, int16, “s”, “ul”, “ui”, “us”, “d”, “f”, “c”, “uc” are used respectively to write int32, int16, int8, uint32, uint16, uint8, double, float, char or unsigned char data type. This int8, uint32, uint16, uint8, double, float, char or unsigned char data type. This
  • 28. 28 Blocks Pallets Clock c CScope Read From c binary file READC f −1 0 1 0 3 6 9 12 15 18 21 24 27 30 y t If first column of read record is time value then Time Record Selection option shall have value 1. The block arrangement will be changed as CScope Read From c binary file READC f −1 0 1 0 3 6 9 12 15 18 21 24 27 30 y t 1.1.17 Read Sound File This block is used to read data sound file stored in temporary directory or in “my docu- ment” folder. It has one control port and one output control port. Arun have value 1. The block arrangement will be changed as have value 1. The block arrangement will be changed as Arun Arun Umrao have value 1. The block arrangement will be changed as have value 1. The block arrangement will be changed as Umrao Umrao
  • 29. 1.1. SOURCE OF DATA BLOCKS 29 Read from .au sound file Figure 1.36: Read from sound file (READAU f). 1.1.18 Signal Builder Signal builder is used to draw a signals in any form as required. Signal builder uses x-y data for generating a signal. It has one output port and one command port. Signal Builder Figure 1.37: Signal Builder block (Sigbuilder) 1.1.19 TK Scale It is Tk powered slider scale window. Input value is adjusted by sliding the pointer of slider scale. This block has three parameters, (i) minimum value, (ii) maximum value and (iii) normalization. Normalization (h) controls the number of steps between minimum and maximum values. For example, if normalization is h, then total number of sliding steps shall be n = xmax − xmin h and vice-versa. Smaller the normalization value, larger the number of steps of Tk sliding scale and finer the input value. Hence there shall be larger steps and smaller normalization value for high precision input. Normalization is some times also known as step difference value of Tk sliding scale. This scale is used for tuning the signals. This block has one control port and one output port. TK Scale Figure 1.38: Signal Builder block (TKSCALE) Signals are stimulated by clock pulse. On stimulation, Tk slider scale supplies the value pointed by the pointer of the scale. Its minimum block requirement is shown below: Arun It is Tk powered slider scale window. Input value is adjusted by sliding the pointer of It is Tk powered slider scale window. Input value is adjusted by sliding the pointer of slider scale. This block has three parameters, (i) minimum value, (ii) maximum value slider scale. This block has three parameters, (i) minimum value, (ii) maximum value and (iii) normalization. Normalization ( and (iii) normalization. Normalization ( and maximum values. For example, if normalization is and maximum values. For example, if normalization is Umrao It is Tk powered slider scale window. Input value is adjusted by sliding the pointer of It is Tk powered slider scale window. Input value is adjusted by sliding the pointer of slider scale. This block has three parameters, (i) minimum value, (ii) maximum value slider scale. This block has three parameters, (i) minimum value, (ii) maximum value ) controls the number of steps between minimum ) controls the number of steps between minimum and maximum values. For example, if normalization is and maximum values. For example, if normalization is h h, then total number of sliding , then total number of sliding
  • 30. 30 Blocks Pallets Clock c CScope TK Scale This simulation has output like −10 −5 0 5 10 0 3 6 9 12 15 18 21 24 27 30 y t Figure 1.39: Output of simulation 1.1.19. 1.2 Sink of Data Blocks Sinks is that point where all data is ended in form of graphs, numerical values or event. Following sinks are used in Xcos. 1.2.1 Display Floating Number This block is used to show the output in numeric form rather than graphical representa- tion. It has one input port and one command port. 1.2.2 Bar XY This block uses relation y = f(x) to plot the data. Here x is independent value while y is a function of x. This block shows results in bar lines. Arun Arun Arun Arun Arun Arun 0 3 6 9 12 15 18 21 24 27 30 0 3 6 9 12 15 18 21 24 27 30 Arun Umrao Umrao Umrao Umrao Umrao Umrao 0 3 6 9 12 15 18 21 24 27 30 0 3 6 9 12 15 18 21 24 27 30
  • 31. 1.2. SINK OF DATA BLOCKS 31 1.2.3 Floating Point Scope Floating point scope, shows output of floating points ranges between zero to one. It has one control port. The output viewed in this scope is y = (float)x Figure 1.40: Floating Point Scope (CFSCOPE) Following parameters of the block can be set as and when required. Color Set the number for color of output graph. Output Window Number Output windows are assigned an identification numbers for processing of data. By default it is ‘-1’. It means the window number will automatically assigned an ID. Apart from it, user defined ID can also be assigned to the window. Output Window Position Position of window tell the window that where it will posi- tioned after opening. By default it is positioned in center of screen. The xy-coordinates of window position are assigned like [x; y]. The coordinates are calculated from the top left corner of the screen of computer system. Output Window Sizes It determines the size of output window. The coordinates are syntax as [x; y]. Ymin It is the minimum value of the output to be displayed in the output window. Ymin is used to set the lower scale point of the y-axis in output display. YMax It is the maximum value of the output to be displayed in the output window. Ymax is used to set the upper scale point of the y-axis in output display. Refresh Period It is the maximum range of independent variable to be displayed in the output window. Buffer Size The size of output values to be stored in the memory. The drawing is only done after each Buffer size call to the block. 1.2.4 XY Animated Viewer XY animated viewer visualized the second input with respect first input as a function of first input at instant simulated time. Mathematically y = f(x) The output plot is two dimensional. It has two input ports and one control port. One of the two input ports is for variable and second is for function of variable. Arun Output Window Position Output Window Position Position of window tell the window that where it will posi- Position of window tell the window that where it will posi- ioned after opening. By default it is positioned in center of screen. The xy-coordinates ioned after opening. By default it is positioned in center of screen. The xy-coordinates of window position are assigned like [ of window position are assigned like [ Umrao Position of window tell the window that where it will posi- Position of window tell the window that where it will posi- ioned after opening. By default it is positioned in center of screen. The xy-coordinates ioned after opening. By default it is positioned in center of screen. The xy-coordinates y]. The coordinates are calculated from the top ]. The coordinates are calculated from the top
  • 32. 32 Blocks Pallets Figure 1.41: XY Animation Viewer block (CANIMXY) The simplest form of block arrangement is given in the following figure. Clock c CANIMXY TIME f SIN SINBLK f A moving dot is used to show the instantaneous x and y value. It is animated like the figure given below: −1 −0.5 0 0.5 1.0 0 1 2 3 4 5 6 7 1.2.5 XY 3D Animated Viewer XY 3D animated viewer block draw a graph of function like f(z) = f(x, y) Where x, y are two independent values. The α and φ values can be defined as required by user to change the viewing point. This block has one control port and three input ports. Figure 1.42: XY 3D Animated Viewer block (CANIMXY3D) The simplest form of block arrangement is given in the following figure. Arun A moving dot is used to show the instantaneous A moving dot is used to show the instantaneous figure given below: figure given below: Umrao A moving dot is used to show the instantaneous A moving dot is used to show the instantaneous x and y value. It is animated like the
  • 33. 1.2. SINK OF DATA BLOCKS 33 Clock c CANIMXY3D TIME f SIN SINBLK f A moving dot is used to show the instantaneous x, y and z values. It is animated like the figure given below: x y z 1.2.6 3D Matrix Viewer 3D Matrix Viewer is a scope that shows matrix values as z values on a xy grid. It has one input port and one control port. The input to this block is always a matrix. Mat 3D Figure 1.43: 3D Matrix Viewer block (CMAT3D) The drawing of block arrangement is shown in the following figure. Clock c Mat 3D Mat. 3D   1 2 1 2 1 1 2 3 1   Arun Arun Arun Arun y y Arun Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao
  • 34. 34 Blocks Pallets Simulate this block arrangement to see the result. The output is computed as following methods. In CMAT3D matrix viewer, a ruled mess grid is created. Each point where x and y lines intersects to each other is called a node. At these nodes matrix elements are placed and element value is the height of the point in z-axis. The nodes parallel to the x-axis are column elements of the supplied matrix and nodes parallel to the y-axis are row elements of the supplied matrix. For a given matrix of 3 × 3, A =   1 2 1 2 1 1 2 3 1   The mess is looked like x y z The index of row or column numbers in CMAT3D viewer is started from zero. So, the elements of the matrix will be placed as shown in the following figure. Note that, column elements are placed parallel to the x-axis. Now, x y z A00 A10 A20 A01 A11 A21 A02 A12 A22 1 2 1 2 1 1 2 3 1 Now connect the zij from its neighbouring z. Four neighbouring z nodes form a facet of the 3D surface. The mesh thus form is three dimensional plot of the given function. Arun elements of the matrix will be placed as shown in the following figure. Note that, column elements of the matrix will be placed as shown in the following figure. Note that, column elements are placed parallel to the elements are placed parallel to the x x-axis. Now, -axis. Now, Umrao elements of the matrix will be placed as shown in the following figure. Note that, column elements of the matrix will be placed as shown in the following figure. Note that, column -axis. Now, -axis. Now,
  • 35. 1.2. SINK OF DATA BLOCKS 35 x y z A00 A10 A20 A01 A11 A21 A02 A12 A22 1 2 1 2 1 1 2 3 1 Now, fill each quadrilateral surface with different color or using colormaps. This is output of the CMAT3D viewer block. x y z A00 A10 A20 A01 A11 A21 A02 A12 A22 1 2 1 2 1 1 2 3 1 1.2.7 Matrix Viewer Matrix Viewer is a scope that shows matrix values on colormap grid. It has one input port and one control port. The input to this block is always a matrix. The colormap grid is a range color linked to the window output of the scope. There are three types of color maps, (i) jetcolormap, (ii) hotcolormap and (iii) graycolormap. These colormaps accepts a level (n) of color map and it constructs color levels of size n × 3 where n ≥ 3. For example, 1 -- graycolormap (10) divides white to perfect gray color into ten different gray color shades as shown in the following output. ans = 0. 0. 0. 0.1111111 0.1111111 0.1111111 0.2222222 0.2222222 0.2222222 0.3333333 0.3333333 0.3333333 0.4444444 0.4444444 0.4444444 0.5555556 0.5555556 0.5555556 0.6666667 0.6666667 0.6666667 Arun Arun Arun Arun 1 Arun Umrao Umrao A00 A00 Umrao A10 A10 Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao
  • 36. 36 Blocks Pallets 0.7777778 0.7777778 0.7777778 0.8888889 0.8888889 0.8888889 1. 1. 1. Each shade contains equal components of red, green and blue colors. Hence rgb(0.1 0.1 0.1) is equal to the gray(0.1). All rgb components are zero means perfect black and all component of rgb are one means perfect white. The difference between two gray shades is computed as d = 1 − 0 n − 1 and levels are l = 0 + i × d The minimum level range is the minimum value who comes in the regular input port. It would be linked to the ‘cold value’ of the colormap. The maximum level range is the maximum value who comes in the regular input port. It would be linked to the ‘hot value’ of the colormap. Minimum and maximum values are scalars. Mat View Figure 1.44: Matrix Viewer block (CMATVIEW) The drawing of block arrangement is shown in the following figure. Clock c Mat View     0. 1. 2. 2. 3. 4. 4. 5. 6. 6. 7. 8.     Computation method of this block is explained as given below. Assume that the input matrix has elements from minimum value 0 to maximum value 8. There are eight levels of gray colourmap. So the list of actual gray colourmap codes, those will be used to fill the plot are 1 -- graycolourmap (8) ans = 0. 0.1428571 0.2857143 Arun F Figure 1.44: Matrix Viewer block (CMATVIEW) igure 1.44: Matrix Viewer block (CMATVIEW) Umrao igure 1.44: Matrix Viewer block (CMATVIEW) igure 1.44: Matrix Viewer block (CMATVIEW)
  • 37. 1.2. SINK OF DATA BLOCKS 37 0.4285714 0.5714286 0.7142857 0.8571429 1. Let the matrix elements are arranged in the xy-plane taking x-axis as rows and y-axis as columns. The experimental matrix is 1 -- M=[0 1 2; 2 3 4; 4 5 6;6 7 8] M= 0. 1. 2. 2. 3. 4. 4. 5. 6. 6. 7. 8. Now, the minimum matrix value (say 0) is set to gray color level 0 and maximum matrix value (say 8) is set to gray color level 1. The intermediate distinct matrix elements are assigned proposed gray color code from equally distributed gray colormap values ranging from 0 to 1 as shown in the below table. Matrix Element Proposed Gray Code 0 0.000 1 0.125 2 0.250 3 0.375 4 0.500 5 0.625 6 0.750 7 0.875 8 1.000 As there are 8 colormap levels and 9 distinct matrix elements, hence the proposed gray color codes are rounded to near gray colormap values of actual gray colormap. Thus the actual table will be Arun Matrix Elemen Umrao Proposed Gray Code 0.000
  • 38. 38 Blocks Pallets Elements Proposed Gray Code Actual Gray Code 0 0.000 0.000 1 0.125 0.143 2 0.250 0.286 3 0.375 0.429 4 0.500 0.571 5 0.625 0.714 6 0.750 0.857 7 0.875 1.000 8 1.000 1.000 The matrix nodes are as cols rows (0,0.000) (1,0.143) (2,0.286) (2,0.286) (3,0.429) (4,0.571) (4,0.571) (5,0.714) (6,0.857) (6,0.857) (7,1.000) (8,1.000) These matrix arrangement creates grid blocks/cells as shown below: cols rows (0,0.000) (1,0.143) (2,0.286) (2,0.286) (3,0.429) (4,0.571) (4,0.571) (5,0.714) (6,0.857) (6,0.857) (7,1.000) (8,1.000) Arun Arun (1,0.143) (3,0.429) (3,0.429) Umrao (5,0.714) (5,0.714) (7,1.000) (7,1.000)
  • 39. 1.2. SINK OF DATA BLOCKS 39 Now, for each cell, its corner values are used for calculation of average gray scale for that cell. So, the first cell has gray value as g = 0.000 + 0.286 + 0.143 + 0.429 4 = 0.2145 cols rows (0,0.000) (1,0.143) (2,0.286) (2,0.286) (3,0.429) (4,0.571) (4,0.571) (5,0.714) (6,0.857) (6,0.857) (7,1.000) (8,1.000) 0.215 The shading of this cell be like cols rows (0,0.000) (1,0.143) (2,0.286) (2,0.286) (3,0.429) (4,0.571) (4,0.571) (5,0.714) (6,0.857) (6,0.857) (7,1.000) (8,1.000) 0.215 Now, we can calculate average gray scales/levels for other cells and their background can be filled by appropriate gray colors as shown in the following figure. Arun (0,0.000) 0,0.000) (2,0.286) The shading of this cell be like The shading of this cell be like Umrao (4,0.571) (4,0.571) (6,0.857)
  • 40. 40 Blocks Pallets cols rows (0,0.000) (1,0.143) (2,0.286) (2,0.286) (3,0.429) (4,0.571) (4,0.571) (5,0.714) (6,0.857) (6,0.857) (7,1.000) (8,1.000) 0.215 0.500 0.785 0.357 0.642 0.892 1.2.8 Single Display Scope Single display scope displays its input with respect to simulation time. User can change the refresh time, maximum and minimum value of axes. It has one control port and one input port. Figure 1.45: Single Display Scope (CSCOPE) This scope can be customized from the setting dialogue which can be opened by double clicking one it. The default input size of this scope is 8, i.e. data vector size shall be less than or equal to ‘8’. The color is a vector of integers. The ith element is the color number or marker type used to draw the evolution of the ith input port signal. Colors are defined by positive integers i.e. color index relative to the current colormap and markers are defined by negative integers. The marker type are identified by an integer in range of 0 to -14 which stands respectively for: dot, plus, cross, star, filled diamond, diamond, triangle up, triangle down, diamond plus, circle, asterisk, square, triangle right, triangle left and pentagram. Note that, this scope automatically detects the number of data groups coming inside and plots different/multiple plots in same graphics window. In the following figure, a sine wave is plotted at single scope window. Arun Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao
  • 41. 1.2. SINK OF DATA BLOCKS 41 Clock c CScope GenSin f The output will be like −2 −1 0 1 2 0 3 6 9 12 15 18 21 24 27 30 y t For grouping of multiple data, Multiplexure is used. In the following figure, two sine wave data is multiplexed before passing it to input port of single scope viewer. Here both data are plotted in same graph window as shown in the output. Clock c CScope GenSin f GenSin f The output will be like Arun Arun Arun Arun Arun Arun 3 6 9 12 15 18 21 24 27 30 3 6 9 12 15 18 21 24 27 30 Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao 3 6 9 12 15 18 21 24 27 30 3 6 9 12 15 18 21 24 27 30
  • 42. 42 Blocks Pallets −2 −1 0 1 2 0 3 6 9 12 15 18 21 24 27 30 y t 1.2.9 Multiple Display Scope Multiple display scope displays its different input values simultaneously with respect to simulation time . User can change the refresh time, number of input port its size and type, maximum and minimum value of axes for each input ports and buffer size etc. The size of input port of the multiple display scope should be equal to the size of data received from the output port of other block. It accepts continuous data or row matrix or column matrix or vector data types. For continuous data type, input port size is 1, and for row or column matrix or vector data, the input port size is size of row or column matrix or vector. The size of input port is set accordingly. Matrix data of m × n type can not be directly fed to this display scope. It has one control port and user defined multiple input port. This scope draws subplots in different subgraphics windows for each input port data. Figure 1.46: Multiple Display Scope (CMSCOPE) For the input ports of this block, user must be familiar with size of the ports and type of the ports. For example, in the field ‘input port sizes’ in setting dialogue, if data is placed as ‘1 1’ then it represents to two input ports as ‘1’ is written two times separated with space. Similarly, ‘1 1 1’ represents to three input ports. ‘1 2 1’ is also represents to three input ports but these ports are of different type. ‘1’ represents that a port can receives or transmits only one column vector (1 × 1 vector), which is also known as continuous scalar data. While ‘2’ represents that a port can receives or transmits only two column vector (1 × 2 vector). It is also known as row matrix data. Similarly ‘7’ represents a vector having seven columns (1 × 7 vector) and so on. Remember that a Scope needs the drawing color equal to the sum of size of all ports. If there are two ports of size 3 and 7 respectively, then there is required to define 3+7 = 10 colours in ‘Drawing colors or marks’ field. There are also required to set the separate values of Ymin, Ymax and refresh rate for each input port. Arun matrix or vector data types. For continuous data type, input port size is 1, and for row matrix or vector data types. For continuous data type, input port size is 1, and for row or column matrix or vector data, the input port size is size of row or column matrix or or column matrix or vector data, the input port size is size of row or column matrix or vector. The size of input port is set accordingly. Matrix data of vector. The size of input port is set accordingly. Matrix data of directly fed to this display scope. It has one control port and user defined multiple input directly fed to this display scope. It has one control port and user defined multiple input Umrao matrix or vector data types. For continuous data type, input port size is 1, and for row matrix or vector data types. For continuous data type, input port size is 1, and for row or column matrix or vector data, the input port size is size of row or column matrix or or column matrix or vector data, the input port size is size of row or column matrix or vector. The size of input port is set accordingly. Matrix data of vector. The size of input port is set accordingly. Matrix data of m m × n n directly fed to this display scope. It has one control port and user defined multiple input directly fed to this display scope. It has one control port and user defined multiple input
  • 43. 1.2. SINK OF DATA BLOCKS 43 Clock c CScope GenSin f GenSin f The output will be like −2 −1 0 0 3 6 9 12 15 18 21 24 27 30 −2 −1 0 0 3 6 9 12 15 18 21 24 27 30 1.2.10 XY Single Display Scope This block visualize the two inputs signals by drawing the second input as a function of the first input at any instant of time. When a point is drawn on screen it stays until the simulation is finished. It has two input ports and one control ports. One of the two input ports is for variable and second is for function of variable. y = f(x) Figure 1.47: XY Single Display Scope (CSCOPXY) The simplest form of block arrangement is given in the following figure. Arun Arun Umrao Umrao
  • 44. 44 Blocks Pallets Clock c CSCOPXY TIME f SIN SINBLK f A moving dot with trailing curve is used to show the animated path. It is animated like the figure given below: −1 −0.5 0 0.5 1.0 0 1 2 3 4 5 6 7 1.2.11 XY 3D Single Display Scope This block visualize the two inputs signals by drawing the second input as a function of the first input at any instant of time. When a point is drawn on screen it stays until the simulation is finished. It has two input ports and one control ports. Two of the three input ports are for variables and third is for function of variables. The mathematics behind the visualization is f(z) = f(x, y) Figure 1.48: XY 3D Single Display Scope (CSCOPXY3D) The simplest form of block arrangement is given in the following figure. Arun 0 1 2 1.2.11 XY 3D Single Display Scope 1.2.11 XY 3D Single Display Scope Umrao 3 3 4 5 6 7 1.2.11 XY 3D Single Display Scope 1.2.11 XY 3D Single Display Scope
  • 45. 1.2. SINK OF DATA BLOCKS 45 Clock c CSCOPXY3D TIME f SIN SINBLK f A moving dot with trailing curve is used to show the animated path. It is animated like the figure given below: x y z 1.2.12 Terminating Blocks A terminating block ends the simulation when simulation time is encounter to the time specified in terminating blocks. There are three types of terminating blocks. First is ‘End Block’: it ends the simulation after the time specified in the end block. It has no ports. END Figure 1.49: End Block (ENDBLK) Second type of terminating block is ending counter. It received current time from control port and matches with defined final time in itself. If both are equal, it instructs final simulation time otherwise passes current time from command port. This block has one control port and one command port. END Figure 1.50: End Block (END c) Arun Arun Arun Arun y y Arun Arun Umrao Umrao Umrao Umrao
  • 46. 46 Blocks Pallets Third is halt block. HALT Figure 1.51: Halt Block (HALT f) Some times, there is situation when one or more ports are need to keep open but simulation can not be processed if one or more ports are hanging. So to keep these ports close we use trash block. It just make port close and all the data received at this port is considered as junk. This block works as terminating blocks and do nothing. Trash Figure 1.52: Trash Function block (TRASH f) 1.2.13 Writing to Audio File This block writes the sound data in *.au file format. It has one control port and one input port. Generally file is saved in the same directory where *.xcos file is saved but user can change the name and path of the writing file. Before using this block, user must have writing permissions. Write to audio Figure 1.53: Write AU to devaudio (WRITEAU f) 1.2.14 Writing to ‘C’ Binary File This block writes the data in binary ‘C’ file. It has one control port and one input port. Generally file is saved in the same directory where *.xcos file is saved but user can change the name and path of the writing file. Before using this block, user must have writing permissions. Write to C Figure 1.54: Write To Binary ‘C’ (WRITEC f) Arun .2.13 Writing to Audio File .2.13 Writing to Audio File This block writes the sound data in *.au file format. It has one control port and one This block writes the sound data in *.au file format. It has one control port and one input port. Generally file is saved in the same directory where *.xcos file is saved but input port. Generally file is saved in the same directory where *.xcos file is saved but Umrao This block writes the sound data in *.au file format. It has one control port and one This block writes the sound data in *.au file format. It has one control port and one input port. Generally file is saved in the same directory where *.xcos file is saved but input port. Generally file is saved in the same directory where *.xcos file is saved but
  • 47. 1.2. SINK OF DATA BLOCKS 47 1. Input Size : It is size of input column vector. A scalar that determines the how many columns of data values are used to form a record. This description must be read with the data output format description. Suppose, we have define integer datatype data format and input size is 2 then total 8 bytes shall be used to write a record of data in binary form. The data received at input port of WRITEC f block must be of same size as defined in the Input Size option. 2. Output File Name : It is a file name or path file name where data would be written. Its value is string of characters. 3. Output Format : A character string defining the data format to use. Strings “l”, “i”, “s”, “ul”, “ui”, “us”, “d”, “f”, “c”, “uc” are used respectively to write int32, int16, int8, uint32, uint16, uint8, double, float, char or unsigned char data type. 4. Buffer Size : It is similar to the number of bytes read by fread function of C language. 5. Swap Mode : If swap mode=1 then file is supposed to be coded in “little endian IEEE format” and data are swapped if necessary to match the IEEE format of the processor. If Swap mode=0 then automatic bytes swap is disabled. Clock c Write to C GenSin f The above block diagram is indicative purpose about the use of WRITEC f. The data written by this block is in format as shown below: rec[4] 20 4 byte[1] byte[2] rec[5] 40 12 byte[1] byte[2] rec[6] 60 20 byte[1] byte[2] rec[7] 80 28 byte[1] byte[2] wr In this figure, we have explained that the character type data with size two is saved in binary format. First byte is for one of the two data elements of a record and second byte is for other of the two data elements of a record. The number of bytes required depends on the type of data and size of data. A character data type requires one byte memory space and if record size is two then two bytes are required to save a record. If data type is integer type and data size is two, then memory arrangement shall be like rec[4] 0 0 20 4 byte[1] byte[2] byte[3] byte[4] rec[5] 0 0 40 12 byte[1] byte[2] byte[3] byte[4] rec[6] 0 0 60 20 byte[1] byte[2] byte[3] byte[4] wr Arun Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao Umrao
  • 48. 48 Blocks Pallets Note that, index origin has been implemented in different programming languages differently. The equivalent decimal number in each memory byte represents the binary value saved in that memory cell. 1.3 Mathematical Blocks In this section, those blocks are discussed which are used in mathematical operations. 1.3.1 Max Min Max min block compares the two input values and returns the minimum or maximum value as the conditions are defined. This block can be used in vector mode only i.e. input should be supplied only vector values. If zero crossing is set true then negative value would also be returned. MAX Figure 1.55: Max-Min block (MAXMIN) This block acts as Min block if min/max input option is set to 1 and acts as Max block if min/max input option is set to 2. It may be set for one input or two inputs. A schematic diagram is shown for working of Max/Min block. Clock c CScope TIME f SIN SINBLK f TIME f COS COSBLK f MAX In this block two inputs, one sine value and other cosine value are entered into the max/min block. The block is set to max state, i.e. the maximum value of the two inputs will be found at its output port. Therefore, the final plot shall be plot of the maximum value between sine and cosine values. The time clock starts from 0 to continue. The number of input ports in max/min block is set to two and zero crossing is allowed. The output of this schematic diagram will be as shown below: Arun This block acts as Min block if min/max input option is set to 1 and acts as Max This block acts as Min block if min/max input option is set to 1 and acts as Max block if min/max input option is set to 2. It may be set for one input or two inputs. A block if min/max input option is set to 2. It may be set for one input or two inputs. A Umrao This block acts as Min block if min/max input option is set to 1 and acts as Max This block acts as Min block if min/max input option is set to 1 and acts as Max block if min/max input option is set to 2. It may be set for one input or two inputs. A block if min/max input option is set to 2. It may be set for one input or two inputs. A
  • 49. 1.3. MATHEMATICAL BLOCKS 49 −1 −0.5 0 0.5 1.0 0 3 6 9 12 15 18 21 24 27 30 −1 −0.5 0 0.5 1.0 0 3 6 9 12 15 18 21 24 27 30 −1 −0.5 0 0.5 1.0 0 3 6 9 12 15 18 21 24 27 30 When the max/min block is set to minimum state, the output of updated configured schematic block diagram will be as shown below: −1 −0.5 0 0.5 1.0 0 3 6 9 12 15 18 21 24 27 30 −1 −0.5 0 0.5 1.0 0 3 6 9 12 15 18 21 24 27 30 −1 −0.5 0 0.5 1.0 0 3 6 9 12 15 18 21 24 27 30 Arun When the max/min block is set to minimum state, the output of updated When the max/min block is set to minimum state, the output of updated schematic block diagram will be as shown below: schematic block diagram will be as shown below: Umrao When the max/min block is set to minimum state, the output of updated When the max/min block is set to minimum state, the output of updated schematic block diagram will be as shown below: schematic block diagram will be as shown below:
  • 50. 50 Blocks Pallets 1.3.2 Max Only Block Max block returns the maximum value of all supplied values. Max block can be used in matrix mode of input data. It has only one input port and one output port. The max block is MAX Figure 1.56: Max block (MAX f) If A =
  • 51.
  • 52.
  • 53.
  • 54.
  • 55.
  • 56. 4 8 6 9 1 12 4 7 3
  • 57.
  • 58.
  • 59.
  • 60.
  • 61.
  • 62. is input to this block then it gives 12 as its output. The value 12 is maximum among all elements of the given matrix. 1.3.3 Min Only Block Min block returns the minimum value of all supplied values. Min block can be used in matrix mode of input data. It has only one input port and one output port. Min block is MIN Figure 1.57: Min block (MIN f) If A =
  • 63.
  • 64.
  • 65.
  • 66.
  • 67.
  • 68. 4 8 6 9 1 12 4 7 3
  • 69.
  • 70.
  • 71.
  • 72.
  • 73.
  • 74. is input to this block then it gives 1 as its output. The value 1 is minimum among all elements of the given matrix. 1.3.4 Square Root Block A function f(x) = √ x is called square root function of x. The type of roots can be set by user. It has only one input port and one output port. SQRT Figure 1.58: Square root block (SQRT) Arun Min block returns the minimum value of all supplied values. Min block can be used in Min block returns the minimum value of all supplied values. Min block can be used in matrix mode of input data. It has only one input port and one output port. Min block is matrix mode of input data. It has only one input port and one output port. Min block is Umrao Min block returns the minimum value of all supplied values. Min block can be used in Min block returns the minimum value of all supplied values. Min block can be used in matrix mode of input data. It has only one input port and one output port. Min block is matrix mode of input data. It has only one input port and one output port. Min block is
  • 75. 1.3. MATHEMATICAL BLOCKS 51 If square root block is set to real only (data type = 1) then it gives output when input is only positive value as √ −n is an imaginary value. There is NULL result if input is a negative number. It can also be set to complex mode by changing its data type to 2 in setting dialogue. 1.3.5 Absolute Value Absolute value is mod value of a real number. If given number is positive or negative its absolute value is always positive in nature. The absolute block returns only positive form of a positive or negative real number. The absolute block is ABS Figure 1.59: Absolute value block (ABS VALUE) Mathematically f(x) = −a when a 0 a when a ≥ 0 A schematic diagram is shown for working of absolute block. Clock c CScope TIME f COS COSBLK f ABS The output of this schematic diagram will be as shown below: Arun A schematic diagram is shown for working of absolute block. A schematic diagram is shown for working of absolute block. Umrao A schematic diagram is shown for working of absolute block. A schematic diagram is shown for working of absolute block.