MIT License

项目介绍

JuliaPhysics/Measurements.jl 是一个托管在 GitHub 上的开源项目,主要使用 Julia 编写,采用 MIT License 许可证,目前获得 535 个 Star、43 次 Fork。

仓库全名
JuliaPhysics/Measurements.jl
开源许可证
MIT License
Star 数
535
Fork 数
43
未关闭 Issue
28

README 摘要

Measurements.jl Documentation | Build Status | Code Coverage | Quality | :---------------------------------------:|:-----------------------------------:|:-------------------------------:|:--------------------------------------------------:| Introduction What Is This Package Useful For? Image credit: "xkcd: Error Bars" (CC-BY-NC 2.5) Physical measures are typically reported with an error, a quantification of the…

完整内容见 GitHub 原始 README 或本页 。

常见问题

Measurements.jl 用什么语言开发?

主要使用 Julia 编写,采用 MIT License 许可证,目前有 535 个 Star。

Measurements.jl 可以免费商用吗?

仓库采用 MIT License 许可证,可免费使用与修改,商业使用请遵守许可证条款(例如保留版权声明与许可声明)。

如何获取 Measurements.jl 的源码?

可以直接克隆仓库:git clone https://github.com/JuliaPhysics/Measurements.jl.git;安装与运行步骤见仓库 README。

Measurements.jl 最近还在维护吗?

仓库最近一次更新为 6月29日,当前有 28 个未关闭 Issue;Star 数为 535,可作为社区活跃度的参考。

关于

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.

描述取自 GitHub 官方 API,中文内容由 GitRead 中文社区 编辑团队整理。

README

Measurements.jl

Documentation Build Status Code Coverage Quality
Build Status Aqua QA
Fuzzy Tests

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

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

using Measurements

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

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> 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> x*x*x - 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.

评论

暂无评论