Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for derived physical quantities #27

Open
triplepoint opened this issue Aug 8, 2014 · 1 comment
Open

Add support for derived physical quantities #27

triplepoint opened this issue Aug 8, 2014 · 1 comment
Assignees

Comments

@triplepoint
Copy link
Member

Here, derived physical quantities are quantities that are defined in terms of other quantities. For example:
Velocity = Length / Time
Area = Length * Length
Acceleration = Length / Time / Time

Currently, derived quantities are treated no differently from "fundamental" quantities, meaning that there's a lot of duplicated effort when managing conversion factors. In addition, there's an opportunity for gaining new units when the fundamental quantity units are extended. For example, if we added "cubit" to the set of units for Length, we could automatically get Cubits/s^2 as a unit for Acceleration.

Figure out how to cleanly represent this relationship between quantities and implement it.

@triplepoint triplepoint self-assigned this Aug 8, 2014
@nclavaud
Copy link

Just stumbled upon this while looking for a decent way to model and manipulate derived physical quantities.

I have just read this paper where derived quantities are modelled by a simple array of exponents, something like:

// velocity (m/s)
['length' => 1, 'time' => -1]

// area (m²)
['length' => 2, 'time' => 0]

// acceleration (m/s²)
['length' => 1, 'time' => -2]

With this kind of representation, multiplying/dividing two quantities is just a matter of adding/subtracting the values, key by key:

// area * length = volume
[
    'length' => 3, // 2 + 1
    'time' => 0,   // 0 + 0
]

// length / velocity = time
[
    'length' => 0, // 1 - 1
    'time' => 1,   // 0 - (-1)
]

Not sure it would help, that's just my 2 cents 🤷

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants