$$\frac{d^2r}{dt^2}-r\left(\frac{d\phi}{dt}\right)^2=G\cos\alpha-g\frac{R^2}{r^2}$$ $$r\frac{d^2\phi}{dt^2}+2\frac{dr}{dt}\frac{d\phi}{dt}=G\sin\alpha$$
The two ODE's above are given. I have written them as 4 ODE's of degree one and solved the equation with ODE45.
I've plotted the graph and now I want to find where the equation intersects with the horizontal line $y=1$. I want to use the secant method becuase then i do not have to calculate the derivative of my equation. Normally I would just take: "my equation" = 1, but how do I do it in this case when I got two equations?
Thanks
Try this. (You will need to subtract 1 from your vector, because the function finds the zero crossing.index is supposed to be t vector in your case)
I have written a few functions that find the index of min/max in a vector, finds the index of a value in a vector etc. Matlab doesn't seem to have a default function for things. Or maybe I didn't look hard enough.