0% found this document useful (0 votes)
226 views42 pages

Feedback and Control Systems Laboratory: ECEA107L/E02/2Q2021

The document describes an activity on linear constant-coefficient differential equations performed in the Feedback and Control Systems Laboratory. The activity involves determining homogeneous solutions to differential equations, finding poles and zeros of transfer functions, and using partial fraction expansions and Laplace transforms. Procedures for solving problems using MATLAB commands are provided. Sample computations demonstrating the solutions are shown.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
226 views42 pages

Feedback and Control Systems Laboratory: ECEA107L/E02/2Q2021

The document describes an activity on linear constant-coefficient differential equations performed in the Feedback and Control Systems Laboratory. The activity involves determining homogeneous solutions to differential equations, finding poles and zeros of transfer functions, and using partial fraction expansions and Laplace transforms. Procedures for solving problems using MATLAB commands are provided. Sample computations demonstrating the solutions are shown.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 42

FEEDBACK AND CONTROL SYSTEMS

LABORATORY
ECEA107L/E02/2Q2021

Activity No. 1

Linear Constant-Coefficient Differential Equations

Submitted by: MACARAEG, Kim Andre S.


Student Number: 2018162135
Date Performed: November 26, 2020
Date Submitted: December 11, 2020

Engr. Glenn V. Magwili


- Instructor –
FINAL DATASHEET
Procedure:
1. Determine the homogeneous solutions of the following differential equations.

d 2 c (t) d c(t )
a. 2
+4 +13 c (t )=r(t )
dt dt

MATLAB Commands:
>> Procedure 1 Question a
>> syms c(t);
>> roots([1,4,13])

ans =

-2.0000 + 3.0000i
-2.0000 - 3.0000i

>> ode = diff(c,t,2)+4*diff(c,t,1)+13*c==0;


>> homogeneous_solution = dsolve(ode)

homogeneous_solution =

C1*cos(3*t)*exp(-2*t) - C2*sin(3*t)*exp(-2*t)

d 2 c (t) d c (t )
b. +8 + 16 c(t) =r (t )
d t2 dt

MATLAB Commands:
>> %Procedure 1 Question b
>> syms c(t);
>> roots([1,8,16])

ans =

-4
-4

>> ode = diff(c,t,2)+8*diff(c,t,1)+16*c==0;


>> homogeneous_solution = dsolve(ode)

homogeneous_solution =

C1*exp(-4*t) + C2*t*exp(-4*t)
d 2 c (t) d c (t )
c. 2
+7 +12 c (t )=r(t )
dt dt

MATLAB Commands:
>> %Procedure 1 Question c
>> syms c(t)
>> roots([1,7,12])

ans =

-4
-3

>> ode = diff(c,t,2)+7*diff(c,t,1)+12*c==0;


>> homogeneous_solution = dsolve(ode)

homogeneous_solution =

C1*exp(-4*t) + C2*exp(-3*t)

5. Find the positions of the poles and zeroes of the transfer function given below

2 s2 +12 s +26
G ( s )=
s 3 +4 s 2+5 s+2

MATLAB Commands:
>> %Procedure 5
>> G = tf([2,12,26],[1,4,5,2])

G =

2 s^2 + 12 s + 26
---------------------
s^3 + 4 s^2 + 5 s + 2

Continuous-time transfer function.

>> pzmap(G)
Plot:

Figure 1.1 Pole-Zero Map of G(s)


6. Given the position of the poles and zeroes of a system, generate the transfer function of
the system

Figure 1.2 Pole-Zero Map of G1(s)

MATLAB Commands:
>> %procedure 6
>> R_s= poly([-4,-1+j,-1-j]);
>> C_s = poly([-3, -1]);
>> G = tf(C_s,R_s)

G =

s^2 + 4 s + 3
----------------------
s^3 + 6 s^2 + 10 s + 8

Continuous-time transfer function.

s 2 +4 s+3
Transfer function, G 1 ( s )=¿
s 3+ 6 s 2+ 10 s+ 8
7. Solve c (t) using partial fraction expansion of the system given below

x (s−3)
a. C ( s ) =
s(s−2)(s +2)

