Julia electrical engineering package
Switch branches/tags
Nothing to show
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
docs Provide four Unitful functions Aug 4, 2018
resources Update of image Aug 10, 2018
src Add angle function as alternative to pol Dec 6, 2018
test Add test case Jul 2, 2018
HISTORY.md Fix #2 Oct 20, 2018
LICENSE Initial commit Jul 2, 2018
README.md Fix format Aug 10, 2018
_config.yml Set theme jekyll-theme-minimal Aug 4, 2018

README.md

EE.jl

This is a Julia package on electrical engineering (EE) based on Unitful and PyPlot. To install these modules, apply Pkg.add("Unitful") and Pkg.add("PyPlot") In the EE.jl module the processing and calculation of real and complex quantities is supported. The module is tested with Julia 0.6.2 and 0.6.4.

The non-official package EE.jl can be installed by (has to be done only once):

Pkg.clone("git://github.com/christiankral/EE.jl.git")

In order to update to the actual version of GitHub use:

Pkg.update("EE")

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

using Unitful,Unitful.DefaultSymbols,PyPlot,EE

Note: After updating to a newer version of EE.jl, the module can be reloaded without exiting the session by applying reload("EE").

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

Phasor diagram Circuit diagram

  • Function phasorsine
    • Plot phasor in the left subplot of a figure
    • Plot sine wave corresponding to the phasor in the right subplot Phasor and sine wave
  • Function angulardimension
    • Draw arc to indicate angle between phasors
    • Chose between different arrow shapes
    • Create dimension of phasor
  • Function phasordimension
    • Create auxiliary lines and parallel shifted dimensions Length dimension

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°
  • Function save3fig

    • Save one figure in the three file formats png, eps and pdf
    • Optionally crop figures

    Plotting

  • Assign two different color schemes (may be loaded alternatively)

  • Additional light background color colorBlack5

  • Different line and marker types

    • lineStyle1, lineStyle2, lineStyle3, lineStyle4
    • lineWidth1, lineWidth2, lineWidth3, lineWidth4,
    • marker1, marker2 ,marker3, marker4
    • markerSize1, markerSize2 ,markerSize3 ,markerSize4
    • legendFontSize
    • Type ?EE.Gray or ?EE.Tab20bc to see application examples
  • Assign color schemes to quantities, using either using EE.Gray of gray scale graphics or using EE.Tab20bc

  • Function removeaxes

    • Removes the axes of the active plot
  • Function arrowaxes

    • Plot graphs with arrowed axes
    • Add plot labels Curves
  • Function lengthdimension

    • Create length dimension with arrows
    • Create auxiliary lines and parallel shifted dimensions Length dimension