On Tue, Apr 7, 2009 at 10:18 PM, flyeng4 <[email protected]> wrote:
>
> I am trying to understand physics.units.  Here is an ipython session
> illustrating my mental block
>
> In [32]: from sympy.physics.units import *
>
> In [33]: V/ohm
> Out[33]: A         <-- This makes sense.
>
> In [34]: A*ohm
> Out[34]: m**2*kg/(A*s**3)  <-- Why not 'V'?

Because that is how V is defined:

>>> V
m**2*kg/(A*s**3)

All quantities in physics.units are defined in terms of SI base units
(http://en.wikipedia.org/wiki/SI_base_unit). The derived units (such
as V) are just composite expressions, not atomic symbols. This ensures
that expressions involving units always are in canonical form (with
the downside that this form is not always pretty), and thus SymPy's
generic symbolic algorithms can handle units without the need for any
special code.

The simplest workaround would be to recognize simpler forms for units
at the pretty-printing stage.

Fredrik

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [email protected]
For more options, visit this group at http://groups.google.com/group/sympy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to