Measurements

Error propagation calculator and library for physical measurements. It supports real and complex numbers with uncertainty, arbitrary precision calculations, operations with arrays, and numerical integration.

https://github.com/juliaphysics/measurements.jl

Science Score: 64.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
    Links to: arxiv.org
  • Committers with academic emails
    2 of 22 committers (9.1%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (13.5%) to scientific vocabulary

Keywords

arbitrary-precision complex-numbers error-propagation julia linear-algebra multiprecision numerical-integration physical-quantities physics uncertainties uncertainty-propagation

Keywords from Contributors

numerical julialang programming-language pde sciml graphics ode optim interface flux
Last synced: 6 months ago · JSON representation ·

Repository

Error propagation calculator and library for physical measurements. It supports real and complex numbers with uncertainty, arbitrary precision calculations, operations with arrays, and numerical integration.

Basic Info
Statistics
  • Stars: 509
  • Watchers: 12
  • Forks: 41
  • Open Issues: 26
  • Releases: 23
Topics
arbitrary-precision complex-numbers error-propagation julia linear-algebra multiprecision numerical-integration physical-quantities physics uncertainties uncertainty-propagation
Created almost 10 years ago · Last pushed 6 months ago
Metadata Files
Readme Changelog License Citation

README.md

Measurements.jl

| Documentation | Build Status | Code Coverage | Quality | |:---------------------------------------:|:-----------------------------------:|:-------------------------------:|:-----------:| | | Build Status | |Aqua QA| | | | |

Introduction

What Is This Package Useful For?

image

Image credit: "xkcd: Error Bars" (CC-BY-NC 2.5)

Physical measures are typically reported with an error, a quantification of the uncertainty of the accuracy of the measurement. Whenever you perform mathematical operations involving these quantities you have also to propagate the uncertainty, so that the resulting number will also have an attached error to quantify the confidence about its accuracy. Measurements.jl relieves you from the hassle of propagating uncertainties coming from physical measurements, when performing mathematical operations involving them. The linear error propagation theory is employed to propagate the errors.

This library is written in Julia, a modern high-level, high-performance dynamic programming language designed for technical computing.

When used in the Julia interactive session, it can serve also as an easy-to-use calculator.

Features List

  • Support for most mathematical operations available in Julia standard library and special functions from SpecialFunctions.jl package, involving real and complex numbers. All existing functions that accept AbstractFloat (and Complex{AbstractFloat} as well) arguments and internally use already supported functions can in turn perform calculations involving numbers with uncertainties without being redefined. This greatly enhances the power of Measurements.jl without effort for the users
  • Functional correlation between variables is correctly handled, so x-x ≈ zero(x), x/x ≈ one(x), tan(x) ≈ sin(x)/cos(x), cis(x) ≈ exp(im*x), etc...
  • Support for arbitrary precision (also called multiple precision) numbers with uncertainties. This is useful for measurements with very low relative error
  • Define arrays of measurements and perform calculations with them. Some linear algebra functions work out-of-the-box
  • Propagate uncertainty for any function of real arguments (including functions based on C/Fortran calls), using @uncertain macro
  • Function to get the derivative and the gradient of an expression with respect to one or more independent measurements
  • Functions to calculate standard score and weighted mean
  • Parse strings to create measurement objects
  • Easy way to attach the uncertainty to a number using the ± sign as infix operator. This syntactic sugar makes the code more readable and visually appealing
  • Extensible in combination with external packages: you can propagate errors of measurements with their physical units, perform numerical integration with QuadGK.jl, numerical and automatic differentiation, and much more.
  • Integration with Plots.jl.

The method used to handle functional correlation is described in this paper:

A current limitation of the package is that it is not yet possible to define quantities related by a correlation matrix.

If you use use this package for your research, please cite it.

Documentation

The complete manual of Measurements.jl is available at https://juliaphysics.github.io/Measurements.jl/stable/. There, people interested in the details of the package, in order integrate the package in their workflow, can find a technical appendix explaining how the package internally works.

Installation

The latest version of Measurements.jl is available for Julia v1.0 and later releases, and can be installed with Julia built-in package manager. In a Julia session, after entering the package manager mode with ], run the command

