Zins


import numpy as np
import matplotlib.pyplot as plt

# Parameter
x0 = 0.01          # Anfangskapital
p = 0.037         # Zinssatz
t_end = 2011           # Jahre

x = np.zeros(t_end+1)
x[0] = x0
for i in range(0, t_end):
    x[i+1] = (1 + p)  * x[i]

# Plot
plt.figure(figsize=(8, 5))
plt.plot(range(t_end+1), x , label="Vermoegen")
plt.plot([0, 2011], [5.383e29 , 5.383e29], label="Wert von Welt aus Gold")
plt.title("Zinseszins-Kurve (x=0.01, p=0.037, t=2011)")
plt.xlabel("Jahre")
plt.ylabel("Vermoegen")
plt.legend()
plt.grid(True)
plt.show()