I’m writing a program in python and in it I need to find the roots of a function that is:
a*x^n + b*x -c = 0
where a and b are constants that are calculated earlier in the program but there are several thousand of them.
I need to repeat this equation twice for all values of a and b once with n = 77/27 and once with n = 3.
How can i do this in python?
I checked numpy.roots(p) and that would work for when n = 3 I think. But for n = 77/27 how would I be able to do that?
I think your beast choice is
scipy.optimize.brentq():prints