Professional Documents
Culture Documents
EcE 224
Advanced Engineering Mathematics
for ECE
LABORATORY REPORT 2
Power Series
Rica G. Aniñon
Name
2/BSEcE/A
Submitted to:
CHENNEEMAE B. BANDOY
Faculty in Charge
EcE 224 | Advanced Engineering Mathematics for ECE
Introduction
One of the key ideas in mathematics is the concept of an infinite series. It
describes the total of a collection of illimitable numbers. The series is referred to as an
infinite series if it has infinite terms, and the sum of the first n terms, Sn, is referred to as
a partial sum of the specified infinite series. When the partial sum, or the sum of the first
n terms, Sn, is given a limit as n approaches infinity, the limit is referred to as the sum to
infinity of the series, and the outcome is known as the sum of infinite of series. An
infinite series that does not converge is said to diverge. In the case of divergence, no
value of a sum is assigned. For example, the nth partial sum of the infinite series 1 + 1 +
1 +⋯ is n. As more terms are added, the partial sum fails to approach any finite value (it
grows without bound). Thus, the series diverges. (Hosch, 2006).
A series containing words using a variable is referred to as a power series. More
specifically, if the variable is x, then powers of x are present in every term of the series.
A power series can be viewed as an endless polynomial as a result. Power series are
employed in both the representation and definition of new functions. This section
defines power series and demonstrates how to spot when a power series converges
and diverges. Additionally, we demonstrate the use of power series to express several
functions.A series of the form
where x is a variable and the coefficients 𝑐𝑛 are contants, is known as a power series.
The series
1 + 𝑥 + 𝑥 + ⋯ = ∑ 𝑥𝑛
2
𝑛=0
EcE 224 | Advanced Engineering Mathematics for ECE
is an example of a power series. Since this series is a geometric series with ratio 𝑟 = 𝑥,
we know that it converges if |𝑥| < 1 and diverges if |𝑥| ≥ 1.
Figure 1. For a series graph 𝑛=0 𝑐𝑛 (𝑥 − 𝑎)𝑛 (a) shows a radius of convergence
∑∞
at 𝑅 = 0 ,graph (b) shows a radius of convergence at 𝑅 = ∞, and graph (c) shows a
radius of convergence at R. For graph (c) we note that the series may or may not
converge at the endpoints 𝑥 = 𝑎 + 𝑅 𝑎𝑛𝑑 𝑥 = 𝑎 − 𝑅
Here's where the Taylor and Maclaurin Series come into play. When we want to
define a function as a power series, the Taylor series and the Maclaurin series are
important.For a differentiable function, one can use Taylor polynomials to approximate
the function around any value. In other words, while using a Taylor series, you
presumptively know where to look for your function's derivatives. Although Taylor
polynomials have a somewhat unsightly appearance, they may be quickly used to
approximating functions if they are broken down into small sections.
EcE 224 | Advanced Engineering Mathematics for ECE
𝑓(𝑐) 𝑓 (𝑐)
′
𝑓′′(𝑐) 𝑓′′′(𝑐) 𝑓′′′′(𝑐) (𝑥 − 𝑐)4
𝑃 (𝑥) = + (𝑥 − 𝑐) + (𝑥 − 𝑐)2 (𝑥 − 𝑐)3
0! 1! 2! 3! 4!
+ +
𝑓′′′′′(𝑐)
+ 5! (𝑥 − 𝑐)5 …
The "a" in a Maclaurin series, on the other hand, is centered on the value of x =
0. Following Scottish mathematician Colin Maclaurin, the series bears his name.
Although you can use calculus to calculate Maclaurin series, there are already a lot of
series for common functions. The Maclaurin series and the expansion's sigma notation
are displayed in the following table, for instance, for five popular functions.
Table 1. Shows the Maclaurin series and the expansion sigma notation
Power series are practical tools that can be utilized in all engineering disciplines.
They can be used to evaluate intervals of convergence, solve equations, extend other
functions, and act as trial functionsAn important application of power series in the field
of engineering is spectrum analysis.In radio, audio, and light applications, it is very
useful to be able to receive a wide range of frequencies and be able to pinpoint which
frequencies are the loudest/brightest (Jake L, 2015).
Procedure
A. Creating a New M-File
After opening Matlab in my laptop, I clicked the “New Script” in the Menu bar.
Then I saved the file with a filename of Aninon_EcE224Lab2.m
EcE 224 | Advanced Engineering Mathematics for ECE
B.2. The output that was shown in the Command Window when I hit the run button
was as follows:
EcE 224 | Advanced Engineering Mathematics for ECE
>> Aninon_EcE224Lab2
ans =
B.3 Prior to moving on to the next steps, I highlighted the preceding codes by clicking
CTRL + R to make them into comments. For the following questions, I then completed
steps B.1 and B.2, and the results are as follows:
syms n
f(n)=2*n
S=symsum(2*n,n,1,100);
strjoin({'Sum of first 100 positive integers is',char(S)})
f(n) =2*n
ans =
EcE 224 | Advanced Engineering Mathematics for ECE
syms n
f(n)= 2*n-1
S=symsum(2*n-1,n,1,100);
strjoin({'Sum of first 100 odd integers is',char(S)})
>> Aninon_EcE224Lab2
f(n) =2*n - 1
ans =
>>
EcE 224 | Advanced Engineering Mathematics for ECE
syms n
f(n)=(n+1)/2
S=symsum((n+1)/2,n,1,100);
strjoin({'Sum of first 100 terms of the arithmetic sequence with a common difference of
1/2 is',char(S)}
ans =
'Sum of first 100 terms of the arithmetic sequence with a common difference of 1/2 is
2575'
EcE 224 | Advanced Engineering Mathematics for ECE
Codes:
syms n
f(n)=2^n;
S=symsum(2^n,n,1,100);
strjoin({'Sum of first 100 terms of the geometric sequence with a common ratio of 2
is',char(S)})
f(n) =2^n
ans =
'Sum of first 100 terms of the geometric sequence with a common ratio of 2 is
2535301200456458802993406410750'
>>
EcE 224 | Advanced Engineering Mathematics for ECE
B.4. Before running this new code, I first highlighted the prior code and then used
CTRL+R to make the highlighted portions into comments. I entered the following code
to find the sum of the first 100 terms of the function 𝑓(𝑥) = 0 ∑𝑁 𝑥𝑛:
syms x n
f(n) = x^n;
S=symsum(f(n),n,0,99);
strjoin({'f(x) =',char(S)})
B.5. When I pressed the "run" button, the following results appeared in the Command
Window:
>> Aninon_EcE224Lab2
ans =
>>
−𝑥 𝑓𝑜𝑟 𝑥 < 0
|𝑥| = { 0 𝑓𝑜𝑟 𝑥 = 0
𝑥 𝑓𝑜𝑟 𝑥 > 0
EcE 224 | Advanced Engineering Mathematics for ECE
B.6. I repeated step B.4 but this time I typed Inf in instead of 99 to modify the maximum
number of terms from 100 to infinity. Step B.5 was also repeated for the outcome.
syms x n
f(n) = x^n;
S =symsum(f(n),n,0,inf);
strjoin({'f(x) =',char(S)})
EcE 224 | Advanced Engineering Mathematics for ECE
>> Aninon_EcE224Lab2
ans =
>>
C. Convergence (ILO 6)
C.1. Prior to continuing, I first highlighted the prior code and then used CTRL+R to turn it
1
into comments. Then, I discovered the initial ten terms of the function 𝑓(𝑛) = by
2𝑛
entering the codes below:
for n=1:10
F(n)=1/(2^n);
strjoin({' F(',num2str(n), ')= ', num2str(F(n))})
end
C.2. Afterward, I selected "run," and the following results appeared in the Command
Window:
>> Aninon_EcE224Lab2
ans =
' F( 2 )= 0.25'
' F( 1 )= 0.5'
ans =
ans =
EcE 224 | Advanced Engineering Mathematics for ECE
ans = ans =
ans = ans =
ans = ans =
>>
ans =
EcE 224 | Advanced Engineering Mathematics for ECE
C.3. Using this table, I computed the ratio of the present to the past value 𝑓(𝑛) 𝑓(𝑛−1)
and the nth root of the present value 𝑛√𝑓(𝑛)
𝒏 𝒇(𝒏) 𝒇(𝒏) 𝒏
√𝒇(𝒏)
𝒇(𝒏 − 𝟏)
1 0.5 N/A 0.5
2 0.25 0.5 0.5
3 0.125 0.5 0.5
4 0.0625 0.5 0.5
5 0.03125 0.5 0.5
6 0.015625 0.5 0.5
7 0.0078125 0.5 0.5
8 0.0039063 0.5 0.5
9 0.0019531 0.5 0.5
10 0.00097656 0.5 0.5
C.4. Before running the new code, I first highlighted the original code and then used
CTRL+R to make the highlighted portions into comments. By entering the code below, I
was able to determin the sum of ∑𝑁 𝑓(𝑛) where 𝑓(𝑛) = at rising limit N:
1
0 2𝑛
clear; clc
for N=1:10
for n=1:N
f(n)=1/(2^n);
end
strjoin({' Sum(N = ',num2str(N), ') ',num2str(sum(f))})
end
EcE 224 | Advanced Engineering Mathematics for ECE
C.5 I clicked the run button, and the output in the Command Window were as follows:
C.6. Using this table, I computed the difference between the present value of the sum
and the previous by subtracting the past value 𝑺𝒖𝒎(𝑵 − 𝟏) from the present value
𝑺𝒖𝒎(𝑵).
N 𝑆𝑢𝑚 (𝑁) 𝑆𝑢𝑚(𝑁) − 𝑆𝑢𝑚(𝑁 − 1)
1 0.5 N/A
2 0.75 1/4
3 0.875 1/8
4 0.9375 1/16
5 0.96875 1/32
6 0.98438 1/64
7 0.99219 1/128
8 0.99609 1/256
9 0.99805 1/512
10 0.99902 1/1024
' F( 5 )= 0.2'
ans = ans =
>>
𝒏 𝒇(𝒏) 𝒇(𝒏) 𝒏
√𝒇(𝒏)
𝒇(𝒏 − 𝟏)
1 1 N/A 1
2 0.5 1/2 0.7071
3 0.33333 2/3 0.693
4 0.25 3/4 0.7071
5 0.2 4/5 0.7248
6 0.16667 5/6 0.7418
7 0.14286 6/8 0.7573
8 0.125 7/8 0.7711
9 0.11111 8/9 0.7838
10 0.1 9/10 0.7943
CODE:
clear; clc
for N=1:10
for n=1:N
f(n)=1/n;
end
strjoin({' Sum(N = ',num2str(N), ') ',num2str(sum(f))})
EcE 224 | Advanced Engineering Mathematics for ECE
end
𝒏 𝒇(𝒏) 𝒇(𝒏) 𝒏
√𝒇(𝒏)
𝒇(𝒏 − 𝟏)
1 1 N/A 1
2 0.25 1/2 0.7071
3 0.11111' 2/3 0.693
4 0.0625 3/4 0.7071
5 0.04 4/5 0.7248
6 0.027778 5/6 0.7418
7 0.020408 6/8 0.7573
8 0.015625 7/8 0.7711
9 0.012346 8/9 0.7838
10 0.01 9/10 0.7943
CODE:
clear; clc
for N=1:10
for n=1:N
F(n)=1/(n^2);
end
strjoin({' Sum(N = ',num2str(N), ') ',num2str(sum(F))})
end
c. 𝑓(𝑛) = 𝑒𝑛
CODE:
for n=1:10
f(n)=(exp(n));
strjoin({' F(',num2str(n), ')= ', num2str(f(n))})
end
'F(5)= ans =
ans = 0.0067379'
F(9)=
' F(2 )= 0.00012341'
0.13534' ans =
F(6)= ans =
ans = 0.0024788'
' F(10)= 4.54e-
'F(3)= 05'
0.049787' ans =
>>
EcE 224 | Advanced Engineering Mathematics for ECE
𝒏 𝒇(𝒏) 𝒇(𝒏) 𝒏
√𝒇(𝒏)
𝒇(𝒏 − 𝟏)
1 2.7183 N/A 2.7183
2 7.3891 2.7183 2.7183
3 20.0855 2.7183 2.7183
4 54.5982 2.7183 2.7183
5 148.4132 2.7183 2.7183
6 403.4288 2.7183 2.7183
7 1096.6332 2.7183 2.7183
8 2980.958 2.7183 2.7183
9 8103.0839 2.7183 2.7183
10 22026.4658 2.7183 2.7183
CODE:
clear; clc
for N=1:10
for n=1:N
F(n)=(exp(1)^n);
end
strjoin({' Sum(N = ',num2str(N), ') ',num2str(sum(F))})
end
Command Window Output:
' Sum(N = 4)
ans = 84.791' ans =
' Sum(N = 5)
ans = 233.2042' ans =
' Sum(N = 6)
ans = 636.633' ans =
4 84.791 e4
5 233.2042 e
5
6 636.633 e6
7 1733.2661 e
7
8 4714.2241 e8
9 12817.3081 e
9
10 34843.7738 e
10
1
d. 𝑓(𝑛) =
𝑛!
Code:
for n=1:10
F(n)=1/factorial(n);
strjoin({' F(',num2str(n), ')= ', num2str(F(n))})
end
ans = ans =
ans =
' F( 5 )= ' F( 8 )=
' F( 2 )= 0.5' 0.0083333' 2.4802e-05'
' F( 10 )= >>
ans = 2.7557e-07'
𝒇(𝒏 − 𝟏)
1 1 N/A 1
2 0.5 0.5 0.5
3 0.16667 0.16667 0.16667
4 0.041667 0.041667 0.041667
5 0.0083333 0.0083333 0.0083333
6 0.0013889 0.0013889 0.0013889
7 0.00019841 0.00019841 0.00019841
8 2.4802e-05 2.4802e-05 2.4802e-05
9 2.7557e-06 2.7557e-06 2.7557e-06
10 2.7557e-07 2.7557e-07 2.7557e-07
Code:
clear; clc
for N=1:10
for n=1:N
F(n)=1/factorial(n);
end
strjoin({' Sum(N = ',num2str(N), ') ',num2str(sum(F))})
end
ans = ans =
ans =
' Sum(N = 1 ) 1' ' Sum(N = 4 )
1.7083' ' Sum(N = 7 )
1.7183'
ans =
ans =
' Sum(N = 2 ) 1.5' ans =
' Sum(N = 5 )
1.7167' ' Sum(N = 8 )
1.7183'
ans =
ans =
' Sum(N = 3 )
1.6667' ans =
' Sum(N = 6 )
1.7181' ' Sum(N = 9 )
1.7183'
EcE 224 | Advanced Engineering Mathematics for ECE
D.2. I clicked run and the output shown in the Command Window were as follows:
ans =
ans =
>>
D.3 Before proceeding, I highlighted the previous codes and pressed CTRL + R to turn
them into comments. This time, I determined the Maclaurin series representation of 𝑒 𝑧
by typing the following codes:
D.4 I clicked run, and the output in the Command Window were as follows:
EcE 224 | Advanced Engineering Mathematics for ECE
ans =
ans =
>>
D.5. I modifed 𝑓(𝑧) in step D.3 and repeated step D.4 for the following functions:
a. f(z) = 1/(1-z)
ans =
>>
b. f(z)=ln(z+1)
ans =
EcE 224 | Advanced Engineering Mathematics for ECE
>>
c. f(z)=sinz
ans =
0 + (1/ 1 !)*( 1 )*z^ 1 + (1/ 2 !)*( 0 )*z^ 2 + (1/ 3 !)*( -1 )*z^ 3 + (1/ 4 !)*( 0 )*z^ 4 + (1/ 5
!)*( 1 )*z^ 5 + (1/ 6 !)*( 0 )*z^ 6 + (1/ 7 !)*( -1 )*z^ 7 + (1/ 8 !)*( 0 )*z^ 8 + (1/ 9 !)*( 1 )*z^ 9
+ (1/ 10 !)*( 0 )*z^ 10'
>>
d. f(z) = cosz
ans =
>>
e. f(z)=sinhz
ans =
ans =
>>
f. f(z)=coshz
EcE 224 | Advanced Engineering Mathematics for ECE
ans =
ans =
>>
E.1. In this activity, instead of using MATLAB application in my mobile phone, I used my
pc. But before proceeding, I highlighted first the the previous codes and clicked CTRL +
C to turn them into comments. Then, I typed the following line of codes.
EcE 224 | Advanced Engineering Mathematics for ECE
E.2 I clicked the run button, and the output shown in the Command Window were as
follows:
>> Aninon_EcE224Lab2
ans =
C1*exp(x)
>>
E.3. As usual, before proceeding, I highlighted the previous codes and then pressed
CTRL+ R to turn them into comments. Then I modified the code in step E.1 to solve for
the power series solution of the differential equation by replacing the last line with the
following code:
EcE 224 | Advanced Engineering Mathematics for ECE
E.4. I clicked the run button, and the output in the Command Window were as follows:
>> Aninon_EcE224Lab2
ans =
C2*exp(ExpansionPoint)
>>
E.5. After highlighting the previous codes and turning them into comments by pressing
CTRL + R, I repeated the code in step E.1 this time with modification to solve for 𝑦
′′ + 𝑦 = 0. To find the second derivative 𝑦′′, use the following code:
E.6. After that, I clicked run and the output in the Command Windows shows:
>> Aninon_EcE224Lab2
ans =
C3*cos(x) - C4*sin(x)
>> E.7. I turn the previous codes again into comments by highlighting it and pressing
CTRL + C. After that, I modified the code in step E.5 to solve for the power series
solution of the differential equation by replacing the last line with the following code:
EcE 224 | Advanced Engineering Mathematics for ECE
E.8. I clicked the run button and the result in the Command Window were as follows:
>> Aninon_EcE224Lab2
ans =
C5*cos(ExpansionPoint) - C6*sin(ExpansionPoint)
>>
E.9 I repeated steps E.5 to E.8 for the following differential equations:
a. 𝑦 ′′ − 2𝑦′ + 𝑦 = 0
Code:
syms y(x)
d2y = diff(y,x,2);
ode = d2y-2*dy+y == 0;
dsolve(ode)
ans =
C7*exp(x) + C8*x*exp(x)
>>
EcE 224 | Advanced Engineering Mathematics for ECE
Code:
syms y(x)
d2y = diff(y,x,2);
ode = d2y-2*dy+y == 0;
dsolve(ode,'ExpansionPoint')
ans =
C7*exp(x) + C8*x*exp(x)
>> Aninon_EcE224Lab2
ans =
C9*exp(ExpansionPoint) + C10*ExpansionPoint*exp(ExpansionPoint)
>>
b. 𝑦 ′′ − 7𝑦′ = 0
Code:
syms y(x)
d2y = diff(y,x,2);
ode = d2y-(7*dy)== 0;
dsolve(ode)
Command Window:
>> Aninon_EcE224Lab2
ans =
C11 + C12*exp(7*x)
>>
Code:
syms y(x)
d2y = diff(y,x,2);
ode = d2y-(7*dy)== 0;
EcE 224 | Advanced Engineering Mathematics for ECE
dsolve(ode,'ExpansionPoint')
ans =
C13 + C14*exp(7*ExpansionPoint)
>>
c. 2𝑦 ′′ − 𝑦 = 0
Code:
syms y(x)
d2y = diff(y,x,2);
ode = 2*d2y-dy == 0;
dsolve(ode)
Command Window:
>> Aninon_EcE224Lab2
ans =
C15 + C16*exp(x/2)
>>
Code:
syms y(x)
d2y = diff(y,x,2);
ode = 2*d2y-dy == 0;
dsolve(ode,'ExpansionPoint')
ans =
C17 + C18*exp(ExpansionPoint/2)
>>
EcE 224 | Advanced Engineering Mathematics for ECE
d. 𝑦 ′′ + 𝑦 ′ − 𝑦 = 0
Code:
syms y(x)
d2y = diff(y,x,2);
ode = d2y+dy-y == 0;
dsolve(ode)
ans =
>>
Code:
syms y(x)
d2y = diff(y,x,2);
ode = d2y+dy-y == 0;
dsolve(ode,'ExpansionPoint')
ans =
>>
Guide Questions
1. What are the common properties of infinite series that you have observed? (ILO 5)
In this laboratory activity, the following properties of the infinite series that I
have observed are: nth Term property of a Convergent infinite series, Basic
Summation/Product properties of infinite Series, and Reindexing an Infinite
Series.
2. Explain what does the table in C.3 and C.6 show about the series? (ILO 6)
The table in the C.3 shows that the result of f(n) approaches to zero. On the other
hand, the table in the C.6. shows that the result of f(n) approaches to 1.
EcE 224 | Advanced Engineering Mathematics for ECE
3. Determine if the different series in C.7 with given 𝑓(𝑛) converge or diverge by
explaining the result in the table in C.3 and C.6. (ILO 6)
In C7, we can say that the result converges or diverges depending on its result. If
L<1, then the series converges; if L>1, the series diverges; and if L=1, the series
may diverge or converge.
4. What are the common properties of power series that you have observed? (ILO 7)
The common properties of power series that I have observed in this
laboratory activity are: Combining power series, Multiplication of power series,
and differentiation of power series.
5. In part D, Compare the results using MATLAB function taylor () with using the
taylor series formula. What are the advantage and the disadvantage of using the
MATLAB built-in function versus implementing manually the code from the given
mathematical formula? (ILO 8)
Using the MATLAB function makes it easier and faster than the manual
solving since you have to do the step-by-step process in the manual solving
which will take too much of your time.
7. Compare the solution of differential equations using direct methods and using
power series. What are the advantage and disadvantage of using one to that of
the other? (ILO 9)
8. Share your experiences in this laboratory activity? What new learnings or interest
did you gain? What challenges and problems did you encounter?
In this laboratory activity I encountered a lot of problems since most of the codes
had errors and we must find ways to decode it. Since I still don’t have a background in
MATLAB programming, I’m still having a hard in understanding it’s function. But thanks
to uncle Google because he gave me answers to the things that I don’t know. But even
though I am having a hard time in coding, I still enjoy doing it because I learned a lot of
things and it also made me explore a lot of things on my own.
EcE 224 | Advanced Engineering Mathematics for ECE
Conclusion
In this lab exercise, we can claim that there are many different kinds of infinite
series, including arithmetic, geometric, and harmonic series. In addition, depending on
their pattern, they have various equations. Additionally, we can add that every power
series has a possibility for the series to diverge or converge. Furthermore, the Taylor
Series is the generalization of the Maclaurin Series. Thus, we can argue that anything
can be related and even the differential problem may be solve using power series. This
project was quite interesting because it allowed me to explore and discover more about
MATLAB's capabilities and functions.
Documentation
EcE 224 | Advanced Engineering Mathematics for ECE
References:
BYJU’S (2023). Infinite Series Formula. Retrieved from. Infinite Series Formula | Sum
Of Infinite Series Formula (Algebra) (byjus.com)
Seb (December 21, 2020). Power Series: Understand the Taylor and MacLaurin Series.
Retrived from. https://programmathically.com/power-series-maclaurin-taylor-series/
Statistics Howto (2023). Taylor Series & Maclaurin Series with Examples. Retrieved
from. https://www.statisticshowto.com/sequence-and-series/taylor-series-maclaurin-
series/#google_vignette
Strang, G. S., & Herman, Edwin “Jed”. (2006, March 30). Calculus Volume 2. Retrieved
from https://openstax.org/books/calculus-volume-2/pages/6-1-power-series-and-
functions
Jake L. (January, 15, 2015). What are the applications of power series in mechanical
engineering? Retrieved from. https://socratic.org/questions/what-are-the-applications-of-
power-series-in-mechanical-engineering