zweites skript mit newton verfahren

This commit is contained in:
git-sandro 2025-12-05 15:32:22 +01:00
parent 3a997bd099
commit 8214ec7902
2 changed files with 20 additions and 2 deletions

View File

@ -6,9 +6,9 @@ except ValueError as error:
print(f"Value {error} is not a number")
quit()
n = 0
n = 1
T = math.e ** x_zero + 2 * x_zero
print(T)
while(T>10**-16):
f_a2 = math.e ** x_zero + 2
x_zero -= T/f_a2

18
newton_verfahren_10_5.py Normal file
View File

@ -0,0 +1,18 @@
import math
try:
x_zero = float(input("X0 eingeben: "))
except ValueError as error:
print(f"Value {error} is not a number")
quit()
n = 1
T = x_zero - 4 + (math.e ** (x_zero/3)/3)
print(T)
while(T!=0):
f_a2 = 1 + (math.e ** (x_zero/3)/9)
x_zero -= T/f_a2
T = x_zero - 4 + (math.e ** (x_zero/3)/3)
n += 1
print(T)
print(n)