Professional Documents
Culture Documents
Lab 1 Final Draft
Lab 1 Final Draft
Francisco, Angela
Selera, Ken Archer
BSECE 3-A1
I. Introduction and Basic Theory
According to Nise, Norman S., an esteemed authority in control systems, the transfer
function stands as a potent mathematical tool, offering valuable insights into the intricate
behavior of circuits. It acts as a crucial bridge, connecting the input signals applied to a
circuit with the resulting output signals, unveiling the transformative processes within the
circuit's network of components.
The transfer function proves to be a convenient and powerful representation for linear,
time-invariant systems, effectively capturing their input-output relationship. This
mathematical expression is derived by applying a Laplace transform to the differential
equations that describe the dynamics of the system, assuming zero initial conditions.
Alternatively, when the governing equations are unavailable, engineers can estimate the
transfer function from measured input-output data. Widely employed in block diagram
representations of systems, transfer functions play a pivotal role in time-domain and
frequency-domain analyses, as well as in controller design.
The significant advantage lies in the simplicity transfer functions bring to the analysis
and design of systems. By employing straightforward algebraic equations instead of
intricate differential equations, engineers can navigate and comprehend the complexities of
circuits with greater ease, ultimately facilitating efficient system analysis and design
processes (Nise, Norman S., "Control Systems Engineering,").
Procedure for determining the transfer function of a control system are as follows:
1. We form the equations for the system.
2. Now we take Laplace transform of the system equations, assuming initial
conditions as zero.
3. Specify system output and input.
4. Lastly, we take the ratio of the Laplace transform of the output and the Laplace
transform of the input which is the required transfer function.
In control systems, input and output categories can differ. Electric motors, for instance,
take electrical input and produce mechanical output, while electric generators take mechanical
input and generate electrical output.
But for mathematical analysis, of a system all kinds of signals should be represented in a
similar form. This is done by transforming all kinds of signal to their Laplace form. Also, the
transfer function of a system is represented by Laplace form by dividing output Laplace transfer
function to input Laplace transfer function. Hence a basic block diagram of a control system can
be represented as:
Where r(t) and c(t) are time domain function of input and output signal respectively.
II. Objectives
In this section, the objectives of learning system modeling and Transfer Function
Simulation in SCILAB and XCOS are as follows:
Overall Objective:
To understand and practice system modeling and transfer function simulation
using SCILAB and XCOS software.
Specific Objectives:
Learn the basics of system modeling:
Identify different types of systems (continuous-time, discrete-time, linear, non-
linear).
Apply appropriate mathematical models to represent simple systems (e.g.,
differential equations, transfer functions).
Understand the concept of transfer functions:
Define the transfer function and its relationship to input and output signals.
Analyze the frequency response of a system using its transfer function.
Gain proficiency in using SCILAB and XCOS:
Navigate the SCILAB environment and use basic commands for mathematical
operations and data manipulation.
Utilize the Control System Toolbox in SCILAB for system modeling and analysis.
Create block diagrams in XCOS to represent system models and perform
simulations.
Analyze and interpret simulation results obtained from XCOS
Apply theoretical knowledge to practical examples:
Develop a mathematical model of the chosen system using transfer functions.
Design and implement the model in SCILAB and XCOS.
Analyze the simulated response of the system to various inputs and
disturbances.
Compare the simulation results with theoretical predictions and real-world
expectations.
1. Installation:
Download SCILAB from the official website.
Follow the installation instructions for your operating system.
2. Launch SCILAB:
Open SCILAB after successful installation.
If you are dealing with longer codes, use the SciNotes which is located
here as it is easier to code and this is useful for dealing with more
complex functions.
After inputting your line of codes you can press the run button to
automatically run all the lines in the main window console
4.2 Don’t limit yourself and explore more
Start with the introductory tutorials on the Scilab website
(https://www.scilab.org/scilab-for-beginners-tutorial) to get comfortable
with the basic syntax and commands.
As you progress, you can always check this help browser to explore more
advanced features like control flow, functions, and data structures to
write more complex programs.
In SciNotes
6. Execution:
Execute the script in the command line or SciNotes.
Observe the Bode plot that shows the frequency response of the given
transfer function.
7. Analyzing:
Analyze the Bode plot to understand the frequency response characteristics
of the given transfer function.
After connecting, we can now run the simulation and check its waveform but
before that we need to set up some variables so that we can see the graph
much more clearly.
9. Discussing the Resulting Waveform:
Simulate the XCOS model to obtain the response of the given transfer
function.
By using SCILAB XCOS for simulation, you can gain a more comprehensive
understanding of the system's behavior based on the given transfer function.
Comparing the results with the manual plot provides a holistic view of the system's
response across different tools. Analyzing the implications of the simulation results
helps draw conclusions about the system's performance and aids in further
refinement or optimization if necessary.
The Xcos simulation shows that we are trying to graph the UNIT STEP RESPONSE of the RC
circuit. And so the transfer function in the system is
1
H ( s )=( )
s+ 1
To find the unit step response, you can take the inverse Laplace transform of the transfer
function multiplied by the Laplace transform of the unit step function 1/s . and this will
output Y(s)=G(s)⋅U(s).
Where U(s) is the Laplace transform of the unit step function, which is 1/s .
( )( )
Y ( s )=
1
s+ 1
∗
1
s
Now, you can find the inverse Laplace transform of Y(s) to obtain the unit step response
y(t).
−t
y ( t ) =1−e
The response signifies a quick rise to the final value of 1, with an exponential decay and
underdamped behavior. If you were to plot this response graphically, you would see a
curve that rises rapidly and approaches 1 with decreasing oscillations.
Bode plot Figure #2 XCOS simulation Figure #2
The results of the figure #2 shows that the bode plot graph acts as a high pass filter as the
capacitor behaves like a short circuit, and the magnitude is relatively low. As the frequency
increases, the impedance of the capacitor increases, causing a gradual roll-off in the
magnitude plot. The roll-off is also characterized by a slope of -20 dB/decade (first-order
system). Phase Plot: At low frequencies, the phase shift is minimal. As the frequency
increases, the phase shift becomes more positive due to the decreasing capacitive
reactance, leading to a phase lead.
The Xcos simulation shows that we are trying to graph the UNIT STEP RESPONSE of the CR
circuit. And so the transfer function in the system is
s
H ( s )=( )
s+ 1
To find the unit step response, you can take the inverse Laplace transform of the transfer
function multiplied by the Laplace transform of the unit step function 1/s . and this will
output Y(s)=G(s)⋅U(s).
Where U(s) is the Laplace transform of the unit step function, which is 1/s .
( )( )
Y ( s )=
s
s+ 1
∗
1
s
Now, you can find the inverse Laplace transform of Y(s) to obtain the unit step response
y(t).
−t
y ( t ) =u(t)+ e
The response signifies a that it will rise instantly to the max value, with an exponential
decay that decreases continuously to u(t). If you were to plot this response graphically, you
would see a curve that will have an impulse response 1 with a slowly decreasing value until
it reaches u(t). Take note our initial value from the unit step is zero so that means it will
have an exponential decay that eventually will reach to zero
Bode plot Figure #3 XCOS simulation Figure #3
The results of the figure #3 shows that the bode plot graph acts as a high pass filter as the
inductor behaves like a short circuit, and the magnitude is relatively low. As the frequency
increases, the impedance of the capacitor increases, causing a gradual roll-off in the
magnitude plot. The roll-off is also characterized by a slope of -20 dB/decade (first-order
system). Phase Plot: At low frequencies, the phase shift is minimal. As the frequency
increases, the phase shift becomes more positive due to the decreasing inductive
reactance, leading to a phase lead.
The Xcos simulation shows that we are trying to graph the UNIT STEP RESPONSE of the RL
circuit. And so the transfer function in the system is
s
H ( s )=( )
s+ 1
To find the unit step response, you can take the inverse Laplace transform of the transfer
function multiplied by the Laplace transform of the unit step function 1/s . and this will
output Y(s)=G(s)⋅U(s).
Where U(s) is the Laplace transform of the unit step function, which is 1/s .
( )( )
Y ( s )=
s
s+ 1
∗
1
s
Now, you can find the inverse Laplace transform of Y(s) to obtain the unit step response
y(t).
−t
y ( t ) =u(t)+ e
The response signifies a that it will rise instantly to the max value, with an exponential
decay that decreases continuously to u(t). If you were to plot this response graphically, you
would see a curve that will have an impulse response 1 with a slowly decreasing value until
it reaches u(t). Take note our initial value from the unit step is zero so that means it will
have an exponential decay that eventually will reach to zero
Bode plot Figure #4 XCOS simulation Figure #4
The results of the figure #4 shows that the bode plot graph acts as a low pass filter the
inductor behaves like an open circuit at low freuqency, and the magnitude is relatively
high. So that means it attenuates high frequencies but allows low frequency to pass. As the
frequency increases, the impedance of the inductor increases, causing a gradual roll-off in
the magnitude plot.
The Xcos simulation shows that we are trying to graph the UNIT STEP RESPONSE of the LR
circuit. And so the transfer function in the system is
1
H ( s )=( )
s+ 1
To find the unit step response, you can take the inverse Laplace transform of the transfer
function multiplied by the Laplace transform of the unit step function 1/s . and this will
output Y(s)=G(s)⋅U(s).
Where U(s) is the Laplace transform of the unit step function, which is 1/s .
( )( )
Y ( s )=
1
s+ 1
∗
1
s
Now, you can find the inverse Laplace transform of Y(s) to obtain the unit step response
y(t).
−t
y ( t ) =1−e
The response signifies a quick rise to the final value of 1, with an exponential decay and
underdamped behavior. If you were to plot this response graphically, you would see a
curve that rises rapidly and approaches 1 with decreasing oscillations.
Bode plot Figure #5 XCOS simulation Figure #5
At low frequencies, the magnitude is determined by the constant term in the numerator. In this
case, it is 1. At high frequencies, the magnitude decreases at a rate of -40 dB/decade (for each
power of 10 increase in frequency) due to the second-order term in the denominator.
The phase behavior of a critically damped system is that the phase lags; it approaches -90
degrees per pole at higher frequencies. In this case, with complex conjugate poles due to the
transfer function (
−1
2 2
3
)
± j √ the phase starts at 0 degrees and decreases with a slope of -90
degrees per pole as the frequency increases. The phase plot shows a phase lag. The amount of
phase lag at the resonant frequency can provide insights into the damping ratio. The presence
of phase lag indicates that the system is reactive, and the amount of lag provides information
about the system's response time.
y ( t ) =( A s1∗t ) + ( Bs 2∗t ) +¿
After that we need to find the roots of the quadratic equiation s^2+s+1
−1 √ 3
s 1∧s 2= ±i
2 2
Therefore, the unit step response will involve terms with exponentials and trigonometric functions.
The unit step response y(t) for the transfer function 1/(s^2 + s +1) will exhibit oscillatory behavior due
to the presence of complex roots in the denominator.
VII. Observations
I have noticed an intriguing contrast in the Bode plot outputs between RC
(Resistor-Capacitor) and RL (Resistor-Inductor) circuits. In an RC circuit, at low
frequencies, the capacitor emulates an open circuit, resulting in a relatively high
magnitude. Conversely, in an RL circuit, at low frequencies, the inductor emulates a
short circuit, leading to a relatively low magnitude. As the frequency increases in the
RC circuit, the magnitude decreases, accompanied by a lagging phase. In contrast, in
the RL circuit, the magnitude also decreases with increasing frequency, but the
phase exhibits a leading behavior instead of lagging.
VIII. Conclusions
In conclusion, the combined use of Scilab and Xcos software emerges as a robust
approach for simulating and analyzing the responses of electrical circuits, specifically
those configured as RLC, RL or RC circuits. These software platforms offer versatile
tools that facilitate a comprehensive understanding of system behavior, allowing for
dynamic visualization of responses across different frequencies.
In Scilab, both the command line and SciNotes provide versatile options for
plotting the transfer function based on specified ranges or points. On the other
hand, Xcos serves as a valuable tool for simulating the input response of the transfer
function.
The consistent congruence observed between manual analysis in Scilab SciNotes
and dynamic simulations in Xcos underscores the reliability and effectiveness of
these platforms in accurately representing the complexities of RL and RC circuit
responses.
IX. Recommendations
The inclusion of higher-degree order circuits in System Modeling and Transfer
Function Simulation using SCILAB and XCOS is highly recommended.
Control systems are designed to manipulate the behavior of dynamic systems to
achieve desired outputs. Higher-degree order circuits, often involving higher-order
differential equations, arise in the modeling of complex systems where multiple
energy storage elements (such as capacitors and inductors) and energy dissipative
elements (such as resistors) are interconnected.
Therefore, it is advisable to undertake this recommendation to further augment
the capabilities of individuals who have successfully completed tasks involving the
understanding of transfer functions and frequency responses in simple RC, RL, and
RLC circuits. Embracing the challenge of higher-degree order circuits represents a
significant advancement, introducing complexity that can significantly broaden one's
knowledge beyond the fundamentals. This progression provides an opportunity to
delve into more intricate circuit dynamics, offering a valuable extension to the
foundational understanding already acquired.
X. Simulation