Compare commits
No commits in common. "e108ba6f087154cb9c4a4613eda1b1515efa5e16" and "1d49cdbaf6dfb210022a769271810e9cf32f4b47" have entirely different histories.
e108ba6f08
...
1d49cdbaf6
|
@ -2,28 +2,14 @@ import numpy as np
|
||||||
import matplotlib.pyplot as plt
|
import matplotlib.pyplot as plt
|
||||||
import math
|
import math
|
||||||
|
|
||||||
def h1(x):
|
def h(x):
|
||||||
return math.sqrt(100 * math.pow(x,2) - 200 * x + 99)
|
return math.sqrt(100 * math.pow(x,2) - 200 * x + 99)
|
||||||
|
xStart = 1.1
|
||||||
def h2(x):
|
|
||||||
return math.sqrt((10 * x - 9) * (10 * x - 11))
|
|
||||||
|
|
||||||
xStep = math.pow(10,-7)
|
|
||||||
xStart = 1.1 + xStep
|
|
||||||
xStop = 1.31
|
xStop = 1.31
|
||||||
|
xStep = math.pow(10,-7)
|
||||||
|
|
||||||
x = np.arange(xStart,xStop + xStep,xStep)
|
x = np.arange(xStart,xStop + xStep,xStep)
|
||||||
y1 = [h1(x_val) for x_val in x]
|
y = [h(x_val) for x_val in x]
|
||||||
y2 = [h2(x_val) for x_val in x]
|
|
||||||
|
|
||||||
plt.plot(x, y1, label='h1(x)')
|
plt.plot(x,y, label='h(x)')
|
||||||
plt.plot(x, y2, label='h2(x)')
|
|
||||||
plt.xscale('log', base=10)
|
|
||||||
plt.legend()
|
|
||||||
plt.show()
|
plt.show()
|
||||||
|
|
||||||
# Aufgabe 4a)
|
|
||||||
# Da die Operation nicht gut konditioniert ist, erhält man für den Ausdruck inder Wurzel
|
|
||||||
# bei x = 1.1, -1.4e-14
|
|
||||||
# Somit kann die Wurzel für diesen x Werte nicht berechnet werden.
|
|
Loading…
Reference in New Issue