Figure 8.6:

Convergence of different sequences as a function of k.

Figure 8.6

Code for Figure 8.6

Text of the GNU GPL.

main.py


 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
# [makes] Convergence_Rates.mat
#
import numpy as np
from scipy.io import savemat
import scipy.special

k = np.arange(1, 51)
z1 = 0.99**k
z2 = (0.5)**k
z3 = 1 / scipy.special.factorial(k)
z4 = (0.5)**(2.0**k)

savemat('Convergence_Rates.mat', {'k': k, 'z1': z1, 'z2': z2, 'z3': z3, 'z4': z4})