julia pkg> update pkg> add Measurements

Older versions of this package are also available for Julia 0.4-0.7.

Usage

After installing the package, you can start using it with

julia using Measurements

The module defines a new Measurement data type. Measurement objects can be created with the two following constructors:

julia measurement(value, uncertainty) value ± uncertainty

where

  • value is the nominal value of the measurement
  • uncertainty is its uncertainty, assumed to be a standard deviation.

Here is a quick taster of the functionalities of the package:

``` julia julia> using Measurements

julia> a = measurement(4.5, 0.1) 4.5 ± 0.1

julia> b = 3.8 ± 0.4 3.8 ± 0.4

julia> 2a + b 12.8 ± 0.4472135954999579

julia> x = 8.4 ± 0.7

julia> x - x 0.0 ± 0.0

julia> x/x 1.0 ± 0.0

julia> xxx - x^3 0.0 ± 0.0

julia> sin(x)/cos(x) - tan(x) -2.220446049250313e-16 ± 0.0 # They are equal within numerical accuracy ```

For more details about the use of the package read the documentation, in particular the Usage and Examples sections.

License

The Measurements.jl package is licensed under the MIT "Expat" License. The original author is Mosè Giordano.

Please, cite the paper Giordano 2016 (http://arxiv.org/abs/1610.08716) if you employ this package in your research work. For your convenience, a BibTeX entry is provided in the CITATION.bib file.

Owner

  • Name: JuliaPhysics
  • Login: JuliaPhysics
  • Kind: organization

Physics in Julia

Citation (CITATION.bib)

@ARTICLE{Measurements.jl-2016,
  author =	 {{Giordano}, Mos{\`e}},
  title =	 "{Uncertainty propagation with functionally correlated
                  quantities}",
  journal =	 {ArXiv e-prints},
  archivePrefix ="arXiv",
  eprint =	 {1610.08716},
  primaryClass = "physics.data-an",
  keywords =	 {Physics - Data Analysis, Statistics and Probability},
  year =	 2016,
  month =	 oct,
  adsurl =	 {https://ui.adsabs.harvard.edu/abs/2016arXiv161008716G},
  adsnote =	 {Provided by the SAO/NASA Astrophysics Data System}
}

GitHub Events

Total
  • Create event: 8
  • Commit comment event: 5
  • Release event: 3
  • Issues event: 5
  • Watch event: 25
  • Delete event: 7
  • Issue comment event: 49
  • Push event: 30
  • Pull request review event: 14
  • Pull request review comment event: 15
  • Pull request event: 17
  • Fork event: 4
Last Year
  • Create event: 8
  • Commit comment event: 5
  • Release event: 3
  • Issues event: 5
  • Watch event: 25
  • Delete event: 7
  • Issue comment event: 49
  • Push event: 30
  • Pull request review event: 14
  • Pull request review comment event: 15
  • Pull request event: 17
  • Fork event: 4

Committers

Last synced: 9 months ago

All Time
  • Total Commits: 421
  • Total Committers: 22
  • Avg Commits per committer: 19.136
  • Development Distribution Score (DDS): 0.088
Past Year
  • Commits: 5
  • Committers: 5
  • Avg Commits per committer: 1.0
  • Development Distribution Score (DDS): 0.8
Top Committers
Name Email Commits
Mosè Giordano m****e@g****g 384
dependabot[bot] 4****] 5
Pietro Monticone 3****e 3
Twan Koolen k****n@g****m 3
simeonschaub s****9@g****m 3
Rogerluo h****r@q****m 2
Alex Ames a****s@g****m 2
Andrés Riedemann 3****0 2
Eben60 6****0 2
George Datseris d****e@g****m 2
github-actions[bot] 4****] 2
C. Brenhin Keller c****r@d****u 1
Elliot Saba s****t@g****m 1
Hendrik Ranocha r****a 1
Julia TagBot 5****t 1
Lukas l****b@a****v 1
Michael Krabbe Borregaard m****d@s****k 1
Miles Cranmer m****r@g****m 1
Morten Piibeleht m****t@g****m 1
Simon Christ S****t@g****e 1
Valentin Churavy v****y 1
abhro 5****o 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 62
  • Total pull requests: 95
  • Average time to close issues: 3 months
  • Average time to close pull requests: about 1 month
  • Total issue authors: 57
  • Total pull request authors: 20
  • Average comments per issue: 3.53
  • Average comments per pull request: 2.79
  • Merged pull requests: 82
  • Bot issues: 0
  • Bot pull requests: 10
Past Year
  • Issues: 4
  • Pull requests: 21
  • Average time to close issues: 1 day
  • Average time to close pull requests: 1 day
  • Issue authors: 4
  • Pull request authors: 7
  • Average comments per issue: 2.75
  • Average comments per pull request: 2.05
  • Merged pull requests: 17
  • Bot issues: 0
  • Bot pull requests: 4
Top Authors
Issue Authors
  • giordano (3)
  • longemen3000 (2)
  • Boxylmer (2)
  • MartinOtter (2)
  • jmarcellopereira (1)
  • bertulli (1)
  • timmyfaraday (1)
  • CITESmike2018 (1)
  • mmikhasenko (1)
  • LebedevRI (1)
  • scheidan (1)
  • Mattriks (1)
  • BeastyBlacksmith (1)
  • briochemc (1)
  • alusiani (1)
Pull Request Authors
  • giordano (49)
  • dependabot[bot] (7)
  • github-actions[bot] (6)
  • longemen3000 (5)
  • FerreolS (4)
  • simeonschaub (4)
  • pitmonticone (3)
  • Roger-luo (2)
  • abhro (2)
  • LebedevRI (2)
  • stillyslalom (2)
  • vchuravy (2)
  • brenhinkeller (2)
  • Eben60 (2)
  • kapple19 (2)
Top Labels
Issue Labels
help wanted (10) enhancement (7) not a bug (3) bug (2) performance (1)
Pull Request Labels
dependencies (7) enhancement (2)

Packages

  • Total packages: 1
  • Total downloads:
    • julia 1,387 total
  • Total dependent packages: 68
  • Total dependent repositories: 18
  • Total versions: 22
juliahub.com: Measurements

Error propagation calculator and library for physical measurements. It supports real and complex numbers with uncertainty, arbitrary precision calculations, operations with arrays, and numerical integration.

  • Versions: 22
  • Dependent Packages: 68
  • Dependent Repositories: 18
  • Downloads: 1,387 Total
Rankings
Dependent packages count: 1.2%
Stargazers count: 1.5%
Dependent repos count: 2.1%
Average: 2.3%
Forks count: 4.4%
Last synced: 6 months ago

Dependencies

.github/workflows/CompatHelper.yml actions
.github/workflows/TagBot.yml actions
  • JuliaRegistries/TagBot v1 composite
.github/workflows/benchmark.yml actions
  • actions/checkout v4 composite
  • julia-actions/cache v1 composite
  • julia-actions/setup-julia v1 composite
.github/workflows/ci.yml actions
  • actions/checkout v4 composite
  • julia-actions/cache v1 composite
  • julia-actions/julia-buildpkg latest composite
  • julia-actions/julia-docdeploy releases/v1 composite
  • julia-actions/julia-runtest latest composite
  • julia-actions/julia-uploadcodecov v0.1 composite
  • julia-actions/julia-uploadcoveralls v1.0 composite
  • julia-actions/setup-julia latest composite
  • julia-actions/setup-julia v1 composite