MATLAB Commands:
>> %procedure 7 Question a
>> syms c(s);
>> x = 23; %Terminal number%
>> c(s)=((x*(s-3))/((s)*(s-2)*(s+2)))

c(s) =

(23*s - 69)/(s*(s - 2)*(s + 2))

>> num = [23 -69];


>> den = expand(((s)*(s-2)*(s+2)));
>> coeffs(den ,'all')

ans =

[1, 0, -4, 0]

>> den = [1 0 -4 0];


>> [r,p,k]=residue(num,den);
>> a = [r,p,k]

a =

-2.8750 2.0000
-14.3750 -2.0000
17.2500 0

>> partial_fraction_expansion = (a(1,1)/(s-a(1,2)))+(a(2,1)/(s-


a(2,2)))+(a(3,1)/(s-a(3,2)))

partial_fraction_expansion =

69/(4*s) - 115/(8*(s + 2)) - 23/(8*(s - 2))

>> inverse_laplace_transform =
ilaplace(partial_fraction_expansion)

inverse_laplace_transform =

69/4 - (23*exp(2*t))/8 - (115*exp(-2*t))/8


69 115 23
Partial Fraction expansion: − −
4 s 8 ( s +2 ) 8( s−2)

69 23 e2 t 115 e−2 t
Inverse Laplace transform: − −
4 8 8

x
b. C ( s ) =
( s+1 ) ( s +2 )3

MATLAB Commands:
>> %Procedure 7 Question b
>> syms c(s);
>> x=23; %terminal number%
>> c(s)=(x/((s+1)*(s+2)^3))

c(s) =

23/((s + 1)*(s + 2)^3)

>> num = [23];


>> den = expand(((s+1)*(s+2)^3));
>> coeffs(den ,'all')

ans =

[1, 7, 18, 20, 8]

>> den = [1 7 18 20 8];


>> [r,p,k]=residue(num,den);
>> a = [r,p,k]

a =

-23.0000 -2.0000
-23.0000 -2.0000
-23.0000 -2.0000
23.0000 -1.0000

>> partial_fraction_expansion = (a(1,1)/(s-a(1,2))^3)+(a(2,1)/(s-


a(2,2))^2)+(a(3,1)/(s-a(3,2))^1)+(a(4,1)/(s-a(4,2)))

partial_fraction_expansion =

23/(s + 1) - 23/(s + 2) - 23/(s + 2)^2 - 23/(s + 2)^3

>> inverse_laplace_transform =
ilaplace(partial_fraction_expansion)
inverse_laplace_transform =

23*exp(-t) - 23*exp(-2*t) - 23*t*exp(-2*t) - (23*t^2*exp(-2*t))/2

23 23 23 23
Partial Fraction expansion: − − −
(s+1) ( s+2 ) ( s+2 ) ( s+ 2 )3
2

23t 2 e−2t
Inverse Laplace transform: 23 e−t −23 e−2t −23 t e−2 t −
2

x s3
c. C ( s ) = 2
s ( s2 +9 ) ( s−2 )

MATLAB Commands:
>> %Procedure 7 Question c
>> syms c(s);
>> x=23; %Terminal number%
>> c(s)=((x*s^3)/((s)*(s^2+9)*(s-2)^2))

c(s) =

(23*s^2)/((s^2 + 9)*(s - 2)^2)

>> num = [23 0 0];


>> den = expand(((s^2+9)*(s-2)^2));
>> coeffs(den,'all')

ans =

[1, -4, 13, -36, 36]

>> den = [1 -4 13 -36 36];


>> [r,p,k]=residue(num,den);
>> a = [r,p,k]

a =

-2.4497 - 1.0207i 0.0000 + 3.0000i


-2.4497 + 1.0207i 0.0000 - 3.0000i
4.8994 + 0.0000i 2.0000 + 0.0000i
7.0769 + 0.0000i 2.0000 + 0.0000i

>> partial_fraction_expansion = (a(1,1)/(s-(3i)))+(a(2,1)/(s-(-


3i)))+((a(3,1))/(s-(2)))+((a(4,1))/(s-(2))^2)

