# How to solve this equation?

The following is an error correcting equation for a sidereal astrophotography tracking mount I'm building and $t$ represents the amount of time before the tracking is off by a quarter of a stepper motor step. I need to solve for $t$, but I've having trouble solving this.

I can plot it with a value of $n$ and find an ok approximation, but the problem is that I need it for several values of $n$. Any good ways? $n$ is the integer number of corrections applied thus far. If it can't be solved in a general sense, what's a good way to generate approximate solutions for a few hundred values of $n$, starting at 0?

$$-0.25=\frac{\sqrt{2\cdot 150^2-2\cdot 150^2\cdot \cos(t\cdot 0.000072733)} - (t\cdot 0.0109170306+(n\cdot -0.25\cdot 0.005))}{0.005}$$

-
Please evaluate the constants, like 2*150^2=45000, then clear the denominator (multiply by 200) before posting. If you do that, take the second term on the right to the left and square, you get a quadratic. Do you know how to solve those? –  Ross Millikan Mar 28 '11 at 2:55
@Ross: Am I missing something? I see $t$ both inside and outside the cosine, so I would not expect an algebraic solution... –  Isaac Mar 28 '11 at 3:06
Is the cosine inside the radical supposed to be squared? Just wondering, as that would simplify the radical. –  Arturo Magidin Mar 28 '11 at 3:19
You are right, $t$ is inside the cosine, but you could still simplify as far as you can. With $t$ inside the cosine you are probably into a numeric solution instead of algebraic. Seeing the constants clearly can help-sometimes an iterative solution is appropriate, sometimes a basic root find. Also, if $t$ is small compared with 1/.00007=1.4E+4, you can use a small angle approximation. –  Ross Millikan Mar 28 '11 at 3:39
Using Mathematica to numerically approximate the solution to the original equation and numerically solve the polynomial equation resulting from using the 4th degree power series approximation for cosine, it appears that $\cos x\approx 1-\frac{x^2}{2}+\frac{x^4}{24}$ is close enough that the solution is within 0.1% for $0\le n\le 169$, 0.2% for $0\le n\le 429$. –  Isaac Mar 28 '11 at 3:40

Here are the first few values:

n=  0:  t= 174.7
n=  1:  t= 339.8
n=  2:  t= 489.7
n=  3:  t= 623.7
n=  4:  t= 743.3
n=  5:  t= 850.4
n=  6:  t= 947.2
n=  7:  t=1035.4
n=  8:  t=1116.4
n=  9:  t=1191.3
n= 10:  t=1261.0


Here's the rough source code:

Table[{n,
t /. FindRoot[-0.25 == (Sqrt[
2*150^2 -
2*150^2*Cos[
t*0.000072733]] - (t*0.0109170306 + (n*-0.25*.005)))/
0.005, {t, 200 + 150 n}]}, {n, 0, 500}]

-
Thanks! You rock. –  rfusca Mar 28 '11 at 4:44
@rfusca: You're welcome. It's probably worth some checking to make sure that the numbers are sensible, as I really did just blindly beat the problem over the head with Mathematica. –  Isaac Mar 28 '11 at 4:49
I had computed the first 12, and they line up, so I'm willing to run with it –  rfusca Mar 28 '11 at 4:52
Just an FYI for anybody looking at this, what's interesting is that from an engineering perspective this means that starting out it will need to be error corrected every few minutes but after an hour its diverging fast enough at it needs error correction every few seconds. This is an isosceles Haig mount for those interested. –  rfusca Mar 28 '11 at 4:55