Liking cljdoc? Tell your friends :D

diman.dimensions

Contains definitions and their getters. These are:

  • base_dimensions
  • standard_formula
  • grab-notation and grab-name from base-dimensions
  • grab-sformula from standard-formula
  • notation?
  • matched-notation-sformula
  • update-sformula

How to use

Loading

(require '[diman.dimensions :refer [base_dimensions standard_formula
                                    grab-notation grab-name grab-sformula
                                    notation? matched-notation-sformula]])

Examples

View the seven fundamental dimensions

(pprint bas e_dimensions)

Get notation for the base dimension name "mass"

=> (grab-notation "mass")
"[M]"

Get base dimension name for notation "[M]"

=> (grab-name "[M]")
"mass"

View available standard formula

(pprint standard_formula)

Get formula of a quantity in the standard formula

=> (grab-sformula "acceleration")
"[L^(1)*T^(-2)]"

Notice that a formula in standard_formula is a dimensional formula and hence as a consequence a dimension.

Get matching notation/standard formula of a defined symbol

Let us define symbol x, v, t and a representing a combination of variables and parameters as

(def varpars [{:symbol "x", :quantity "length"}
              {:symbol "v", :quantity "velocity"}
              {:symbol "t", :quantity "time"}
              {:symbol "a", :quantity "acceleration"}])

Then based on the dimensions defined for respective symbol use

=> (matched-notation-sformula varpars "x")
"[L]"
=> (matched-notation-sformula varpars "a")
"[L^(1)*T^(-2)]"

NOTE:

  • definition of any single letter symbol must be a value to key :symbol
  • and must also have the key :dimension whose value must be a string corresponding to either
    • one of the seven :name values, i.e, one of the seven fundamental dimensions
    • one of the quantity values, i.e, one of the standard formulae
Contains definitions and their getters.
These are:

- `base_dimensions`
- `standard_formula`
- `grab-notation` and `grab-name` from `base-dimensions`
- `grab-sformula` from `standard-formula`
- `notation?`
- `matched-notation-sformula`
- `update-sformula`

## How to use
### Loading
```
(require '[diman.dimensions :refer [base_dimensions standard_formula
                                    grab-notation grab-name grab-sformula
                                    notation? matched-notation-sformula]])
```
### Examples
#### View the seven fundamental dimensions
`(pprint bas e_dimensions)`

#### Get notation for the base dimension name "mass"
```
=> (grab-notation "mass")
"[M]"
```

#### Get base dimension name for notation "[M]"
```
=> (grab-name "[M]")
"mass"
```

#### View available standard formula
`(pprint standard_formula)`

#### Get formula of a quantity in the standard formula
```
=> (grab-sformula "acceleration")
"[L^(1)*T^(-2)]"
```
Notice that a formula in `standard_formula` is a dimensional formula and hence as a consequence a dimension.

#### Get matching notation/standard formula of a defined symbol
Let us define symbol *x*, *v*, *t* and *a* representing a combination of variables and parameters as
```
(def varpars [{:symbol "x", :quantity "length"}
              {:symbol "v", :quantity "velocity"}
              {:symbol "t", :quantity "time"}
              {:symbol "a", :quantity "acceleration"}])
```
Then based on the dimensions defined for respective symbol use
```
=> (matched-notation-sformula varpars "x")
"[L]"
=> (matched-notation-sformula varpars "a")
"[L^(1)*T^(-2)]"
```
NOTE:

* definition of any __single letter__ symbol must be a value to key `:symbol`
* and must also have the key `:dimension` whose value must be a string corresponding to either
  - one of the seven `:name` values, i.e, one of the seven fundamental dimensions
  - one of the `quantity` values, i.e, one of the standard formulae

raw docstring

base_dimensionsclj

The Seven Fundamental/Base Dimensions. NOTE: This is fixed. See International Metrology

The Seven Fundamental/Base Dimensions.
NOTE: This is fixed. See [International Metrology](https://www.bipm.org/en/measurement-units/)
sourceraw docstring

grab-nameclj

(grab-name notation)
(grab-name notation bdim dim)

Returns name for any one of the 7-Base notations, else "nil".

Returns name for any one of the 7-Base notations, else "nil".
sourceraw docstring

grab-notationclj

(grab-notation name)
(grab-notation name bdim dim)

Returns notation for any one of the 7-Base dimensions, else "nil".

Returns notation for any one of the 7-Base dimensions, else "nil".
sourceraw docstring

grab-sformulaclj

(grab-sformula quantity)
(grab-sformula quantity sform form)

Returns formula for any one of the standard quantities (hence standard formula), else "nil".

Returns formula for any one of the standard quantities (hence standard formula), else "nil".
sourceraw docstring

matched-notation-sformulaclj

(matched-notation-sformula varpar_def symb)
source

notation?clj

(notation? x)
source

standard_formulaclj

Dimensional Formula for standard physical quantity. NOTE: This is subject to expansion. See International Metrology

Dimensional Formula for standard physical quantity.
NOTE: This is subject to expansion. See [International Metrology](https://www.bipm.org/en/measurement-units/)
sourceraw docstring

update-sformulaclj

(update-sformula x)
(update-sformula x y)
source

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close