| acpower | index download acpower.py |
A python module containing classes and functions for quickly making power
engineering calculations at the Python prompt.
Put in your current directory and load with 'import acpower' after starting
python. You may then create phasors with something like:
$ python
Python 2.6.4 (r264:75706, Oct 27 2009, 06:25:13)
[GCC 4.4.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import acpower
>>> v = acpower.Phasor(1+3j)
>>> v
phasor with:
polar coods = 3.162 /_ 71.565
rectangular coords = 1.000+3.000j
You can call the helper functions with 'acpower.function(args)'
e.g:
>>> z = acpower.Phasor([1.414,44.977])
>>> z
phasor with:
polar coods = 1.414 /_ 44.977
rectangular coords = 1.000+0.999j
>>> total = acpower.parallel(v,z)
>>> total
phasor with:
polar coords = 1.000 /_ 53.113
rectangular coords = 0.600+0.800j
The python operators are overloaded, so you can use +,-,*,and / like you
would with an int or a float:
>>> v/z
phasor with:
polar coods = 2.236 /_ 0.464
rectangular coords = 2.000+1.001j
By default all angles are in degrees. You can change this to radians with:
>>> acpower.angle_unit = "rad"
eg:
>>> z
phasor with:
polar coords = 1.414 /_ 44.977
rectangular coords = 1.000+0.999j
>>> acpower.angle_unit = "rad"
>>> z
phasor with:
polar coords = 1.414 /_ 0.785
rectangular coords = 1.000+0.999j
and back with:
>>> acpower.angle_unit = "deg"
| Modules | ||||||
| ||||||
| Classes | ||||||||||
|
| ||||||||||
| Functions | ||
| ||
| Data | ||
| angle_unit = 'deg' | ||