JuliaPhysics / JuliaPhysics/Unitful.jl

Dimensional correctness test with unknown constants (with unknown units)

Open
#653 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Julia
Stars
675
Forks
124
Avg merge
3h 38m
Merged PRs (30d)
1

Description

I want to determine if an expression, with arbitrary constants, is dimensionally correct. The constants essentially have "wildcard" units which one would solve for to make an expression consistent. How can I do this with Unitful.jl?

For example,

- $a_1 x - a_2 y$ , is dimensionally correct, for any dimensions in $x$ and $y$, because $a_1$ and $a_2$ are free parameters.
- $\cos(a_1*x)$ is dimensionally correct, as the $a_1$ can cancel out the dimensions of $x$.
- But, $\cos(a_1*x - y)$ is **not** dimensionally correct if $y$ has units which cannot be cancelled out.
- $\cos(a_1*x) * a_2 - y$ is dimensionally correct, as the $a_2$ can give the result of the $\cos$ the same units as $y$ has.

I am wondering what the best way to approach this with Unitful.jl is?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.