JUK1
|
The main class to hold all of the relevant simulation data. More...
#include <Simulator.hpp>
Public Member Functions | |
SimulationEnvironment (std::string netlistPath) | |
Setup the simulation environment from a netlist. More... | |
void | setDCOpPoint () |
a function to determine and set the DC operating point More... | |
void | simulate () |
Where a lot of the magic starts. This is what runs the simulation. More... | |
void | printGraph (size_t node) |
Outputs a single node's (or current's) time series to a graph, saving as both eps and png. More... | |
void | printMultipleOnGraph (std::vector< size_t > nodeVec, std::string suffix="") |
Similar to printGraph, but instead can plot multiple series on the same graph. More... | |
void | dataDump () |
Simple function to dump the output of the simulator in a matlab table readable format. More... | |
Private Member Functions | |
void | parseGraph (std::string line) |
Helper function to pull indices from graph netlist directive. More... | |
Private Attributes | |
std::string | outputFilePath = "datadump.txt" |
std::string | netlistPath = "" |
double | initialTime |
double | timestep |
double | finalTime |
size_t | steps |
size_t | numNodes = 1 |
size_t | numCurrents = 0 |
size_t | numDCCurrents = 0 |
bool | performDCAnalysis = true |
CircuitElements< VT > | elements |
A collection of all the circuit elements. More... | |
LUPair< VT > | luPair |
Preallocated space to prevent repeated allocations and deallocations. More... | |
Matrix< VT > | scratchSpace |
Preallocated space to prevent repeated allocations and deallocations. using during the leftDivide to solve the MNA system. More... | |
std::vector< std::vector< size_t > > | nodesToGraph |
Keeps track of the nodes to be graphed after simulation. More... | |
Matrix< VT > | solutionMat |
Preallocated space to store the results in. More... | |
The main class to hold all of the relevant simulation data.
VT | The type used for values. e.g. double, float, etc |
Definition at line 46 of file Simulator.hpp.
|
inline |
Setup the simulation environment from a netlist.
netlistPath | Path to the netlist that is going to be used in the simulation |
Definition at line 52 of file Simulator.hpp.
|
inline |
Simple function to dump the output of the simulator in a matlab table readable format.
Definition at line 392 of file Simulator.hpp.
|
inlineprivate |
Helper function to pull indices from graph netlist directive.
line | The line to parse |
Definition at line 466 of file Simulator.hpp.
|
inline |
Outputs a single node's (or current's) time series to a graph, saving as both eps and png.
node | The index of the node to plot |
Definition at line 333 of file Simulator.hpp.
|
inline |
Similar to printGraph, but instead can plot multiple series on the same graph.
nodeVec | A vector of node indices |
suffix | What's appended to "Graph" to make the name of the output file. |
Definition at line 362 of file Simulator.hpp.
|
inline |
a function to determine and set the DC operating point
Definition at line 230 of file Simulator.hpp.
|
inline |
Where a lot of the magic starts. This is what runs the simulation.
This function is a simple newton-raphson solver, it still has room for improvement, such as early termination when the loop converges.
After the simulation has run to completion, the raw data is dumped, and any graphs that were due to be generated are created.
Definition at line 265 of file Simulator.hpp.
|
private |
A collection of all the circuit elements.
Definition at line 493 of file Simulator.hpp.
|
private |
Definition at line 485 of file Simulator.hpp.
|
private |
Definition at line 483 of file Simulator.hpp.
|
private |
Preallocated space to prevent repeated allocations and deallocations.
Definition at line 496 of file Simulator.hpp.
|
private |
Definition at line 481 of file Simulator.hpp.
|
private |
Keeps track of the nodes to be graphed after simulation.
Definition at line 502 of file Simulator.hpp.
|
private |
Definition at line 489 of file Simulator.hpp.
|
private |
Definition at line 490 of file Simulator.hpp.
|
private |
Definition at line 488 of file Simulator.hpp.
|
private |
Definition at line 480 of file Simulator.hpp.
|
private |
Definition at line 491 of file Simulator.hpp.
|
private |
Preallocated space to prevent repeated allocations and deallocations. using during the leftDivide to solve the MNA system.
Definition at line 499 of file Simulator.hpp.
|
private |
Preallocated space to store the results in.
Definition at line 505 of file Simulator.hpp.
|
private |
Definition at line 486 of file Simulator.hpp.
|
private |
Definition at line 484 of file Simulator.hpp.