From: rusin@washington.math.niu.edu (Dave Rusin) Newsgroups: sci.math Subject: Re: Trig Problem Date: 27 Apr 1995 19:22:49 GMT In article <3nj3rp$7ld$1@mhadg.production.compuserve.com>, Mark Whittington <100566.3172@CompuServe.COM> wrote: >I wonder if any can help with a seemingly intractable pron^?^?^?^?^?^?^[[Dblem^R^R^R. You really need to fix that back-space key. This is how your post looked (I edited it to appear just as odd on your screen). >We need to know the maximum possible amplitude of two superimposed sine waves >of variable phase(p), amplitude(A) and angular frequency(f). > >In other words, the maximum possible amplitude (between 0 and A1+A2) of > >A1.SIN(f1.t + P1) + A2.SIN(f2.t + P2) It depends on whether the ratio f2/f1 is rational or not, but essentially the answer is A1+A2. If f2/f1 = n/m in lowest terms, then f1/m = f2/n is some number, f, say. In that case, your function looks like A1.SIN(m.u + P1) + A2.SIN(n.u + P2) where u = f.t. In this case, the function is periodic with period 2 pi (for u); you can compute the maximum for all t just by finding the maximum for u in [0, 2 pi]. There are only a finite number of local maxima here (something like n*m, I guess), so you can look for them graphically and compute them numerically. Alternatively, you can go algebraic: use the angle-addition formulas to write the above expression as a (very large) polynomial in sin(u) and cos(u) (involving A1, A2, and sin and cos of P1 and P2). Maple will expand these for you, for example. Then from cos^2(x) = 1 - sin^2(x), you can write the whole thing as a function Q1(s) + sqrt(1-s^2) Q2(s) where Q1 and Q2 are polynomials in s (=sin(u)). This should be even easier to maximize numerically, since there are no trig function-calls. If f2/f1 is irrational, then there are values of t you can choose which will make _both_ of f1.t + P1 and f2.t + P2 be as close as you like to pi/2 + 2.k.pi for some integer k (i.e. k1 or k2); thus, you can make each of the SIN terms as close to 1 as you like, giving a value for the sum close to A1+A2. Indeed, in this case the set of integer multiples (f2/f1).k is dense in the unit circle, so you can choose an integer k making this product be as close as desired to the following magic number: -(P2/2pi - 1/4) + (f2/f1) (P1/2pi - 1/4) (mod 1), say (f1/f2).k = n - (P2/2pi - 1/4) + (f2/f1) (P1/2pi - 1/4) + epsilon for some integer n and very small epsilon. Then we let t = (1/f1).( -P1 + pi/2 + 2.k.pi ), so that SIN(f1.t + P1) = SIN(pi/2) = 1. On the other hand, f2.t+P2 = (f2/f1).k.2pi + (f2/f1)(-P1+pi/2) + P2 = n.2pi + pi/2 + 2pi.epsilon so SIN(f2.t+P2) = SIN(pi/2 + 2pi.epsilon) is as close to 1 as you want. The case in which f2/f1 = n/m is rational but with m and n large resembles the case with f2/f1 irrational: the multiples (f2/f1).k will occupy m evenly-spaced points on the unit circle R/Z, so that you can get rather close to the magic number, though you can't make epsilon as small as you want even by taking large k. You can discover a relation between epsilon and k by working with rational approximations to f2/f1, for example using the continued-fraction expansion of f2/f1. dave