continued with task 4
This commit is contained in:
parent
51163cdf1c
commit
5eb8cb5797
|
@ -14,7 +14,10 @@ def h1(x):
|
||||||
return
|
return
|
||||||
|
|
||||||
def h1_diff(x):
|
def h1_diff(x):
|
||||||
|
try:
|
||||||
return (100 * x - 100) / math.sqrt(100 * math.pow(x, 2) - 200 * x + 99)
|
return (100 * x - 100) / math.sqrt(100 * math.pow(x, 2) - 200 * x + 99)
|
||||||
|
except:
|
||||||
|
return
|
||||||
|
|
||||||
def h2_diff(x):
|
def h2_diff(x):
|
||||||
return (100 * x - 100) / math.sqrt((10*x-11)*(10*x-9))
|
return (100 * x - 100) / math.sqrt((10*x-11)*(10*x-9))
|
||||||
|
@ -24,7 +27,10 @@ def h2(x):
|
||||||
|
|
||||||
|
|
||||||
def kondnumb(x):
|
def kondnumb(x):
|
||||||
|
try:
|
||||||
return (np.abs(h1_diff(x)) * np.abs(x)) / np.abs(h1(x))
|
return (np.abs(h1_diff(x)) * np.abs(x)) / np.abs(h1(x))
|
||||||
|
except:
|
||||||
|
return
|
||||||
|
|
||||||
def kondnumb2(x):
|
def kondnumb2(x):
|
||||||
return (np.abs(h2_diff(x)) * np.abs(x)) / np.abs(h2(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, y1, label='h1(x)')
|
||||||
plt.plot(x, y2, label='h2(x)')
|
plt.plot(x, y2, label='h2(x)')
|
||||||
plt.xlim(1.099, 1.101)
|
|
||||||
|
|
||||||
plt.legend()
|
plt.legend()
|
||||||
plt.show()
|
plt.show()
|
||||||
|
|
Loading…
Reference in New Issue