# Changes

## Ocs package

, 02:58, 22 September 2015
== History and Motivation ==
== Problem Formulation ==

The circuit description in OCS is based on (a variant of) modified nodal analysis (MNA) model for lumped-element networks.
It is easy to verify that the common charge/flux-based MNA model is a special case of the model presented below.

We consider a circuit with M elements and N nodes, the core of the MNA model is a set of N equations of the form
$\sum_{{m}=1}^{M} F_{mn} = 0 \qquad n = 1, \, \ldots \, ,N$
where $F_{mn}$ denotes the current from the node n due to element m.

The equations above are the Kirchhoff current law (KCL) for each of the electrical nodes of the network.

The currents can be expressed in terms of the node voltages $e$ and the internal variables $r_m \; (m = 1\ldotsM)$

F_{mn} = A_{mn} \dot{\mathbf{r}}_{m} + J_{mn} \left( \mathbf{e}, \mathbf{r}_{m} \right) \qquad \begin{aligned} n &=& 1, \, \ldots \, ,N \\ m &=& 1, \, \ldots \, ,M \end{aligned}

Notice that the variables ${\mathbf{r}}_{m}$ only appear in the equations defining the fluxes relative to the m-th element, for this reason they are sometimes referred to as internal variables of the m-th element.

The full MNA model is finally obtained by substituting the current definitions in the KCL and complementing it with a suitable number <matj>I_{m}</matj> of constitutive relations for the internal variables of each element
\begin{gather} \Sum_{{m}=1}^{\nel} \left[ \ A_{mn} \dot{\mathbf{r}}_{m} + J_{mn} \left( \mathbf{e}, \boldsymbol{\theta}, \mathbf{r}_{m} \right) \right] = 0 \qquad {n} = 1, \, \ldots \, ,\nnodes \\ \label{eq:abstractmnab} B_{mi} \dot{\mathbf{r}}_{m} + Q_{mi}\ \left( \mathbf{e}, \boldsymbol{\theta}, \mathbf{r}_{m} \right) = 0. \qquad \begin{aligned} {i} = 1, \, \ldots \, ,{I}_m \\ {m} = 1, \, \ldots \, ,\nel \end{aligned} \end{gather}
Notice that the assumption that only time derivatives of internal variables appear above and that terms involving such derivatives are linear does not impose restrictions on the applicability of the model.
== Data Structure ==
344

edits