We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
The below should not give an error, as the dimensions of energy are compatible with mass * length ** 2 / second ** 2:
mass * length ** 2 / second ** 2
from sympy import S, exp from sympy.physics.units import energy, length, mass, time, Quantity u = Quantity("u") v = Quantity("v") u.set_dimension(energy) v.set_dimension(mass*length**2/time**2) Quantity._collect_factor_and_dimension(1 - (u/v))
returns ValueError: Dimension of "-u/v" is energy*time**2/(length**2*mass), but it should be 1
ValueError: Dimension of "-u/v" is energy*time**2/(length**2*mass), but it should be 1
The text was updated successfully, but these errors were encountered:
Same problem also occurs with check_dimensions:
check_dimensions
from sympy import S, exp from sympy.physics.units import energy, length, mass, time, Quantity from sympy.physics.units.systems.si import dimsys_SI, SI from sympy.physics.units.util import convert_to, check_dimensions u = Quantity("u") v = Quantity("v") SI.set_quantity_dimension(u, energy) SI.set_quantity_dimension(v, mass*length**2/time**2) check_dimensions(1 - (u/v))
returns ValueError: addends have incompatible dimensions
ValueError: addends have incompatible dimensions
Sorry, something went wrong.
And maybe a more straightforward example:
from sympy.physics.units import joule, kilogram, meter, second from sympy.physics.units.util import check_dimensions check_dimensions(1 - (kilogram*meter**2/second**2) / joule)
No branches or pull requests
The below should not give an error, as the dimensions of energy are compatible with
mass * length ** 2 / second ** 2
:returns
ValueError: Dimension of "-u/v" is energy*time**2/(length**2*mass), but it should be 1
The text was updated successfully, but these errors were encountered: