I need to get the solutions of the following trigonometric equation:
I know there exists either M or M-1 solutions depending on the value of $\Delta$. Does anyone know of any module or algorithm that I can use in Python for this task?
I've tried this way but it is very sensitive to the tolerance and it doesn't work:
def f(k, N, d):
return np.tan(k*(N)) - d*np.sin(k)/(1+d*np.cos(k))
k = np.linspace(0, np.pi, 10000+1, endpoint=False)[1:]
def ksolutions(k,N,d):
solutions=[]
tol=4*1e-4
for i in k:
if abs(f(i,N,d))<tol:
solutions.append(i)
print(solutions)