2
$\begingroup$

I have always taken for granted circuit simulators and I didn't spend time understanding now. I wish to understand better now.

Normally when you forward simulate ODE systems there is a single dynamic equation which you forward integrate(ex, simplest way is Eulers method). What I am wondering about is in the case of circuit design (SPICE, LT-SPICE, etc) how do you maintain the core constraints of the system? EX KCL and KVL (Kirchoff voltage/current law) constraints always need to be maintained and it's not clear how these constraints can be factored in when integrating system dynamics.

$\endgroup$
3
  • 2
    $\begingroup$ The circuit is treated as a DAE system. As far as I know, it is rather hard to construct a realistic circuit that has index 3 or higher, and systems of lower differentiation index can be handled with (suitably modified) solvers for stiff systems. $\endgroup$ Oct 23 '21 at 6:00
  • $\begingroup$ Thanks, do you have any resources that give an overview of this? $\endgroup$ Oct 23 '21 at 6:07
  • 2
    $\begingroup$ I'm guessing that KCL and KVL stand for Kirchhoff's laws, but I might be wrong. Could you add it to your question? $\endgroup$
    – nicoguaro
    Oct 23 '21 at 11:16
2
$\begingroup$

The supplementary documentation of the Xyce circuit simulator contains a report titled Mathematical Formulation that details how the simulator works.

$\endgroup$
1
  • 1
    $\begingroup$ Thanks, I also found some discussion on a SPICE website. I wonder what existence/uniqueness theorems exist for these systems. A straightforward extension of Picard iteration? $\endgroup$ Oct 24 '21 at 21:36
1
$\begingroup$

I would add that Kirchhoff's laws are conservation laws for charge and energy. Thus, the constraints are already built into your equations. You are still lacking constitutive equations for each component (resistor, capacitor, ...). I would say that in general these two elements leads one to the equations for a physical system.

Regarding the numerical solution satisfying the conservation equations, it should satisfy them approximately. That's not always true, though. For that you would need to prove some things like consistency and stability, for example.

Also, there are some families of numerical integrators that are conservative, but I normally see those applied to mechanical problems.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.