Finish ps16-3
This commit is contained in:
parent
fff1d92191
commit
af9d25ffe8
@ -28,7 +28,10 @@ def cot(x):
|
||||
def func(z: float) -> float:
|
||||
first = np.sqrt((z0 / z) ** 2 - 1)
|
||||
second = cot(z)
|
||||
return first - second
|
||||
return first + second
|
||||
|
||||
|
||||
print(find_root(func, 6.2, 6.4, max_iter=1000))
|
||||
print(find_root(func, 0.1, 3, max_iter=1000))
|
||||
print(find_root(func, 3.1, 6, max_iter=1000))
|
||||
print(find_root(func, 6.1, 8, max_iter=1000))
|
||||
print(find_root(func, 10, 12, max_iter=1000))
|
||||
|
Loading…
Reference in New Issue
Block a user