partial_fraction_expansion =
828/(169*(s - 2)) + 92/(13*(s - 2)^2) + (- 414/169 - 345i/338)/(s
- 3i) + (- 414/169 + 345i/338)/(s + 3i)

>> inverse_laplace_transform =
rewrite(ilaplace(partial_fraction_expansion),'sincos')

inverse_laplace_transform =

(345*sin(3*t))/169 + (828*cos(t*2i))/169 - (828*cos(3*t))/169 -


(sin(t*2i)*828i)/169 + (92*t*(cos(t*2i) - sin(t*2i)*1i))/13

−414 345i −414 345 i


− +
Partial Fraction expansion: 828 92 169 338 169 338
+ + +
169(s−2) 13 ( s−2 ) 2
s−3 i s+3 i

Inverse Laplace transform:


345 sin(t 2 i) 828 cos (t 2 i) 828 cos (3 t ) 828 isin ( t 2 i )
+ + − +92 t ¿ ¿
169 169 169 169

8. Using ilaplace command, verify your answer to (7)

x (s−3)
a. C ( s ) =
s(s−2)(s +2)

MATLAB Commands:
>> %Procedure 8 Question a
>> syms c(s);
>> x = 23; %Terminal number%
>> c(s)=((x*(s-3))/((s)*(s-2)*(s+2)))

c(s) =

(23*s - 69)/(s*(s - 2)*(s + 2))

>> inverse_laplace = ilaplace(c(s))

inverse_laplace =

69/4 - (23*exp(2*t))/8 - (115*exp(-2*t))/8

x
b. C ( s ) =
( s+1 ) ( s +2 )3

MATLAB Commands:
>> %Procedure 8 Question b
>> syms c(s);
>> x = 23; %Terminal number*
>> c(s)=(x/((s+1)*(s+2)^3))
c(s) =

23/((s + 1)*(s + 2)^3)

>> inverse_laplace = ilaplace(c(s))

inverse_laplace =

23*exp(-t) - 23*exp(-2*t) - 23*t*exp(-2*t) - (23*t^2*exp(-2*t))/2

x s3
c. C ( s ) = 2 2
s ( s +9 ) ( s−2 )

MATLAB Commands:
>> %Procedure 8 Question c
>> syms c(s);
>> x=23; %Terminal number%
>> c(s)=((23*s^3)/((s)*(s^2+9)*(s-2)^2))

c(s) =

(23*s^2)/((s^2 + 9)*(s - 2)^2)

>> inverse_laplace = rewrite(ilaplace(c(s)),'sincos')

inverse_laplace =

(345*sin(3*t))/169 + (828*cos(t*2i))/169 - (828*cos(3*t))/169 -


(sin(t*2i)*828i)/169 + (92*t*(cos(t*2i) - sin(t*2i)*1i))/13
Proof of performance of the activity
SAMPLE COMPUTATIONS
HOMEWORK
1. Expand by partial fraction expansion and determine the inverse Laplace
Transform of the systems given below:

xs +1
a. C ( s ) = 2 x = 23 (Terminal Number)
s −s−2

MATLAB Commands:
>>format short
>> syms c(s) c(t);
>>x=23;
>> c(s) = (x*s+1)/(s^2-s-2);
>> num = [x 1];
>>den = [1 -1 -2];
>>[r,p,k]=residue(num,den);
>> a = [r,p,k];
>> c(s) = (a(1,1)/(s-a(1,2)))+(a(2,1)/(s-a(2,2)))
>>c(t) = ilaplace(c(s))

c(s) =

22/(3*(s + 1)) + 47/(3*(s - 2))

c(t) =

(22*exp(-t))/3 + (47*exp(2*t))/3

Partial Fraction expansion:


22 47
C ( s) = +
3(s +1) 3 (s−2)

Inverse Laplace transform:


22 e−t 47 e 2 t
c (t)= +
3 3
xs+ 3
b. C ( s ) = 3 2 x = 23 (Terminal Number)
2 s −3.4 s −1.98 s−0.406

