units package¶
The unit system.
Exported members:
pamp, namp, uamp, mamp, amp, kamp, Mamp, Gamp, Tamp, kelvin, kilogram, pmetre, nmetre, umetre, mmetre, metre, kmetre, Mmetre, Gmetre, Tmetre, pmeter, nmeter, umeter, mmeter, meter
… (219 more members)
allunits module¶
THIS FILE IS AUTOMATICALLY GENERATED BY A STATIC CODE GENERATION TOOL DO NOT EDIT BY HAND
Instead edit the template:
dev/tools/static_codegen/units_template.py
Exported members:
metre, meter, kilogram, second, amp, ampere, kelvin, mole, mol, candle, kilogramme, gram, gramme, molar, radian, steradian, hertz, newton, pascal, joule, watt, coulomb, volt, farad, ohm
… (2045 more members)
Objects
A dummy object to raise errors when |
constants module¶
A module providing some physical units as Quantity objects. Note that these
units are not imported by wildcard imports (e.g. from brian2 import *), they
have to be imported explicitly. You can use import ... as ... to import them
with shorter names, e.g.:
from brian2.units.constants import faraday_constant as F
The available constants are:
Constant |
Symbol(s) |
Brian name |
Value |
|---|---|---|---|
Avogadro constant |
\(N_A, L\) |
|
\(6.022140857\times 10^{23}\,\mathrm{mol}^{-1}\) |
Boltzmann constant |
\(k\) |
|
\(1.38064852\times 10^{-23}\,\mathrm{J}\,\mathrm{K}^{-1}\) |
Electric constant |
\(\epsilon_0\) |
|
\(8.854187817\times 10^{-12}\,\mathrm{F}\,\mathrm{m}^{-1}\) |
Electron mass |
\(m_e\) |
|
\(9.10938356\times 10^{-31}\,\mathrm{kg}\) |
Elementary charge |
\(e\) |
|
\(1.6021766208\times 10^{-19}\,\mathrm{C}\) |
Faraday constant |
\(F\) |
|
\(96485.33289\,\mathrm{C}\,\mathrm{mol}^{-1}\) |
Gas constant |
\(R\) |
|
\(8.3144598\,\mathrm{J}\,\mathrm{mol}^{-1}\,\mathrm{K}^{-1}\) |
Magnetic constant |
\(\mu_0\) |
|
\(12.566370614\times 10^{-7}\,\mathrm{N}\,\mathrm{A}^{-2}\) |
Molar mass constant |
\(M_u\) |
|
\(1\times 10^{-3}\,\mathrm{kg}\,\mathrm{mol}^{-1}\) |
0°C |
|
\(273.15\,\mathrm{K}\) |
fundamentalunits module¶
Defines physical units and quantities
Quantity |
Unit |
Symbol |
Length |
metre |
m |
Mass |
kilogram |
kg |
Time |
second |
s |
Electric current |
ampere |
A |
Temperature |
kelvin |
K |
Quantity of substance |
mole |
mol |
Luminosity |
candle |
cd |
Exported members:
DimensionMismatchError, get_or_create_dimension(), get_dimensions(), is_dimensionless(), have_same_dimensions(), in_unit(), in_best_unit(), Quantity, Unit, register_new_unit(), check_units(), is_scalar_type(), get_unit()
Classes
|
Stores the indices of the 7 basic SI unit dimension (length, mass, etc.). |
|
Exception class for attempted operations with inconsistent dimensions. |
|
A number with an associated physical dimension. |
|
A physical unit. |
Stores known units for printing in best units. |
Functions
|
Decorator to check units of arguments passed to a function |
|
Compare the dimensions of two objects. |
|
Return the dimensions of any object that has them. |
|
Create a new Dimension object or get a reference to an existing one. |
|
Find an unscaled unit (e.g. |
Return a string representation of an appropriate unscaled unit or |
|
Test if two values have the same dimensions. |
|
Represent the value in the "best" unit. |
|
Display a value in a certain unit with a given precision. |
|
Test if a value is dimensionless or not. |
|
Tells you if the object is a 1d number type. |
|
Create a new |
Register a new unit for automatic displaying of quantities |
|
Returns a new function that wraps the given function |
Returns a new function that wraps the given function |
Returns a new function that wraps the given function |
Returns a new function that wraps the given function |
Objects
The singleton object for dimensionless Dimensions. |
|
|
|
stdunits module¶
Optional short unit names
This module defines the following short unit names:
mV, mA, uA (micro_amp), nA, pA, mF, uF, nF, nS, mS, uS, ms, Hz, kHz, MHz, cm, cm2, cm3, mm, mm2, mm3, um, um2, um3
Exported members:
mV, mA, uA, nA, pA, pF, uF, nF, nS, uS, mS, ms, us, Hz, kHz, MHz, cm, cm2, cm3, mm, mm2, mm3, um, um2, um3
… (3 more members)
unitsafefunctions module¶
Unit-aware replacements for numpy functions.
Exported members:
log(), log10(), exp(), expm1(), log1p(), exprel(), sin(), cos(), tan(), arcsin(), arccos(), arctan(), sinh(), cosh(), tanh(), arcsinh(), arccosh(), arctanh(), diagonal(), ravel(), trace(), dot(), where(), ones_like(), zeros_like()
… (3 more members)
Functions
|
Return evenly spaced values within a given interval. |
|
Trigonometric inverse cosine, element-wise. |
|
Inverse hyperbolic cosine, element-wise. |
|
Inverse sine, element-wise. |
|
Inverse hyperbolic sine element-wise. |
|
Trigonometric inverse tangent, element-wise. |
|
Inverse hyperbolic tangent element-wise. |
|
Cosine element-wise. |
|
Hyperbolic cosine, element-wise. |
|
Return specified diagonals. |
|
Dot product of two arrays. |
|
Calculate the exponential of all elements in the input array. |
|
Return evenly spaced numbers over a specified interval. |
|
Natural logarithm, element-wise. |
|
Return a contiguous flattened array. |
|
Trigonometric sine, element-wise. |
|
Hyperbolic sine, element-wise. |
|
Compute tangent element-wise. |
|
Compute hyperbolic tangent element-wise. |
|
Return the sum along diagonals of the array. |
|
Return elements chosen from |
|
Wraps a function so that it calls the corresponding method on the Quantities object (if called with a Quantities object as the first argument). |