Message Boards Message Boards

0
|
2474 Views
|
4 Replies
|
0 Total Likes
View groups...
Share
Share this post:

Numeric Precision in Scientific Calculation

Posted 3 years ago

Am trying to do the following calculation of the frequency of Hydrogen's Balmer Alpha line:

(mass of electron)*(mass of deuteron)/((mass of electron)+(mass of deuteron))*(velocity of light)^2*(sqrt(1-(fine structure constant)^2/9)-sqrt(1-(fine structure constant)^2/4))/(Planck constant)

It works ok but I can't then enclose it in a construct of the form N[ .... , 9] to obtain 9 digit precision. If I take a part of the calculation - say:

(mass of electron)*(mass of deuteron)/((mass of electron)+(mass of deuteron))*(velocity of light)^2

I can use the N[..., 9] construct. However once the square root section is added, the precision construct fails ??

Any ideas why this would be happening ?

POSTED BY: Neil Parker
4 Replies
Posted 3 years ago

It is possible that what you are seeing may be a line length limit in WolframAlpha. I have seen that in the past. I have used a trick to overcome problems exactly like this.

If I cut your query in half and start with

N[(mass of electron)*(mass of deuteron)/((mass of electron)+(mass of deuteron))*(velocity of light)^2,9]

that seems to instantly correctly give me the nine digits.

Then I tap on a few of the tabs and copy the plain text of that nine digit result into the clipboard and from that I put it into a tiny text file.

Then I take the second half of your problem like this

N[(sqrt(1-(fine structure constant)^2/9)-sqrt(1-(fine structure constant)^2/4))/(Planck constant),9]

and I intend to get the next nine digits, copy that to the clipboard, append an "*" and those nine digits to the file and then paste the entire (twenty character) file back into Wolfram Alpha to get the resulting nine digit answer..

Unfortunately there seems to be some objection to giving me the nine digits for that second query, something to do with that use of the Planck constant.

I don't know, but I suppose it isn't completely impossible that this Planck constant objection might be behind why you couldn't get the result in one step when you tried it. Have to do some experimenting and see if that uncovers the real reason you couldn't get your nine digits.

Hopefully this will be enough of a hint that you can use this cheap trick and track that problem down and resolve it.

POSTED BY: Bill Nelson

Thanks very much - have implemented your strategy obtaining the following result in reciprocal cm:

1.523721587. × 10^4 /cm

The measured value:

15237.21538 cm-1

Not too shabby!

POSTED BY: Neil Parker
Posted 3 years ago

Most likely because in WL, Sqrt, not sqrt.

POSTED BY: Rohit Namjoshi

Thanks - WA is now interpreting the request correctly. But still not giving me nine digit precision for some reason:

9 digit precision ?

POSTED BY: Neil Parker
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract