ich sitze schon seid einiger Zeit und versuche, so dachte ich ein einfaches Problem mittels Python zu lösen.
Es geht um die Reihendarstellung der Funktion exp(-x).
Mein Code sieht wie folgt aus
Code: Alles auswählen
import numpy as np
import scipy as sp
import csv
from scipy import integrate
from scipy.integrate import quad
import sys
print sys.float_info.max_10_exp
from decimal import *
from pylab import *
import pylab as pl
import matplotlib.pyplot as plt
from scipy.optimize.minpack import curve_fit
R=1.0e15
d=1.2e25
q=1e-4
a=np.pi**2.0/700.0
alpha=1.5
n=2
x=10.0
xlow=10.0
E0=1000.0
sum=0.0
for k in range(101):
g=math.factorial(k)*(k+1)
b=-a*n**2
sum+=(-1.0)**k*(x)**k/math.factorial(k)
print sum, math.exp(-10)
Ich habe einiges probiert, komme allerdings nicht weiter und hoffe, dass ihr eine Idee habt
Für jegliche Hilfe bin ich sehr dankbar
Grüße