# Modeling of Conditional Index Changes

## Abstract

An electrical circuit containing switch elements represents a variable
structure system. The structure of the circuit is determined by two
possible switch positions. The behavior of a switch element can be described
by a switch equation using a discrete variable to determine the switch
position. However the causality of a switch element cannot be fixed.
Commercial simulation programs prevent usually the causality problem
for switch elements in a tricky way. A closed switch element is replaced by
a high conductance while an opened switch element is replaced by a high
resistance. Yet this easy unideal solution goes along with the disadvantage
of creating unnatural stiffness in the model. A conditional index system
resulting from switching in a physical system requires fixed causality
assignments that cause conflicts with ideal switch elements.
The idea to resolve the causality assignment was to modify Pantelides
Algorithm to a suitable formulation for conditional index changes by
modifying the corresponding switch equations. However this work shows that the
modification concept cannot solve an easy example. Hence it can be concluded
that merely modifying the switch equations does not bring us closer to the
desired goal, the formulation of a *single model* of an ideal switching
circuit involving conditional index changes that can be simulated in all
switch positions.

However the work resulted in a new idea, the use of *implicit difference
formulae* that makes the modifications of switch equations unnecessary.
The difference formulae widely used in commercial DAE solvers substitute the
original derivatives in inductor and capacitor equations. The new concept is
used to simulate the earlier mentioned easy example and a more complex
circuit for train speed control. The mathematical description for the complex
circuit pointed out that there are remaining singular cases. These singular
cases are investigated and can be explained by the nature of an ideal switch
simulation. In the sequel several possibilities to prevent these singularities
are introduced and explained.