0% found this document useful (0 votes)
3 views6 pages

MATLAB Cosine Series Approximation

The document presents a MATLAB assignment focused on approximating the cosine function using a Taylor Series expansion up to four terms. It includes code snippets and graphs demonstrating the convergence of the series and how the approximation improves with each additional term. Observations indicate that the fourth-term approximation closely matches the actual cosine curve within the specified range.

Uploaded by

dharmtej55555
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views6 pages

MATLAB Cosine Series Approximation

The document presents a MATLAB assignment focused on approximating the cosine function using a Taylor Series expansion up to four terms. It includes code snippets and graphs demonstrating the convergence of the series and how the approximation improves with each additional term. Observations indicate that the fourth-term approximation closely matches the actual cosine curve within the specified range.

Uploaded by

dharmtej55555
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Math2601 P.

DharmTej(2024032316) Page 1 of 6

MATLAB Assignment 01
Solution for Problem 01
Math2601 [Link](2024032316) Page 2 of 6
Math2601 [Link](2024032316) Page 3 of 6
Description: In this section, a for loop is used to compute the summation of the
series up to N=4 terms. The resulting approximation is plotted over the domain (-pi/
2 to pi/2).

Linspace is used to generate random values between -pi/2 and pi/2


Math2601 [Link](2024032316) Page 4 of 6

Code :

Graph:
Math2601 [Link](2024032316) Page 5 of 6

Description: To visualize how the series converges, we manually calculate and


plot the cumulative sums for the rst four terms individually. These are overlaid on
the same graph along with the actual cos(x) function to demonstrate accuracy
improvement with each added term

Code:
fi
Math2601 [Link](2024032316) Page 6 of 6

Graph:

Observations and Conclusion


From the graphs obtained, we observe that:
1. Single Term: The rst term approximation (y=1) is only
accurate at x=0.
2. Convergence: As we add higher-order terms (2nd, 3rd, and
4th), the approximation "hugs" the true cosine curve more
tightly.
3. Range: Within the range [-pi/2, pi/2], the 4th-term
approximation is nearly indistinguishable from the true value of
cos(x), validating the Taylor Series formula for this domain.
fi

You might also like