Results 1 to 12 of 12

Math Help - My hardware and software fails to calculate this.

  1. #1
    Newbie
    Joined
    Jul 2009
    Posts
    18

    Lightbulb My hardware and software fails to calculate this.

    Clock A has a frequency of 10MHz. It has a stability of 2*10^-11.
    Clock B has a frequency of 10MHz. It has perfect stability, and does not drift. This is our reference.

    The clocks are synchronized, and triggered simultaneously.

    How many years before clock A has become asynchronous by 10MHz relative to clock B?

    The problem is that my software (MS Excel) and calculator cannot calculate this. MS Excel rounds the number when dealing with 2*10^-11, and my calculator overflows.

    I was hoping somebody whom has the tools to do it can do this calculation. I am getting pretty frustrated trying to convert to pHz and uHz and all sorts to try to prevent the rounding of the numbers in Excel.

    Thank you for your time.

    Kind regards,
    Marius
    Last edited by mr fantastic; January 16th 2012 at 03:35 PM. Reason: Title.
    Follow Math Help Forum on Facebook and Google+

  2. #2
    Super Member Bacterius's Avatar
    Joined
    Nov 2009
    From
    Wellington
    Posts
    927

    Re: My hardware and software fails to calculate this. Help!

    Did you try WolframAlpha? It has infinite precision for all practical purposes, and it's a great tool for those tricky calculations that are at the edge of numerical stability on standard software.

    Example, type in "sqrt(2 * 10^-11)" and it will give you the right approximation to any accuracy you like (by clicking "more digits").
    Follow Math Help Forum on Facebook and Google+

  3. #3
    Grand Panjandrum
    Joined
    Nov 2005
    From
    someplace
    Posts
    14,972
    Thanks
    4

    Re: My hardware and software fails to calculate this. Help!

    Quote Originally Posted by king.oslo View Post
    Clock A has a frequency of 10MHz. It has a stability of 2*10^-11.
    Clock B has a frequency of 10MHz. It has perfect stability, and does not drift. This is our reference.

    The clocks are synchronized, and triggered simultaneously.

    How many years before clock A has become asynchronous by 10MHz relative to clock B?

    The problem is that my software (MS Excel) and calculator cannot calculate this. MS Excel rounds the number when dealing with 2*10^-11, and my calculator overflows.

    I was hoping somebody whom has the tools to do it can do this calculation. I am getting pretty frustrated trying to convert to pHz and uHz and all sorts to try to prevent the rounding of the numbers in Excel.

    Thank you for your time.

    Kind regards,
    Marius
    I doubt Excel has any trouble representing and manipulating these numbers, there is a difference between the display precision and the internal precision/accuracy. Reformat your cells to use scentific notation and 15 decimal places.

    Also what exactly do you mean by stability here?

    CB
    Follow Math Help Forum on Facebook and Google+

  4. #4
    Newbie
    Joined
    Jul 2009
    Posts
    18

    Re: My hardware and software fails to calculate this. Help!

    Quote Originally Posted by CaptainBlack View Post
    I doubt Excel has any trouble representing and manipulating these numbers, there is a difference between the display precision and the internal precision/accuracy. Reformat your cells to use scentific notation and give 15 decimal places.

    Also what exactly do you mean by stability here?

    CB
    Stability. The maximium deviation from the year before.

    Excel can display 30 decimal places. This is not the problem. The problem is that excel round my numbers.M
    Follow Math Help Forum on Facebook and Google+

  5. #5
    Grand Panjandrum
    Joined
    Nov 2005
    From
    someplace
    Posts
    14,972
    Thanks
    4

    Re: My hardware and software fails to calculate this. Help!

    Quote Originally Posted by king.oslo View Post
    Stability. The maximum deviation from the year before.

    Excel can display 30 decimal places. This is not the problem. The problem is that excel round my numbers.M
    What calculation are you asking it to make?

    (Excel operates with double precision floating point which has ~15 digits of precision and with exponents upto ~+/-500)

    CB
    Follow Math Help Forum on Facebook and Google+

  6. #6
    Newbie
    Joined
    Jul 2009
    Posts
    18

    Re: My hardware and software fails to calculate this. Help!

    Quote Originally Posted by CaptainBlack View Post
    What calculation are you asking it to make?

    (Excel operates with double precision floating point which has ~15 digits of precision and with exponents upto ~+/-500)

    CB
    I post my excel document for your evaluation.

    As you can see, Clock A speed relative to Clock B (+-Hz) at the end of year 2 is given as 10 000 000.000400000000000000000000000000. I expected it to be 10000000.000400000000004.

    If the result is 10 000 000.000400000000000000000000000000, as excel appears to suggest, then I expect it to calculate 10 000 000.000200000000000000000000000000 - 10 000 000 to .0002, rather than 0.000199999660253525.

    Quote Originally Posted by Bacterius View Post
    Did you try WolframAlpha? It has infinite precision for all practical purposes, and it's a great tool for those tricky calculations that are at the edge of numerical stability on standard software.

    Example, type in "sqrt(2 * 10^-11)" and it will give you the right approximation to any accuracy you like (by clicking "more digits").
    I tried it first time today. It looks alright, I think. Thank you for that.

    I am unsure how to enter my question as an equation, so I tried using excel and my calculator to work it out practically. See the attachment, and you understand what I mean.

    Thanks.

    Marius
    Attached Files Attached Files
    Follow Math Help Forum on Facebook and Google+

  7. #7
    Super Member Bacterius's Avatar
    Joined
    Nov 2009
    From
    Wellington
    Posts
    927

    Re: My hardware and software fails to calculate this. Help!

    then I expect it to calculate 10 000 000.000200000000000000000000000000 - 10 000 000 to .0002, rather than 0.000199999660253525.
    This is not going to happen on Excel because of how floating-point arithmetic works. Since it's in binary, and on a limited number of bits, approximations have to be made for most reals, which is the reason you will get this kind of unintuitive answer. To be able to handle this kind of calculation you will need an arbitrary precision calculator (such as WolframAlpha). Or, you could of course deal with it and accept that 0.0001999999.... is equal to 0.0002, but this may not be acceptable if you intend to do more calculations with this result because the initially tiny error could quickly cascade into a huge error (because of nonlinear feedback).
    Follow Math Help Forum on Facebook and Google+

  8. #8
    Newbie
    Joined
    Jul 2009
    Posts
    18

    Re: My hardware and software fails to calculate this. Help!

    How is my question formulated so that Wolfram Alpha can find how many years which must pass before clock A has drifted one second (10MHz) relative to clock B, like I attempted with my excel calculations?
    Last edited by king.oslo; January 17th 2012 at 01:34 AM. Reason: Correcting typing error.
    Follow Math Help Forum on Facebook and Google+

  9. #9
    Super Member Bacterius's Avatar
    Joined
    Nov 2009
    From
    Wellington
    Posts
    927

    Re: My hardware and software fails to calculate this. Help!

    You are right, it is an iterative method which would be difficult and time-consuming to feed to Wolfram Alpha, so it's probably not the best option.

    However observing your spreadsheet, the actual process you are going through to calculate the final relative clock positions is:

    RESULT = 0
    for i going from 1 to 1936, RESULT = RESULT + (10000000 + 0.0002 * i - 10000000)

    (if that makes sense)
    Which actually simplifies to:

    RESULT = 0
    for i going from 1 to 1936, RESULT = RESULT + 0.002 * i

    This is a simple sum which can be fed into Wolfram Alpha (don't think I have an obsession with it, it's just very useful!), and the result comes up as 375.0032. Compare it against the result obtained from Excel (which is incorrect btw): 375.002562969923.

    Now that you know the actual sum to obtain your result, it should be fairly easy to find the amount of years needed for the clocks to drift 1 second apart.
    Follow Math Help Forum on Facebook and Google+

  10. #10
    Grand Panjandrum
    Joined
    Nov 2005
    From
    someplace
    Posts
    14,972
    Thanks
    4

    Re: My hardware and software fails to calculate this. Help!

    Quote Originally Posted by king.oslo View Post
    I post my excel document for your evaluation.

    As you can see, Clock A speed relative to Clock B (+-Hz) at the end of year 2 is given as 10 000 000.000400000000000000000000000000. I expected it to be 10000000.000400000000004.

    If the result is 10 000 000.000400000000000000000000000000, as excel appears to suggest, then I expect it to calculate 10 000 000.000200000000000000000000000000 - 10 000 000 to .0002, rather than 0.000199999660253525.
    That looks plausible given that you only have ~15 significant digits in your calculations.

    But why are you trying to do this numerically?

    You appear to have a model for the frequency of clock A:

     \frac{df_A}{dt}=\rho f_A(t)

    which integrates up to:

     f_A(t)=f_A(0) e^{\rho t}

    and so if the rate after 1 year is 2\times 10^{-11} the rate at the start we have:

     \rho \approx 2.000000165461 \times 10^{-11}

    Column D then appears to be:

     D(t)=\int_0^t (f_A(t)-f_B)\; dt

    which for \rho t \ll 1 may be approximated as

     D(t) \approx f_B \frac{\rho t^2}{2}

    Also, and I might be mistaken here, but you appear to be confusing seconds and years in the spreadsheet, in particular in column D.

    CB
    Last edited by CaptainBlack; January 17th 2012 at 03:52 AM.
    Follow Math Help Forum on Facebook and Google+

  11. #11
    Newbie
    Joined
    Jul 2009
    Posts
    18

    Re: My hardware and software fails to calculate this. Help!

    Quote Originally Posted by CaptainBlack View Post
    That looks plausible given that you only have ~15 significant digits in your calculations.

    But why are you trying to do this numerically.

    CB
    Because I am lack knowledge of maths required to do it in any other way.M
    Follow Math Help Forum on Facebook and Google+

  12. #12
    Newbie
    Joined
    Jul 2009
    Posts
    18

    Re: My hardware and software fails to calculate this.

    Inspired by Captain Black and Bacterius, I gave it some more effort.

    First let me explain some of the changes. When looking up the datasheet for the clock, i found that the stability over 1 year was not 2E-11, but actually 2E-9! I also changed the value from 10 000 000Hz to 10MHz (because It looked more promising whilst playing with the numbers). Please look at what I came up with:

     D(t)=\int_0^t (10MHz*1.000000002^t)-(10MHz)\; dt

    And after 223610 years:

    definite integral - Wolfram|Alpha

    My interpretation: that after 223610 years, clock A (starting at 10MHz) will have drifted maximum +-10MHz (1 second) from clock B which also has a frequency of 10MHz.

    Do you agree?

    Thanks so much.

    Kind regards,
    Marius
    Last edited by king.oslo; January 17th 2012 at 07:06 AM. Reason: Typing error
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. Mathematica fails opening a .nb-file
    Posted in the Math Software Forum
    Replies: 2
    Last Post: February 17th 2011, 11:49 AM
  2. Replies: 1
    Last Post: September 6th 2010, 04:23 PM
  3. Proving the ratio test fails.
    Posted in the Differential Geometry Forum
    Replies: 1
    Last Post: October 12th 2009, 05:31 PM
  4. Software to calculate integrals numerically
    Posted in the Calculus Forum
    Replies: 9
    Last Post: January 8th 2009, 08:56 AM
  5. [SOLVED] Limit when Hopital's rule fails
    Posted in the Calculus Forum
    Replies: 4
    Last Post: July 3rd 2008, 04:21 AM

Search Tags


/mathhelpforum @mathhelpforum