MATLAB Commands:
>> format short
>>syms c(s) c(t);
>> x=23;
>> c(s) = (x*s+3)/(2*s^3-3.4*s^2-1.98*s-0.406);
>> num = [x 3];
>> den = [2 -3.4 -1.98 -0.406];
>> [r,p,k] = residue(num,den);
>> a = [r,p,k];
>> ans_2 = vpa(ilaplace(c(s)),3)
>>c(s)=vpa((a(1,1)/(s-a(1,2)))+(a(2,1)/(s-a(2,2)))+(a(3,1)/(s-
a(3,2))),3)
>> c(t) = ilaplace(c(s));
>> ans_1=vpa(c(t),3) %Complex Exponential form
>> ans_2 %Trigonometric Exponential form

c(s) =

(4.4642/(s-2.1935))+((-2.2321+1.7033i)/(s+0.2468-0.1779i))+((-
2.2321+1.7033i)/(s+0.2468+0.1779i))

ans_1 =

4.46*exp(2.19*t) - exp(t*(- 0.247 + 0.178i))*(2.23 + 1.7i) -


exp(t*(- 0.247 - 0.178i))*(2.23 - 1.7i) (COMPLEX EXPONENTIAL
FORM)

ans_2 =

4.46*exp(2.19*t) - exp(-0.247*t)*cos(0.178*t)*(2.23 - 1.7i) -


exp(-0.247*t)*cos(0.178*t)*(2.23 + 1.7i) + exp(-
0.247*t)*sin(0.178*t)*(1.7 + 2.23i) + exp(-
0.247*t)*sin(0.178*t)*(1.7 - 2.23i) (EXPONENTIAL TRIGONOMETRIC
FORM)

Partial Fraction expansion:


4.4642
c ( s )= +¿ ¿
(s−2.1935)
Inverse Laplace transform
4.46 e2.19 t + e−0.247t cos ( 0.178t ) (−2.23+1.7 i )+ e−0.247 cos ( 0.178 t ) (1.7 +2.23i ) +e−0.247 t sin ⁡(0.178 t)(1.7−2.33i)

xs+1
c. C ( s ) = x = 23 (Terminal Number)
s +5 s2 +8 s+ 4
3

MATLAB Commands:
>>format short;
>>syms c(s) c(t);
>>x=23;
>>c(s) = (x*s+3)/(s^3+5*s^2+8*s+4);
>>num = [x 3];
>>den = [1 5 8 4];
>>[r,p,k] = residue(num,den);
>>a = [r,p,k];
>>c(s)=(a(1,1)/(s-a(1,2)))+(a(2,1)/(s-a(2,2))^2)+(a(3,1)/(s-
a(3,2)))
>>vpa(ilaplace(c(s)),3)

c(s) =

20/(s + 2) - 20/(s + 1) + 43/(s + 2)^2

ans =

20.0*exp(-2.0*t) - 20.0*exp(-1.0*t) + 43.0*t*exp(-2.0*t)


HANDWRITTEN SOLUTION FOR HOMEWORK
SEATWORK
Find v c (t ) if all initial conditions are zero.

MATLAB command:
>>format rat;
>>syms i(t) I(s) Vc(s) F;
>>x = 23; %Terminal number%
>>di = diff(i);
>>ode = (25*i + (x*(10^-3))*di+(1/(x*(10^-6)))*int(i,0,inf))==24
>>laplace_equation = laplace(ode,t,s);
>>laplace_equation=
subs(laplace(ode,t,s),laplace(int(i,0,inf)),laplace(i(t),t,s)/s)
;
>>laplace_equation = subs(laplace_equation,laplace(i(t),t,s),F);
>>laplace_equation = subs(laplace_equation,i(0),0);
>>I(s) = solve(laplace_equation,F);
>>Z(s) = 1/(s*23*10^-6);
>>Vc(s)= I(s)*Z(s)
>>vc(t)=ilaplace(Vc(s));
>>V_c =vpa(vc(t), 7)
>>fplot(V_c)
>>xlim([0 0.01])
>>ylim([0 35])
>>title('OUTPUT VOLTAGE ACROSS Vc')
>>xlabel('Time, (t) (sec)')
>>ylabel('Vc(t)')
ode(t) =
25*i(t) + (23*diff(i(t), t))/1000 + (1493901668173913*int(i(t),
t, 0, Inf))/34359738368 == 24

