Electrical Network Interactive Analysis Console
and the Eniac Extension language
SourceForge.net Logo

About this project

This project take his name from the famous ENIAC Electronic Numerical Integrator And Computer (external link).

Eniac (which I have changed acronym to Electrical Network Interactive Analysis Console)
is an educational software witch performs a lot of mathematical and engineering calculation,
and it was initially designed to study the behavior of electrical networks, but its use goes far beyond this purpose...
For this reason I have in mind to change the name into Engineering Numerical Interactive Analysis Console

Eniac is build on a new extension language (called "Eniac" in honour of the first general-purpose electronic computer) which could be use to "extend" your programs and applications, give them a programming possibility with a simple and powerful embeddable scripting language.

"This feature has grown slowly during the development of the program, but is becoming increasingly important, beginning to live their own life and is not necessarily connected to the original networks analisys, but can also be used for general purposes."

Eniac scripts are compiled and executed in an internal Virtual Machine that interprets a set of about fifty elementary instructions.
Eniac also provides the opportunity to debug the code step by step using both high level and low-level virtual machine instructions.
This again has an educational value in understanding how a compiler works.

I have started this project for these reasons:
  1. Write a full C++ project, in order to learn it better (I'm always used other languages like "C", Java, bash, Tcl/Tk, Lua, Visualbasic, Fortran)
  2. Resume my electronic engineering concepts, because after so many years that no longer practice hardware designer, I'm beginning to forget them!
  3. Keep pieces of code that I wrote so long ago.
Main features are:
  • Perform a lot of scientific calculations by mean of the Eniac Language;
  • Provide a powerfull general-purpose embeddable scripting language.
  • Resolution of electrical network is an application of Eniac (but is not the only one).
    • Using method of admittance matrix to resolve networks.
    • Calculation of Transfer Function and Impedance beetween every couple of nodes.
    • Plotting of bode plots on gif format files. See an example produced by Eniac.
    • Calculation and plotting of output signal from every node after apply an input signal.
    • Calculation of poles and zeros using Bairstow-Newton method.

How Eniac works

The interface of the Eniac engine is basically an interactive console which respond to commands (like unix shell or windows cmd).
These commands are interpreted by a lexical analyzer using a particular semantic algebra, in this way, you can write expressions as you are habit to do,
for example:
ENIAC> a=1+2/4-12*j
ENIAC> p=s^2+10*s-(sin(pi/2)-4)*s^3-real(a)*s^4

ENIAC> solve(p)
[ 0,-0.488237+1.41471*j,-0.488237-1.41471*j, 2.97647]
In this example a is a complex number where "j" is the imaginary unit, p is a polynomial where "s" is the "unknown variable", and solve(p) solve the equation p=0.
Check the link Eniac Language to have a more detailed description of most constructs supported.

How it's possible analyze an electrical network with Eniac?
Take for example a simple RC network as shown in the figure:

We can introduce the schema as described below, having previously numbered nodes in the circuit, taking 0 as the ground node.
ENIAC> R( [1,2], 100 Ohm );
ENIAC> C( [2,0],  10 pF  );

ENIAC> f=Gain( [2],[1] )
ENIAC> bode(f)
Frequency range = [1591.55,1.59155e+007] Hz
Amplitude range = [-40.0004,-0.000446993] dB
pole = 159155 Hz
Bode diagrams plotted to "circuits/bode.gif" (800x400)

ENIAC> nyquist(f)
Frequency range = [1591.55,1.59155e+007] Hz
Step = 10000
Real range = [8.3325e-005,1.19988]
Imag range = [-0.6,-0.0083325]
Nyquist diagram plotted to "circuits/nyquist.gif" (800x400)
Function Gain calculate the transfer function v[2]/v[1],
bode(f) plot bode diagrams on file bode.gif,
bode(f) plot nyquist diagram on file nyquist.gif,
rootlocus(f) plot root locus on file roots.gif

Look a more complex example here: Active pass band filter

History of E.n.i.a.c.

Eniac start his life in 1989 as a BASIC program for CASIO FX850, starting from the lessons of Electrical Network Theory at Politecnico di Torino.
After that time, I decided to port it to a Macintosh II traslating it in C language, I maked also a nice GUI, and I renamed it "MacTronic".
Now, after a lot of years, I have just a printed copy of the source code of MacTronic, so I have decided to revive that project, rewriting it and returning to the original name.
Eniac will be composed by 2 main programs:
  1. The Eniac Engine: a textual console program that will perform all calculation, reading and writing formated text files or graphical gif plottings.
  2. The Eniac GUI: a graphical program which will comunicate with the engine.
For the moment I'm working just on the engine.

Download and test it!!

Eniac is available for Win32 (I'm test it only on XP, I don't known if it run also on Vista) and Linux for intel.
I think there should be no problem to compile it on MacOSX, since I have not used any specific function and library of Windows or Linux.
(I'm sorry, but I'm not equipped to build Eniac on Mac)
If someone want to try to compile it on Mac, He will be welcome!

You can download and test the pre-release here:

Download Eniac

Don't forget to give me your opinion and suggestion!!


Eniac is a free software, open source and distributed under the terms of the GNU General Public License (external link).

SVN Repository

You can get last development version from: http://eniac-lab.svn.sourceforge.net/


This is a "spare time project" so, the development could be very slow, I'm sorry!
List of news from most recent to oldest:
  • 04/03/2009 Added binaries for Linux i386.
  • 26/02/2009 SVN R9: Now Matrix could be complex, Add Matrix inversion and more matrix operations, Correct a lot of bugs. Add more math function. Use Gauss-Jordan algorithm to calculate complex determinant (polynomial matrix still need Laplace alg.)
  • 18/02/2009 SVN R8: Add programming constructs, Eniac code now is compiled and executed into EniacVM. Add Matrix operations + - * transpose.
  • 28/01/2009 SVN R7: Add Rootlocus and Nyquist plots. Components insertion now works fine, add impedance calculation.Lot of bugs corrected.
  • 16/01/2009 SVN R5: Added mini-language in parser.cpp, library functions, calculation of transfer function, bode diagrams and more.
  • 21/11/2008 SVN R3: Added polynomial and matrix classes.
  • 19/11/2008 SVN R1: First import: just to check SVN.

Missing features and wrong things

  • early version of Eniac permitted to follow numbers by a measure unit, (for example a=100 KOhm) and this was simply ignored in computation. I have removed this possibility because it create some problems to the parser, so now it's only possible specificate the engineering moltiplication factor (p,n,u,m,K,M,G,T) but not the measure unit. (In the previous example a=100K or a=100e+3 as you prefer.)
  • polynomials should have also complex coefficients.
  • real number are complex with imaginary part equal to zero. We need a new type to improve performance?
  • generic plots for mathematical functions (now there is only Bode plots).
  • determinat now is calculated with Gauss-Jordan algorithm for complex matrix, but polynomial matrix still use Laplace recursive algorithm, because I haven't polynomial division.
  • "try" and "catch" error handling


As Eniac uses the C++ as programming language, the performance is not so excellent, but more than enough for the purpose of the program.
I hope to improve performances with next releases (for example to use of Gauss-Jordan to calculate determinants, or other more efficient algorithms)


Eniac Sourceforge Project Home
The Eniac Language

The Eniac programming language is somewhat inspired by the philosophy of Lua (opensource)
I have also taken other inspirations from Matlab (commercial) and Maxima, a Computer Algebra System (opensource),
softwares that I would recommend, if you're looking for something more mature and consolidated.

Contact me

  • By email at the address: my address is on the top of the page in the blue bar on the right...(antispam)
  • On the forum: Eniac Public Forum

Registered Linux User #277832