



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
The Taylor series expansion of the cosine function about x=0 and analyzes the approximation error using MATLAB. how to calculate the Maclaurin series approximation of cos(x) with increasing terms and determines the number of terms required to achieve two significant digits of accuracy for x=pi/3. The document also discusses the challenges of finding a good step size for differentiating ill-conditioned equations and shares an example of a graduate student's difficulties calculating derivatives of a car model's deformation.
Typology: Study notes
1 / 6
This page cannot be seen from the preview
Don't miss anything!
Taylor series expansion of f=cos(x) about x=0. (3) (4) '(0) sin(0) 0, "(0) cos(0) 1 (0) sin(0) 0, (0) cos(0) 1,. f f f f etc = โ = = โ = โ = = = = So Taylor series expansion is (as given in Problem 4.10) 2 4 6 8 cos( ) 1 2! 4! 6! 8! x x x x x = โ + โ + +" An mโfile that calculates this approximation with n terms is function apx=costaylor(x,n) %Calculates the Maclaurin series approximaton to cos(x) using the first n %terms in the expansion. apx=0; for i=0:nโ 1 apx=apx+(โ1)^ix^(2i)/factorial(2*i); end Problem 4.10 asks us to increment n from 1 until the approximate error indicates that we have accuracy to two significant digits for x=pi/3. We start with
a1=costaylor(pi/3,1) a1 = 1 a2=costaylor(pi/3,2) a2 =
With cos(pi/3)=0.5, the true error in a1 is 100% and in a2 it is
true2=(a2โ0.5)/0.5*
true2 = โ9. That is about 9.7%. The approximate error, though is
aprerror=(a1โa2)/a2* aprerror = 121.3914% With one more term we get a3=costaylor(pi/3,3) a3 =
true3=(a3โ0.5)/0.5* true3 =
aprerror=(a2โa3)/a3* aprerror = โ9. So the actual error is only 0.36% while the estimated is 10%. Finally with a fourth term a4=costaylor(pi/3,4) a4 =
true4=(a4โ0.5)/0.5* true4 = โ0. aprerror=(a3โa4)/a4*
One of my graduate students ran into difficulties calculating derivatives of the deformation of a car model seen below
With respect to variables that define the dimensions of the car.