Vc(s) =

24000000/(23*s^2*((23*s)/1000 + 1493901668173913/(34359738368*s)
+ 25))

V_c =

24.0 - 24.0*exp(-543.4783*t)*(cos(1262.929*t) +
0.4303315*sin(1262.929*t))
HANDWRITTEN SOLUTION FOR SEATWORK
INTERPRETATION / ANALYSIS
As it was noted from the experiment, a class of differential equation of the form
v i
d c (t)
∑ bi d t i =r (t ) is called linear differential equation with constant coefficients. Linear
i=0
Constant-Coefficient Differential Equations (LCCDE) can describe systems called
Linear Time Invariant (LTI) Systems. Linear Time Invariant (LTI) systems means that
when an input to a given system is scaled by a value, the output of the system is scaled
by the same amount. As it was learned, solutions to an LCCDE are divided into two
parts which is the homogenous solution c h (t ) (also known as natural response) and
particular solution c p (t) (also known as the forced response or steady state response).
The sum of these solutions is called the total solution of the system denoted by c (t)
where c ( t ) =c h ( t ) +c p (t). For procedure 1, question a, b, and c only have homogeneous
solutions since the forcing (input) function is set to zero. For question a, the auxiliary
equation has imaginary roots. For question b and c, the auxiliary equation has distinct
roots. By using the ROOTS(C) command of MATLAB, it computes the roots of the
polynomial whose coefficients are the elements of the vector C.
For procedure 2, question a, b, and c have particular solutions since there is a
forcing (input) function. Furthermore, they are considered as nonhomogeneous
equation. Simply by using direct observation of the form r ( t ), it only means that the
particular solution c p (t) will only follow whatever is the form of r (t ). For question a, the
form of r (t ) is in the form of a second-degree polynomial therefore the particular
solution obtained followed this form. For question b, it was observed that r (t ) is in the
form of exponential equation therefore the assumption that has been made for particular
solution is that it also an exponential. For question c, it was observed that r(t) is a
trigonometric function, therefore the possible particular solution is in the form of
combination sin and cos. It also assumes that the output would probably oscillate.
For procedure 3, the question required to find the total solution of the given
nonhomogeneous equation and all the initial conditions are set to zero. Homogeneous
solution was obtained by finding the roots of the auxiliary equation and writing the
homogeneous whether the root is distinct, repeated, or complex but for the given
question the roots of the auxiliary equation is distinct therefore the homogeneous
solution is in the form exponential. The homogeneous solution obtained only describes
that the function decays as time approaches infinity. For the particular solution of the
question, it was observed that the form of the forcing (input) function is a polynomial
with a degree of 2 therefore it is assumed that the possible form of a particular solution
is a second-degree polynomial. By differentiating the assumed particular solution, it was
differentiated up to the second degree because the question is a second-degree
nonhomogeneous equation and by comparing coefficients and by using some technique
to solve system of linear equation, the constants for the particular solution was
obtained. The constant for the homogeneous solution was obtained by using the initial
conditions which are all zero. The constants for the homogeneous solution were
obtained by also using some technique to solve system of linear equations in which the
total solution was evaluated at initial conditions.
For procedure 4, the question required to find the total solution of the given
nonhomogeneous equation using Laplace transform method where the initial conditions
are assumed zero. To recap, Laplace transform which is also called as integral
transforms is an effective way to solve linear differential equation with constant
coefficients having initial conditions. The time domain differential equation will be
transformed into s-domain where the initial conditions were applied and by using
inverse Laplace transform to transform back the s-domain expression into time domain.
C (s) refers to the output while R( s) refers to the input. By manipulating the transformed
differential equation to isolate C (s) , it was transformed back to the time domain after
doing partial fraction decomposition. As it was observed, the total solution obtained
using the Laplace transform method is the same for the total solution obtained using
classical method of solving nonhomogeneous differential equation.
For procedure 5, given the transfer function, it is required to find the position of
the poles and zeroes. To recap, zeroes of a transfer function refers to the value of S
that makes the numerator of the transfer function equals to zero meaning that the
transfer function vanishes, that is lim G ( s ) =0. Meanwhile, poles of a transfer function
s→zi

