How to find all zeros of a function using numpy (and scipy)?

前端 未结 4 665
忘掉有多难
忘掉有多难 2020-12-16 04:35

Suppose I have a function f(x) defined between a and b. This function can have many zeros, but also many asymptotes. I need to retriev

4条回答
  •  我在风中等你
    2020-12-16 04:48

    I've also encountered this problem to solve equations like f(z)=0 where f was an holomorphic function. I wanted to be sure not to miss any zero and finally developed an algorithm which is based on the argument principle.

    It helps to find the exact number of zeros lying in a complex domain. Once you know the number of zeros, it is easier to find them. There are however two concerns which must be taken into account :

    • Take care about multiplicity : when solving (z-1)^2 = 0, you'll get two zeros as z=1 is counting twice
    • If the function is meromorphic (thus contains poles), each pole reduce the number of zero and break the attempt to count them.

提交回复
热议问题