Awesome
MNA-MAT
A SPICE netlist simulation tool for MATLAB
MNA-MAT in action
The netlist file being simulated is example8.cir (included in this repository). As it is an RC circuit, the simulation type used is Transient analysis.
Standard Analysis
Monte Carlo Analysis
About MNA-MAT
MNA-MAT is a simulation tool designed in MATLAB for solving circuits described as SPICE netlists. It uses the algorithm of Modified Nodal Analysis (MNA). It accepts a file (.cir or .txt) with the SPICE netlist description of the circuit to be simulated. As of now, MNA-MAT supports the following circuit elements :-
- Resistors (R)
- Capacitors (C)
- Inductors (L)
- Independent voltage sources (V)
- Independent current sources (I)
- Voltage controlled voltage sources (VCVS) (E)
- Voltage controlled current sources (VCCS) (I)
- Current controlled voltage sources (CCVS) (H)
- Current controlled current sources (CCCS) (F)
MNA-MAT supports the following simulation types as of present :-
- DC bias point (for purely resistive circuits)
- Transient analysis (for pure C, pure L, RC, RL, LC or RLC circuits)
- Monte Carlo analysis (done using one of the above, again based on the type of circuit)
Note :- This tool works only on versions of MATLAB from R2014b onwards. The voltage source currents are taken in conventional current direction i.e. inside the source, negative to positive terminal.
Features
- Easy to use and then analyse results.
- Accurate (a bunch of circuits were simulated on this tool and then on TopSpice, the results were always identical).
- Saves the results of the previous run simulation.
- No installation or initial setup required. You can start using the tool as soon as you download it.
- No need to add SPICE commands like .TRAN or .DC. A text description of the circuit is enough.
- The written code is flexible - it allows room to make changes and add more features if necessary.
Directions for use
- Before you start using the tool, make sure you have read-write permissions in the folder where the tool files are stored. If you aren't sure about this, simply start up MATLAB as Administrator.
- Place the netlist file (.cir or .txt) you wish to simulate in the folder where the tool files are stored.
- Run the file Main.m.
- Simply follow the on-screen instructions.
What's included
- The three MATLAB tool files.
- A set of 12 examples (.cir SPICE netlists) along with schematics (.png images) of the same.
Just a Request
If you find this tool useful, or at least think it to be ambitious, please consider leaving a star or suggesting changes.
Thank You