Sum of cosines

Discussion in 'Maple' started by I.N. Galidakis, Jan 28, 2010.

  1. I have a sum of cosines with different arguments and I need to combine them so I
    can estimate the period. Can this be done with Maple 9?

    I think this question has been asked before, but I cannot find it in Google.

    For example, can I combine the following into the form cos(A+B+C+...+W)?

    cos(9.519977738*t)+cos(4.146902303*t)+cos(18.84955592*t)+cos(2.094395103*t)+cos(
    ..3141592654e16*t)+cos(471.2388981*t)+cos(314.1592654*t)

    Thanks,
     
    I.N. Galidakis, Jan 28, 2010
    #1
    1. Advertisements

  2. I.N. Galidakis

    Archimedes Guest

    This "works" in Maple 9.5, but if you increase Digits to a higher
    value, it does not work(not a simpler version than what you started
    with). Check the accuracy to make sure it is acceptable for your
    needs. For values of `t` greater than what I plotted, you can not see
    the difference.
    This yields: cos(.3141592654e16*t)+6.
     
    Archimedes, Jan 29, 2010
    #2
    1. Advertisements

  3. Thanks. It works on Maple 9 :)
     
    I.N. Galidakis, Jan 29, 2010
    #3
  4. I assume these frequencies are not supposed to be exact, but rather are
    approximations to rational multiples of Pi. That makes a big difference.

    Interestingly, identify can handle all the frequencies except one that is
    most obvious to the eye:
    +cos(2.094395103*t)+cos(.3141592654e16*t)+cos(471.2388981*t)
    +cos(314.1592654*t);

    cos(100/33*Pi*t)+cos(33/25*Pi*t)+cos(6*Pi*t)+cos(2/3*Pi*t)
    +cos(.3141592654e16*t)+cos(150*Pi*t)+cos(100*Pi*t)

    So it looks like the periods of the different cosine terms are
    33/50, 50/33, 1/3, 3, 1/500000000000000, 1/75 and 1/50. Put over
    a common denominator 16500000000000000, the numerators are
    10890000000000000, 25000000000000000, 5500000000000000, 49500000000000000,
    33, 220000000000000, 330000000000000
    which have least common multiple 27225000000000000000.
    Thus the minimal period is 27225000000000000000/16500000000000000
    = 1650.
     
    Robert Israel, Jan 29, 2010
    #4
  5. Yes, that's what they are. Or rather, what they were, when I was trying to
    figure out a minimum period of the phasor:

    p(t)=sum(exp(2*Pi*i*N_j*t),j=1..7)

    Unfortunately, it seems that any oscillator vibrating at N_j, vibrates also at
    all the harmonics, so the phasor is really:

    q(t)=sum(sum(exp(2*Pi*i*k*N_j*t),j=1..7),k=1..oo)


    (which is, I think, 7 separate Fourier series added together)

    Please see my reply to Arturo on sci.math.

    Thanks,
     
    I.N. Galidakis, Jan 29, 2010
    #5
  6. Robert,

    It doesn't look like it's working. I get with Maple 9:
    with N[j] loaded with the aforementioned values:

    N[1]:=33/50;
    N[2]:=50/33;
    N[3]:=1/3;
    N[4]:=3;
    N[5]:=5*10^14;
    N[6]:=75;
    N[7]:=50;

    and then:

    evalf(fs(0.2)),evalf(fs(0.2+1650));

    3.438304986+1.671248677*I, 2.223885744+2.474913511*I

    What am I doing wrong?
     
    I.N. Galidakis, Jan 30, 2010
    #6
  7. I.N. Galidakis

    Axel Vogt Guest

    Just tested with Maple 9.52 and it works (even if using
    only Digits=10). Have you tried after a restart?
     
    Axel Vogt, Jan 30, 2010
    #7
  8. Looks like it's an accuracy issue. I increased Digits:=50 and it works. For some
    reason it doesn't work with the default number of digits.

    Thanks,
     
    I.N. Galidakis, Jan 30, 2010
    #8
  9. I.N. Galidakis

    Axel Vogt Guest

    May the versions work a bit different. Might it be that later versions
    for evalf( f(t) ) try a simplification first and take floats later?

    If you use 2/10 instead of 0.2 then you should see, that both terms
    are equal.
     
    Axel Vogt, Jan 30, 2010
    #9
  10. Yes, it does! The problem seems to be that I had on my worksheet:

    N[1]:=1/0.66;, instead of N[1]:=100/66;

    and this affects N[2] as well. Then the arguments in the phasor are a bunch of
    floats. If I use fractions instead, Maple puts fractions on the phasor and then
    it works, if I also have 2/10 for 0.2.

    The world of floating point is strange indeed! Try it with N[1]:=1/0.66,
    N[2]:=1/N[1] and see what you get on

    evalf(fs(0.2)),evalf(fs(0.2+1650));

    Thanks Alex,
     
    I.N. Galidakis, Jan 30, 2010
    #10
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.