High precision calculation in Mathematica

Click For Summary

Discussion Overview

The discussion revolves around high precision calculations in Mathematica, specifically regarding the velocity of ultra-high energy cosmic rays with an energy of 10^20 eV. Participants explore the challenges of achieving the necessary precision in their calculations and the appropriate commands to use in Mathematica.

Discussion Character

  • Technical explanation
  • Mathematical reasoning
  • Debate/contested

Main Points Raised

  • One participant reports that Mathematica and Google both yield a velocity of exactly 1*c for 10^20 eV cosmic rays, indicating a lack of precision.
  • Another participant suggests subtracting c from the calculated velocity to determine the difference, implying that this might reveal more about the precision issue.
  • A participant mentions using N, SetAccuracy, and SetPrecision with a precision of 1000 decimals, but still receives a result of zero when subtracting c, indicating a potential command usage issue.
  • One participant claims to have resolved the issue by using SetPrecision on all numbers involved in the calculation.
  • Another participant questions whether the cosmic rays are photons, suggesting they should move at the speed of light unless affected by some medium.
  • A participant clarifies that the rays are ultra-high energy cosmic rays, likely protons, and mentions using the relativistic kinetic energy equation to calculate velocity.
  • Concerns are raised about the computational efficiency of maintaining high precision in numerical analysis, particularly when dealing with high energy values.
  • One participant proposes using relevant expansions for calculations, suggesting that this approach could provide sufficient accuracy without the need for excessive decimal precision.

Areas of Agreement / Disagreement

Participants express differing views on the necessity of high precision in calculations and the best methods to achieve it. There is no consensus on the optimal approach or the implications of precision on numerical efficiency.

Contextual Notes

Participants discuss the limitations of Mathematica's commands and the implications of using high precision in calculations, but do not resolve the underlying assumptions or the effectiveness of different methods.

brian0918
Messages
44
Reaction score
0
I'm trying to calculate the velocity of 10^20 eV cosmic rays, but the precision in Mathematica and Google is not high enough: both give velocities of exactly 1*c.

I've tried putting SetAccuracy[...,1000] around all the constants and the final result, and it still doesn't work. It now gives 1.0000000000000...000*c


I know Mathematica can do this, so what is the proper command?


Thanks.
 
Physics news on Phys.org
Why don't you try subtracting c from the answer to find what Mathematica thinks the difference is?
 
Well, I've tried N, SetAccuracy, and SetPrecision. For a precision of 1000 decimals, I subtracted c (which also has a precision of 1000 decimals) and it got zero out to all the digits.

I'm pretty sure I'm just not using the correct command, since I've had this problem before and figured out what to do.
 
Nevermind, I figured it out. You have to use SetPrecision on basically every number.


Oh, and for the record, 10^20 eV corresponds to 0.99999999999999999999995598228313196044005099389886244069748671131566319262949728462461319064015929690c
 
hmm, aren't those rays photons? aren't they supposed to move at the speed of light? or are they propagating through some medium or otherwise interacting in a way that would slow them down?
 
No, they're ultra-high energy cosmic rays (most likely protons). I'm using the relativistic kinetic energy equation to get the velocity:
 

Attachments

  • keneticenergy.jpg
    keneticenergy.jpg
    2.4 KB · Views: 589
Last edited:
I wonder if this necessary high precision is going to slow down numerical analysis, since everything will have to be out to ~30 decimals.
 
It's not numerically efficient to deal directly with v/c when energy is very high. You should get into the habit of using the relevant expansions. So for example,
[tex]\gamma={1\over\sqrt{1-\beta^2}}[/tex]
where [itex]\gamma=\mbox{Energy}/(mc^2)[/itex], and [itex]\beta=v/c[/itex]. Then
[tex]\beta=\sqrt{1-1/\gamma^2}\approx 1-{1\over 2\gamma^2}[/tex]
This gives you easily sufficient accuracy, and is very fast.
 
Last edited:

Similar threads

  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 13 ·
Replies
13
Views
4K
Replies
1
Views
2K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 7 ·
Replies
7
Views
4K
  • · Replies 0 ·
Replies
0
Views
4K
  • · Replies 8 ·
Replies
8
Views
2K
  • · Replies 17 ·
Replies
17
Views
3K