Ask Your Question
1

More physics constants in Sagemath

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

John Bao gravatar image

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

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 https://docs.scipy.org/doc/scipy/refe...

Thanks for help.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

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

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
9.274009994e-24
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

Stats

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

Seen: 489 times

Last updated: Sep 13 '19