cosine approximation?

Jan 06, 2007 24 Replies

What are the first four terms for a series approximation of cos (a + x) where a >> x ?


-- Many thanks,



Don Lancaster voice phone: (928)428-4073 Synergetics 3860 West First Street Box 809 Thatcher, AZ 85552 rss:

formatting link
email: snipped-for-privacy@tinaja.com



Please visit my GURU's LAIR web site at

formatting link


I'm not certain what you want. Is it perhaps just

cos(a) - sin(a)*x - cos(a)/2*x^2 + sin(a)/6*x^3 + ... ?

David

Maybe you want to first reduce the angle a+x to be between 0 and 2*pi radians and then use the usual series expansion:

cos(z) = 1 - z^2/2 + z^2/24 - z^6/720 + ...

Once you collapse it down, (i.e. 0..2*pi) wouldn't a LUT be quicker? :-)

Thanks, Rich

a >> x ?

I suppose a is a constant.So in cos(a) cos(x) - sin(a) sin(x), expand sin(x) and cos(x) in x upto four terms.

Narasimham

a >> x?

Would a situation where a=6300 pi and x=pi meet these constraints? This satisfies a >> x, but in this case, cos( 6300pi + pi ) is nowhere near cos( 6300 pi )...

Or did you mean to say pi >> x?

-- Michael Darrett, Senior Computer Resource Specialist Wireless network setup, computer upgrades and repair. Sacramento, California

formatting link

where a >> x ?

Truly awful idea.

Just use the standard method to work out the Taylor expansion about a. Yes, yes, this means taking derivatives, but this is sci.math not sci.sums.

Phil

"Home taping is killing big business profits. We left this side blank so you can help." -- Dead Kennedys, written upon the B-side of tapes of /In God We Trust, Inc./.

Could be. That or a CORDIC algorithm, depending upon the available hardware.

Since cosine is 2pi periodic, you need to explain what you mean by a>>x here. For example, if a is any multiple of 2pi, then cos (a+x) = cos (x), so by choosing an appropriate multiple of 2pi, I can always have a >> x, and just look at cos (x) instead.

for that matter, I can even have a dependant on x: a(x)=2000pi *(1+ | [[x]] | ), where [[x]] is the greatest-integer function. If you need a to be even larger, increase the coefficient of pi until it is big enough for you.

a >> x ?

That is the direction I was looking at. For very small (x), cos (x) is pretty much unity and sin(x) in radians is pretty much x.

Which degenerates to the two term Taylor expansion cos(a+x) = cos(a) - x*sin(a)

I'm trying to convert a rapidly converging Magic Sinewave solution into an instant one. More at

formatting link

cos(a) - x*sin(a) won't quite hack it.

Many thanks, Don Lancaster voice phone: (928)428-4073 Synergetics 3860 West First Street Box 809 Thatcher, AZ 85552 rss: http://www.tinaja.com/whtnu.xml email: don@tinaja.com Please visit my GURU\'s LAIR web site at http://www.tinaja.com

where a >> x ?

Hi, Phil:

I'm not clear why you think the suggestion an "awful idea".

We get the same power series expansion your way, do we not, as by Narasimham's suggestion? The advantage of the latter being that the MacLaurin series for sin,cos are probably well known enough that a calculus student can do it by inspection:

cos(a) ( 1 - x^2/2 + O(x^4) ) - sin(a) ( x - x^3/6 + O(x^5) )

= cos(a) - sin(a) x - (cos(a)/2) x^2 + (sin(a)/6) x^3 + O(x^4)

If there's something awful here, it's that Don's original assumption a >> x is not sufficient to warrant x

where a >> x ?

Everything happens in the first quadrant. Sorry I was not more specific on this.

Many thanks, Don Lancaster voice phone: (928)428-4073 Synergetics 3860 West First Street Box 809 Thatcher, AZ 85552 rss: http://www.tinaja.com/whtnu.xml email: don@tinaja.com Please visit my GURU\'s LAIR web site at http://www.tinaja.com

...

...

... I think you degenerated a term or two too far. cos(a+x) = cos(a)cos(x) - sin(a)sin(x) sin(x) = x - x^3/3! + x^5/5! - x^7/7! + ... cos(x) = 1 - x^2/2! + x^4/4! - x^6/6! + ... so cos(a+x) ~ cos(a)(1 - x^2/2 + x^4/24) - sin(a)(x - x^3/6). Whether you can drop the x^3/6 and higher terms depends on a and x. Substitute typical values of a and an extreme value of x and see if your accuracy criterion is met.

-jiw

Hi. Here's Mathematica's suggestion:

equ = Cos[a*x]; Series[equ, {x, 0, 10}]

1-(a^2*x^2)/2+(a^4*x^4)/24-(a^6*x^6)/720+(a^8*x^8)/40320-(a^10*x^10)/3628800

HTH :>)

-- Dana

It would help more if you used Cos[a+x] instead of Cos[a*x].

Dave Seaman U.S. Court of Appeals to review three issues concerning case of Mumia Abu-Jamal.

and, of course, the knowledge of cos(a+x)=cos(a)*cos(x)-sin(a)*sin (x), giving the first terms as cos(a)-x*sin(a)-(x^2/2)*cos(a)+(x^3/6)*sin(a) could help too..0

OOps! Thanks Dave! I totally missed that important detail.

Sorry. Dana

where a >> x ?

Please see responses from Chip Eastman and OP Don Lancaster.Also when x

where a >> x ?

As I misinterpreted the freedom of the variable in "expand sin(x) and cos(x)", infering "expand sin() and cos()". Thus cos(a) and sin(a), being cos(x) and sin(x) at x=a, would also be expanded, yielding noise.

Phil

"Home taping is killing big business profits. We left this side blank so you can help." -- Dead Kennedys, written upon the B-side of tapes of /In God We Trust, Inc./.

I think Taylor converges even for large x, but to get a good approx in a few terms it helps if x

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required