Writing a Model

Adding a component, interfacing it with the solver, and finding out why it is wrong.

The path from an empty file to a working component: what to declare, which hooks the solver calls and in what order, how a component built from other components is assembled, and how to debug one that runs but produces the wrong answer.

For the equations a model should implement, see Concepts. For worked examples of finished models, see model implementations.


Component and Solver Initialization

How DPsim initializes components and solvers before the first simulation timestep.

Real-Time Execution

Tuning the host and writing a model that can hold a deadline.

Interfacing with the MNA Solver

The hooks a component implements to take part in the nodal solve.

Subcomponent Handling

Building a component out of other components with CompositePowerComp.

Add New Model

Extending the simulator with new component or control models.

Create New Simulation

Using DPsim for a new simulation scenario.

Debugging

Finding the cause when a simulation runs but produces the wrong answer.

Logger Implementation

The classes called a logger, and the seam for adding another.