## ElectricalEngineering.jl

Julia electrical engineering package
Author christiankral
Popularity
4 Stars
Updated Last
9 Months Ago
Started In
July 2018

# ElectricalEngineering.jl

This is a Julia package on electrical engineering based on Unitful and PyPlot. The package ElectricalEngineering.jl is tested with Julia 1.1.0. To install the package, start Julia and hit `]` to switch to the package manager.

``````add Pyplot Unitful ElectricalEngineering
``````

In order to update to the actual version of GitHub in the package manager, hit `]` and apply:

``````update ElectricalEngineering
``````

To switch back to the Julia REPL and to start working hit `Backspace`.

The module ElectricalEngineering.jl has to be loaded by `using ElectricalEngineering`. In order to use all the features of ElectricalEngineering.jl, modules Unitful and PyPlot have to be loaded as well. It is thus recommended to appy:

`using Unitful, Unitful.DefaultSymbols, PyPlot, ElectricalEngineering`

# Features

## Phasors

• Function `pol` to generate a complex quantity based on the length and the angle (polar representation)
```julia> U1 = pol(2V, pi)
-2 + 0im V
julia> U2 = pol(sqrt(2) * 1V, 45°)
1 + 1im V```
• Constant `j` representing the imaginary unit equivalent to `1im`
• Function `phasor`
• Plot publication ready phasor diagrams
• LaTeX labeling with absolute or relative rotation of text

## Circuits and Physics

• Function `∥`
• Calculate parallel connections of impedances
• Calculate parallel impedance with or without units
```julia> 4Ω∥6Ω
2.4000000000000004 Ω
julia> 4Ω∥(j*4Ω)
2.0 + 2.0im Ω```

## Inputs and Outputs

• Function `printuln`
• Print complex variables (including) units in rectangular and polar form
• Limit output to six significant digits
• Convert printed quantity optionally into a target unit
• Works with scalars and vectors of real or complex quantities
```julia> U1 = 300V + j*400V
julia> printuln("U1", U1, kV)
U1 = 0.3 kV + j 0.4 kV
= 0.5 kV ∠ 53.1301°
julia> printuln("real(U1)", real(U1),kV)
real(U1) = 0.3 kV
julia> printuln("U1", U1, V, label="(a)")
(a)           U1 = 300 V + j 400 V
= 500 V ∠ 53.1301°```

### Used By Packages

No packages found.