# ODE Event detection for calculating multiple roots of continuous sinusoidal equation

Hey everyone I have a paper that has a method for computing rise and set times of a satellite given a closed form solution. It is a complicated sinusoidal function and the paper has a method to calculate a single rise set over a single period using newton rhapson method. I want to find a way to calculate all zeros over a given interval of time.

Here is the equation Here is a picture of one of the initial intervals of the plot I now newton approach will work given a good inital guess. My first thought was to create a loop and when it finds a zero to move forward to another set, but I find it hard to believe there is not a method already developed.

I have come across ode event detection in MATLAB, or a lot of other solutions that seem to be for polynomials but wanted to see if there were better approaches a

Here is a link to the paper https://arc.aiaa.org/doi/abs/10.2514/3.2057

• Do you know the approximate interval of your roots? If yes, I would give you a simple bisection method that worked really well for me in finding the roots of Confluent Hypergeometric function. – Alone Programmer Oct 4 '19 at 20:20
• @AloneProgrammer : Proposing bisection to find roots is similar to proposing bubblesort as a simple and reliable method to sort long lists. Use better bracketing methods, like regula falsi (illinois, which is also very simple to program and reasonably fast), Dekker's fzeroin, Muller's inverse quadratic interpolation or, combining most of the features of the previous methods, Brent's method. – Lutz Lehmann Oct 6 '19 at 6:27
• @LutzL Method you mentioned have issues for convergence, accuracy, etc. But, bisection method is the only one that guarantees that if there is only one root in [a,b] range it will find it for 100% sure. I’ll be really grateful if you could bring an example that there is one root for a function in [a,b] range but bisection can’t find it. For finding multiple roots, you need to know the intervals of the roots to isolate each root in a given range and then use bisection to find it and for finding the all of them you need to just traverse the range and make sure there is one root in each interval. – Alone Programmer Oct 6 '19 at 13:18
• @AloneProgrammer : The mentioned methods are all bracketing methods, which means they all keep an ever shrinking interval containing a sign change (and thus root) of the function. This is the same guarantee that the bisection method gives. Under the same starting conditions, all these methods are faster than bisection at finding a root, except in very constructed cases where the speed reduces to about the bisection case. – Lutz Lehmann Oct 6 '19 at 14:18
• None of these methods seem to answer the key question of automating the process over continuous intervals with multiple roots. The process of root finding for single root over a defined interval is well studied, as you all have pointed out with many robust algorithms – S moran Oct 7 '19 at 16:49