Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

HELP!!!! with equation solution

9 views
Skip to first unread message

JBI

unread,
Oct 31, 2001, 4:12:08 PM10/31/01
to
I have been out of college for to many years now and I have what is
probably a simple equation to solve but I'm stumped. The CRC tables
are just not helping. I would appreciate any help on this:

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

Adrian Ferramosca

unread,
Oct 31, 2001, 5:12:42 PM10/31/01
to
Noting that TAN(a) = SIN(a) / COS(a) and SIN(a) = (1 - COS(a))^0.5,
you can rearrange this to form a quartic in COS(a)

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...

Randy Poe

unread,
Oct 31, 2001, 5:37:28 PM10/31/01
to

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

Zdislav V. Kovarik

unread,
Oct 31, 2001, 7:07:17 PM10/31/01
to
In article <460a3cb4.01103...@posting.google.com>,
JBI <jbell...@thermowebsys.com> wrote:
:I have been out of college for to many years now and I have what is

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).

0 new messages