A = B*COS(a) + C*TAN(a)
I need a formula for the angle (a) to input into an excel spreadsheet.
A, B and C are constants.
Thanks
There is an analytical method to solve a quartic, but I wouldn't waste time trying to implement it.
By far the easiest way to solve this type of equation is using a numerical technique such as Newton Raphson.
Adrian
"JBI" <jbell...@thermowebsys.com> wrote in message news:460a3cb4.01103...@posting.google.com...
Unless there's some clever transformation using trig
identities, I don't see a way to solve this in general
with a formula. You're going to have to solve it
numerically. Which unfortunately means in general
iteration an unknown number of times.
Here's one approach using what is called
fixed-point iteration.
If a is a solution to your equation, then
we can rearrange the equation to read:
a = arctan((A - B*cos(a))/C)
so long as C isn't 0.
Then the algorithm is: pick a trial value for a, then
use the above formula to calculate a new value for a:
a_new = arctan((A-B*cos(a_old))/C)
Repeat until the values stop changing (much).
This lends itself to a solution in Excel, because you
can use 5 successive columns to represent 5 successive
iterations. I found that I got good convergence with
this formula within 5 or 6 iterations for a few different
trial values.
I'm sweeping lots of numerical issues under the rug, but
I think this approach will solve your particular problem.
What about if C=0? Easy. Look at the original
equation. It becomes
A = B*cos(a).
So a = arccos(A/B). No iteration needed.
- Randy
I am not sure how spreadsheets go about solving polynomial
equations, but here is a safe method for reducing your
equation to a polynomial one - although it needs one small
decision to make.
Set tan(a/2) = t, so that, with exceptions named later,
cos(a) = (1 - t^2) / (1 + t^2),
tan(a) = 2*t / (1 - t^2)
and after a re-arrangement
(A + B)*t^4 + 2*C*t^3 - 2*B*t^2 + 2*C*t + (B - A) = 0
is the desired quartic equation. Find its roots; for every root t,
solve tan(a/2) = t.
Exceptions:
If C=0 or B=0, skip the transformation and go directly after
the original equation.
If A+B=0 (and C is not 0), we have a cubic equation; we lost
the solution for t going to infinity, which is
a = (any odd multiple of) pi,
and we have to include it as an extra.
Hope it helps, ZVK(Slavek).