First time here? Check out the FAQ!

Ask Your Question
1

More physics constants in Sagemath

asked 5 years ago

John Bao gravatar image

updated 5 years ago

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.

Preview: (hide)

1 Answer

Sort by » oldest newest most voted
2

answered 5 years ago

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
Preview: (hide)
link

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: 5 years ago

Seen: 513 times

Last updated: Sep 13 '19