-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
75 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,50 @@ | ||
# AtomicAndPhysicalConstants.jl | ||
|
||
`AtomicAndPhysicalConstants.jl` provides a quick way to store informations about different atomic species and other physical constants | ||
`AtomicAndPhysicalConstants.jl` provides a quick way to access information about different species and physical constants. | ||
|
||
It is designed to provide atomic and physical constants including things like the speed of light, subatomic particle properties, atomic isotope properties, etc. | ||
|
||
Values are obtained from CODATA (Committee on Data of the International Science Council), NIST (National Institute of Standards and Technology), and PDG (Particle Data Group). This package enables users to access and customize units for the constants. | ||
|
||
The package is compatible with Julia's `Unitful.jl` library for convenient unit manipulation. | ||
|
||
`AtomicAndPhysicalConstants.jl` has the following main features and advantages: | ||
|
||
1. **Simple Unit Manipulation**: Users can define the units they want to use in a simple and consistent way. `Unitful.jl` provides a simple way to do unit conversion and calculations. | ||
2. **Rigorous and Up-to-Date Data**: We uses the most updated values from creditable sources. We also provided the option to use past data for specific purposes. | ||
3. **Simple usage**: Users can access data of a wide range of particles and physic constants by simply defining a species with their name or call a variable in the namespace. | ||
|
||
## Setup | ||
## Basic Usage | ||
|
||
### Defining Physical Constants | ||
|
||
The macro `@APCdef` helps you define a set of useful physical constants in your namespace. | ||
|
||
```julia | ||
julia> @APCdef | ||
julia> C_LIGHT | ||
2.99792458e8 | ||
``` | ||
|
||
Users have the options for choosing the type and unit of the constants, see [this page](units.md) | ||
|
||
### Defining Species | ||
|
||
The constructor `Species()` helps you create a structure with all the information of the species stored in it. | ||
|
||
```julia | ||
julia> e = Species("electron") | ||
julia> hydrogen = Species("H") | ||
``` | ||
|
||
You could use getter functions to access its properties or directly calling its fields. | ||
|
||
```julia | ||
julia> massof(e) | ||
510998.95069 | ||
julia> hydrogen.spin | ||
1.0 h_bar | ||
``` | ||
|
||
See more about `Species()` constructors and getter functions [here](species.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters