High precision calculation in Mathematica

In summary, the conversation discusses the difficulty of calculating the velocity of 10^20 eV cosmic rays accurately using Mathematica and Google. The speaker suggests using SetAccuracy or SetPrecision but encounters issues with both methods. They eventually figure out the correct command and also clarify that the cosmic rays in question are most likely ultra-high energy protons. The conversation also touches on the use of relativistic kinetic energy equation and the need for high precision in numerical analysis when dealing with high energy values. The speaker suggests using relevant expansions for more efficient and accurate calculations.
  • #1
brian0918
44
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
  • #2
Why don't you try subtracting c from the answer to find what Mathematica thinks the difference is?
 
  • #3
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.
 
  • #4
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
 
  • #5
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?
 
  • #6
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: 506
Last edited:
  • #7
I wonder if this necessary high precision is going to slow down numerical analysis, since everything will have to be out to ~30 decimals.
 
  • #8
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:

1. What is high precision calculation in Mathematica?

High precision calculation in Mathematica refers to the ability of the software to perform calculations with a very high level of accuracy, often up to hundreds or even thousands of digits after the decimal point. This is particularly useful in fields such as physics, engineering, and finance where precise calculations are crucial.

2. How does Mathematica achieve high precision calculation?

Mathematica uses arbitrary-precision arithmetic, which means that it can handle numbers of any size and precision. It also has built-in algorithms for error control and numerical stability, ensuring that calculations are accurate and reliable even with extremely small or large numbers.

3. Can I adjust the precision of calculations in Mathematica?

Yes, you can adjust the precision of calculations in Mathematica by using the Precision function or by specifying the number of digits after the decimal point in your input. You can also set a default precision level for all calculations in the Mathematica options menu.

4. Are there any drawbacks to using high precision calculation in Mathematica?

Using high precision calculation in Mathematica may result in slower performance compared to standard precision calculations. Additionally, it may not always be necessary to use high precision, so it's important to consider the trade-off between accuracy and speed when deciding which precision level to use.

5. Can I use high precision calculation in Mathematica for symbolic calculations?

Yes, Mathematica can perform high precision symbolic calculations as well. This is particularly useful for tasks such as solving equations or manipulating algebraic expressions with high precision. However, it's important to note that symbolic calculations may take longer to compute compared to numerical calculations.

Similar threads

Replies
1
Views
766
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
2K
  • High Energy, Nuclear, Particle Physics
Replies
8
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
3K
Replies
7
Views
740
  • Introductory Physics Homework Help
Replies
6
Views
957
  • Computing and Technology
Replies
4
Views
764
Replies
39
Views
500
  • Special and General Relativity
2
Replies
40
Views
2K
Back
Top