Giter Site home page Giter Site logo

physconsts.jl's Introduction

PhysConsts

Build Status Build status Coverage Status codecov.io

Physical Constants

Some useful constants for Julia.

NOTE There is no test for this at the moment, since most of the codes are just bindings. But I will add some unit test in the future versions.

Installation

Pkg.add("PhysConsts")

Usage

Use import to import certain constant's alias input the scope. And you can access some property by the following commands.

# import atomic unit of charge
julia> import Constants: e

julia> e.quantity
"atomic unit of charge"

julia> e.uncertainty
9.8e-28

julia> e.unit
"C"

julia> e.value
1.6021766208e-19

All the constants overload most of the interface of Number and constant types are subtypes of Number. Therefore, you can just use them like native numbers

julia> e * 2
3.2043532416e-19

julia> e + 2
2.0

A list of included constants

All constants is stored in a Dict called DATA, Constants will export this dict, you can access it by

julia> import Constants

julia> Constants.DATA

or

julia> using Constants

julia> DATA

NIST CODATA Fundamental Physical Constants

Constants will download a JSON file from NIST CODATA automatically when you install the package. All constants in this JSON file is included. This part can be access from DATA by

julia> Constants.DATA["NIST"]["YOUR CONSTANT NAME"]

e.g

julia> Constants.DATA["NIST"]["standard atmosphere"]
101325.0

Defined Constants

Some constants is defined in theory, like magnetic constant (vacuum permeability), they are also supported, currently we have:

List of Bindings

  • c: speed of light in vacuum
  • c0: speed of light in vacuum
  • G: Newtonian constant of gravitation
  • g: standard acceleration of gravity
  • h: Planck constant
  • ħ : Planck constant over 2 pi
  • e: atomic unit of charge (use eu for mathematical constant e)
  • a0 : Bohr radius
  • α : fine-structure constant
  • k: Boltzmann constant
  • NA: Avogadro constant
  • atm: standard atmosphere
  • μ0: magnetic constant (vacuum permeability)
  • ε0: electric constant (vacuum permittivity)

Author

QuantumBFS

physconsts.jl's People

Contributors

roger-luo avatar

Stargazers

 avatar

Watchers

 avatar  avatar

physconsts.jl's Issues

Info about upcoming removal of packages in the General registry

As described in https://discourse.julialang.org/t/ann-plans-for-removing-packages-that-do-not-yet-support-1-0-from-the-general-registry/ we are planning on removing packages that do not support 1.0 from the General registry. This package has been detected to not support 1.0 and is thus slated to be removed. The removal of packages from the registry will happen approximately a month after this issue is open.

To transition to the new Pkg system using Project.toml, see https://github.com/JuliaRegistries/Registrator.jl#transitioning-from-require-to-projecttoml.
To then tag a new version of the package, see https://github.com/JuliaRegistries/Registrator.jl#via-the-github-app.

If you believe this package has erroneously been detected as not supporting 1.0 or have any other questions, don't hesitate to discuss it here or in the thread linked at the top of this post.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.