refers to the value of S that makes that makes the value of the transfer function
becomes unbounded, that is slim
→p
G ( s ) =∞. By using the command PZMAP(SYS) it
i

computes the poles and zeros of the LTI model SYS and plots them in the complex
plane. It was noted that the poles are plotted as x’s and the zeros are plotted as o’s.
Based from the given in the question, the zeros appear to be -3-2i and -3+2i while the
poles appear to be -2 and -1.
For procedure 6, given the position of the poles and zeroes of a system, it is
required to generate the transfer function of the system. In order to solve the required
transfer function, the command POLY(A) was used to convert roots to polynomial where
A is a row vector consisting of the roots and the command used after is tf(NUM,DEN)
where it generates the transfer function based from the given numerator and
s 2 +4 s+ 3
denominator expression. The obtained result appears to be G ( s )= 3 .
s +6 s 2+ 10 s+ 8
For procedure 7, it is required to solve c (t) using partial fraction expansion of the
system given. The problem was solved using the residue command in MATLAB where it
finds the residues, poles and direct term of a partial fraction expansion of the ration of
two polynomials. After the finding the partial fraction expansion, the inverse laplace
transform will be determined for the given partial fraction expansion. For question a, the
denominator has only linear factors. For question b, the denominator has linear and
repeated factors. For question c, the denominator has a linear, repeated, and quadratic
factor where the roots are complex. The given problems are tedious to do in manually
and it is more convenient to use MATLAB to generate faster and correct results
especially when doing partial fraction expansion to find the coefficients.
For procedure 8, it is required to use the ilaplace command to verify answer to
procedure 7. To recap, using the command ILAPLACE(L) calculates the inverse
Laplace transform of the scalar system L with default independent variable s. Based on
the results, by using ilaplace command it is more convenient to use since it directly
calculates the inverse laplace transform of a given system without doing partial fraction
expansion and calculation the inverse laplace transform manually. It is verified that the
results obtained from procedure 7 is the same result obtained from procedure 8 using
the ilaplace command.
CONCLUSION
To wrap up, it was determined that a linear constant-coefficient differential
equation (LCCDE) can be solve using direct method or by Laplace transform method
with the aid of MATLAB to make the computation more convenient and correct. It was
identified that a LCCDE describes a class of system that is called Linear Time Invariant
(LTI) systems meaning that when an input to a given system is scaled by a value, the
output of the system is scaled by the same amount. Moreover, the solution to LCCDE
consist of homogeneous solution and particular solution and their sum is called the total
solution of the LCCDE. The homogeneous solution also refers to the natural response
and the particular solution also refers to the forced response. Homogeneous solution is
the solution of the differential where r (t ) is equal to zero meanwhile particular solution is
the solution obtained by direct observation of the form of the r (t ) meaning that the
particular solution will just follow whatever is the form of r (t ). It was learned that by
using the command ROOTS can easily determine the roots of the auxiliary equation in
which it makes it more convenient to determine the homogeneous solution of the given
LCCDE. By using Laplace transform method, solving LCCDE can be more convenient
especially if there are initial conditions to consider. The Laplace transform of the
independent variable can be isolated to one side of the transformed equation and by
using partial fraction expansion and table of Laplace transforms, the inverse Laplace
transform of a function in s-domain can be easily obtained. By using the command
RESIDUE, it finds the partial fraction expansion of the ration of two polynomials and by
using ILAPLACE command, it finds the inverse Laplace transform of a given function in
s domain. Moving on, it was learned that the transfer function is the ratio of the
transform of the output C (s) to the transform input R( s) taking all initial conditions to be
equal to zero. Zeroes of a transfer function refers to the roots of s in the numerator that
can make G ( s )=0. Meanwhile, poles refer to the roots of s in the denominator that can
make G ( s )=∞. Lastly, by using PZMAP command it computes the poles and zeros of
the LTI model and plots them in the complex plane and the poles are plotted as x’s and
the zeros are plotted as o’s.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy