continued with task 4

This commit is contained in:
leobr 2022-10-20 16:28:04 +02:00
parent 51163cdf1c
commit 5eb8cb5797
1 changed files with 8 additions and 3 deletions

View File

@ -14,7 +14,10 @@ def h1(x):
return
def h1_diff(x):
return (100 * x - 100) / math.sqrt(100 * math.pow(x, 2) - 200 * x + 99)
try:
return (100 * x - 100) / math.sqrt(100 * math.pow(x, 2) - 200 * x + 99)
except:
return
def h2_diff(x):
return (100 * x - 100) / math.sqrt((10*x-11)*(10*x-9))
@ -24,7 +27,10 @@ def h2(x):
def kondnumb(x):
return (np.abs(h1_diff(x)) * np.abs(x)) / np.abs(h1(x))
try:
return (np.abs(h1_diff(x)) * np.abs(x)) / np.abs(h1(x))
except:
return
def kondnumb2(x):
return (np.abs(h2_diff(x)) * np.abs(x)) / np.abs(h2(x))
@ -50,7 +56,6 @@ plt.figure()
plt.plot(x, y1, label='h1(x)')
plt.plot(x, y2, label='h2(x)')
plt.xlim(1.099, 1.101)
plt.legend()
plt.show()