Group Abstract Group Abstract

Message Boards Message Boards

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

Example from Guide to Modern Physics ... cannot successfully input

Posted 1 hour ago

I’m having some startup difficulty with the first example in Guide to Modern Physics (James W. Rohlf). The book has all the right topics but I cannot enter the examples successfully.

I am running Mathematica 14.3 on a Mac Book Pro with M5 Pro, OS Tahoe and 24 GB of memory. The file myFile.nb shows what I typed. Notice that the N[UnitConvert[e, C],4] does not give the expected answer. I am not sure what to type for e. If I use the Basic Math Paclet, e is that transcendental number, not the ElementaryCharge definition. I can get the correct answer with a copy/paste from the original Quantity definition. But notice that I copied 1 C, not just C.

Quantity["ElementaryCharge"]

returns e

Quantity["Coulambs"]

returns 1 C

N[UnitConvert[e,C]

returns UnitConvert[e,1 C],4]

N[UnitConvert[e,1 C],4]

returns 1.602 x 10-19

Then I went on Rohlf’s site and bought the files that contain the example Mathmatica code. They were not what I expected. It was just the code without any further explanation. I want to be able to type the code in, not use copy/paste.But if I copy/paste the code from this file, it works fine. And yes, the e is in italic, indicating it is the definition of ElementaryCharge. I don’t know how to input that number.

Because I bought the file from Rohlf, I don't think it is appropriate to include it. I may be breaking some copyright rule by posting a file that I bought in a forum. When I copy/paste I get

N[UnitConvert[e,C],4]

returns 1.602 x 10-19

I can also get the example to work by explicitly using Quantity to define ElementaryCharge and Coulambs, but that’s not what th example does.

N[UnitConvert[Quantity["ElementaryCharge"],Quantity["Coulombs"]],4

returns 1.602 x 10-19

So I don't know how to run this example the way that the book does. This is just the first example and I fear I may experience the same problem with the others. What am I doing wrong?

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