Beruflich Dokumente
Kultur Dokumente
2. Use WHILE-loop to modify your script file in Q1 so that the error percentage for 𝑥𝑛 does not
exceed 5%.
3. Enter: format long. Use the function 𝑓(𝑥) = 𝑥 5 − 7 with starting point 𝑥0 = 2. By trial
and error, what is the lowest value of n for which the program converges (stops changing).
Compute the error, which is how close the program’s answer is to the true value. Compute the
residual, which is the program’s answer plugged into 𝑓. Are the error and residual zero?
5. Derive the Taylor series expansion for 𝑓(𝑥𝑖+1 ) = 𝑒 𝑥 sin 𝑥 using a base point at 𝑥𝑖 = 0 and
𝑥𝑖+1 = 0.2. Write a MATLAB program which takes 𝑥𝑖 as input and computes the series for up
to 10th order.
6. Use WHILE-loop to modify your script file in Q5 so that the error percentage does not exceed
0.1%.