It is known that the series S_n = 1^-11 + 2^-4 + 3^-4 + ... + n^-4 converges to
ID: 3782632 • Letter: I
Question
It is known that the series S_n = 1^-11 + 2^-4 + 3^-4 + ... + n^-4 converges to pi^4/90 for n rightarrow infinity. Use MATLAB to study the convergence of the series. Write a MATLAB script that evaluates the first terms of the series numerically. The script prints the values of S_n, |S_n - and |(90S_n)^1/4 - pi| for n = 1, 2, ..., N where N is a reasonably chosen upper limit. How many terms of the series are necessary to obtain an approximation of pi with 5 significant digits? How many are required for G significant digits?Explanation / Answer
Part a) Matlab Code:
We iteratively add new term of the series to result sum, in each iteration we display Sn, |Sn - ((Pi)^4)/90 | which is error, and |(90*Sn)^1/4 - pi| (variable tmp in given matlab code)
We keep adding new terms untill the relative error is less than 0.00001%
clc;
clear all;
Sn = 1.0;
summ = ((pi)^4)/90;
N = 1000;
for n=2:N
n
Sn = Sn + (n)^(-4)
error = abs(Sn - summ)
tmp = abs((90*Sn)^(1/4) - pi)
if(error/summ*100 < 0.00001)
break;
end
end
Part b)
For getting the error < 0.00001 (i.e 5 significant digits), we need to add the terms till n = 145.
For getting the error < 0.000001 (i.e 6 significant digits), we need to add the terms till n = 313. (This can be verified by changing the minimum error to 0.000001 in matlab code)
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.