Ask Your Question

More physics constants in Sagemath

asked 2019-09-13 11:31:37 +0200

John Bao gravatar image

updated 2019-09-13 11:34:31 +0200

I can you following command to load physics constants h and c:

 from scipy.constants import  h, c
 h, c   # show value of h and c

But, how can I load more physics constants such as Bohr magneton? Following command doesn't work,

 from scipy.constants import  Bohr magneton
 Bohr magneton   # to show Bohr magneton

I load physics constant from

Thanks for help.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2019-09-13 12:33:21 +0200

tmonteil gravatar image

As explained in the doc you provided, this constant appears in the constant database, so you can do:

sage: from scipy.constants import physical_constants
sage: physical_constants["Bohr magneton"]
(9.274009994e-24, 'J T^-1', 5.7e-32)

So you can do something like:

sage: Bohr = physical_constants["Bohr magneton"][0]
sage: Bohr
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2019-09-13 11:31:37 +0200

Seen: 448 times

Last updated: Sep 13 '19