Alicorn.jl

Dynamically define and manipulate physical units and quantities in Julia
Author Huemmer-Daniel
Popularity
0 Stars
Updated Last
6 Months Ago
Started In
December 2020

Alicorn

Dynamically define and manipulate physical units and quantities in Julia

Build Status: Build status Codecov status Coverall status

Documentation: Documentation stable Documentation development

The Alicorn.jl package serves a dual purpose:

  1. Dynamically define and combine physical units based on the International System of Units (SI). This functionality is provided by the Units submodule.
  2. Handle physical quantities and correctly treat their units. This functionality is provided by the Quantities submodule.

Installation

The Alicorn.jl package is registered in the General Julia registry and can be installed using Julia's package manager Pkg.jl: In the Julia REPL, add Alicorn to your default Julia environment by running

julia> ]

pkg> add Alicorn

Quick Start

The listing below shows a minimal example of how to use Alicorn. Refer to the Basic Usage section for more details.

julia> using Alicorn

julia> ucat = UnitCatalogue() ;

julia> mass = 2 * (ucat.kilo * ucat.gram)
2 kg

julia> acceleration = 10 * ucat.meter * ucat.second^-2
10 m s^-2

julia> force = mass * acceleration
20 kg m s^-2

julia> inUnitsOf(force, ucat.kilo * ucat.newton)
0.02 kN

Alternative

If you are interested in Alicorn, also have a look at the mature Unitful.jl package. Unitful.jl offers functionalities similar to Alicorn.jl, and more.