Examples for IndexCondition

Christoph Clauß, Sandra Böhme
Fraunhofer Institute for Integrated Circuits, Design Automation Department, Dresden

<< AnalogInsydes`

<< "index.m"

?IndexCondition

Example 1

simple R-C-network

\(\(Net1\  = \ 
        Netlist[
{V, \ {1, \ 0}, Symbolic -> V, 
            Value -> 3}, 
{R1, \ {1, \ 2}, 
            Symbolic -> R1, 
            Value -> 9}, 
{R2, \ {2, \ 3}, 
            Symbolic -> R2, 
            Value -> 14}, 
{C, \ {3, \ 0}, 
            Symbolic -> C, Value -> 0.01}
];\)\)

Default setting for IndexCondition:
      Formulation -> SparseTableau, ElementValues->Value, MatrixOutput->False

IndexCondition[Net1]

means: The index of the STA system of equations is not >1.

IndexCondition[Net1, ElementValues -> Symbolic]

means: The index of the STA system of equations is higher if and only if R1 = -R2.

IndexCondition[Net1, MatrixOutput -> True]

In the case of MNA instead of STA the index properties do not change:

IndexCondition[Net1, Formulation -> ModifiedNodal]

means: The index of the MNA system of equations is not >1.

IndexCondition[Net1, ElementValues -> Symbolic, 
      Formulation -> ModifiedNodal]

means: The index of the MNA system of equations is higher if and only if R1 = -R2.

IndexCondition[Net1, MatrixOutput -> True, 
      Formulation -> ModifiedNodal]

{{{"\n Matrix A: \n",(({{0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0.01`, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}})),"\n Matrix B \n",(({{0, 0, 0, 1, 1, 0}, {0, 0, 0, 0, -1, 1}, {0, 0, 0, 0, 0, -1}, {1, 0, 0, 0, 0, 0}, {-1, 1, 0, 0, 9, 0}, {0, -1, 1, 0, 0, 14}})),"\n Matrix Q: \n",(({{1, 0, 0, 0, 0, 0}, {0, 1, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 1, 0, 0}, {0, 0, 0, 0, 1, 0}, {0, 0, 0, 0, 0, 1}})),"\n Matrix A1: \n",(({{0, 0, 0, 1, 1, 0}, {0, 0, 0, 0, -1, 1}, {0, 0, 0.01`, 0, 0, -1}, {1, 0, 0, 0, 0, 0}, {-1, 1, 0, 0, 9, 0}, {0, -1, 0, 0, 0, 14}}))},-0.23`}}

{{{"\n Matrix A (voll besetzt): \n",(({{0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0.01`, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}})),"\n Matrix B (voll besetzt): \n",(({{0, 0, 0, 1, 1, 0}, {0, 0, 0, 0, -1, 1}, {0, 0, 0, 0, 0, -1}, {1, 0, 0, 0, 0, 0}, {-1, 1, 0, 0, 9, 0}, {0, -1, 1, 0, 0, 14}})),"\n Matrix Q: \n",(({{1, 0, 0, 0, 0, 0}, {0, 1, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 1, 0, 0}, {0, 0, 0, 0, 1, 0}, {0, 0, 0, 0, 0, 1}})),"\n Matrix A1: \n",(({{0, 0, 0, 1, 1, 0}, {0, 0, 0, 0, -1, 1}, {0, 0, 0.01`, 0, 0, -1}, {1, 0, 0, 0, 0, 0}, {-1, 1, 0, 0, 9, 0}, {0, -1, 0, 0, 0, 14}}))},-0.23`}}

Example 2

R-C-network with C-loop

\(\(Net2\  = \ 
        Circuit[
Netlist[
{V, \ {1, \ 
                0}, \ V}, 
{R1, \ {1, \ 2}, \ 
              R1}, 
{R2, \ {2, \ 3}, \ 
              R2}, \ \ \ 
{C1, \ {3, \ 0}, \ 
              C1}, 
{C2, \ {2, \ 0}, \ 
              C2}, 
{C3, \ {2, \ 3}, \ 
              C3}
]];\)\)

IndexCondition[Net2,  ElementValues -> Symbolic]

Independently from values of components, the index is >1.

IndexCondition[Net2, ElementValues -> Symbolic, 
      Formulation -> ModifiedNodal]

Example 3

R-L-C-network

Net3  =  
        Circuit[
Netlist[
{V,  {1,  
                0},  V}, 
{R1,  {1,  2},  
              R1}, 
{R2,  {2,  3},  
              R2},    
{C1,  {3,  0},  
              C1}, 
{C2,  {2,  0},  
              C2}, 
{L3,  {2,  3},  
              L3}     
]
];

IndexCondition[Net3,  ElementValues -> Symbolic]

IndexCondition[Net3, ElementValues -> Symbolic, 
      Formulation -> ModifiedNodal]

Example 4

R-L-C-network

Net4  =  
        Circuit[
Netlist[
{V,  {1,  
                0},   Symbolic  ->  V,    Value  ->  
                15. }, 
{R1,  {1,  2},  
              Symbolic  -> R1,    Value  -> 
                0.01}, 
{R2,  {2,  3},  
              Symbolic  -> R2,    Value  -> 
                1.5},    
{C,  {3,  
                0},   Symbolic  -> C,     Value  ->  
                0.0005}, 
{C2,  {2,  0},  
              Symbolic  -> C2,    Value  ->  
                1.3}, 
{L3,  {2,  3},  
              Symbolic  -> L3,    Value  ->  
                2.875}     
]
];

IndexCondition[Net4,  ElementValues -> Symbolic]

IndexCondition[Net4]

IndexCondition[Net4, ElementValues -> Symbolic, 
      Formulation -> ModifiedNodal]

IndexCondition[Net4, Formulation -> ModifiedNodal]

Example 5

ring-circuit

Net5  =  
        Circuit[
Netlist[
{vtr,   {Tip,  Ring},  vtr}, 
{rb1,  {Tip,  
                1},     rb}, 
{cb1,  {1,  
                0},       cb}, 
{rb2,  {1,  
                A},       rb}, 
{r1,   {A,  
                2},       r1}, 
{c2,   {2,  
                3},       c2}, 
{r2,   {2,  
                3},       r2}, 
{vin,  {3,  
                B},       vin}, 
{rb3,  {B,  
                4},       rb}, 
{cb2,  {4,  
                0},       cb}, 
{rb4,  {4,  
                Ring},    rb}   
]
];

IndexCondition[Net5,  ElementValues -> Symbolic]

IndexCondition[Net5, ElementValues -> Symbolic, 
      Formulation -> ModifiedNodal]

Example 6

Net6  =  
        Circuit[
Netlist[
{V,  {5,  
                6},  V}, 
{Rs,  {5,  4},  
              Rs}, 
{Rk,  {5,  3},  
              Rk}, 
{Rp,  {4,  3},  
              Rp}, 
{Cp,  {4,  3},  Value  -> Cp,  
              Pattern  -> Admittance}, 
{R1,  {3,  2},  
              R1}, 
{L1,  {3,  2},  
              L1}, 
{R3,  {6,  0},  
              R3}, 
{L2,  {6,  0},  
              L2}, 
{C1,  {2,  1},  Value  -> C1,  
              Pattern  ->  Admittance}, 
{R2,  {1,  
                0},  R2}, 
{I1,  {2,  0},  
              IL1}
]
];

sta6 = IndexCondition[Net6,  ElementValues -> Symbolic]

mna6 = 
      IndexCondition[Net6, ElementValues -> Symbolic, 
        Formulation -> ModifiedNodal]

(sta6 - mna6) // Simplify

Example 7

R-C-network with Model
test of IndexCondition for circuits with Models, which are netlists

Net7  =  
        Circuit[
Netlist[
{V,  {1,  
                0},  V}, 
{R1,  {1,  2},  
              R1}, 
{R2,  {2,  3},  
              R2}, 
{C,  {3 -> P,  0 -> N}, 
              Model -> Cload,  Selector -> AC, 
              C ->  C3}
], 
Model[
Name -> Cload,  
Selector -> 
              AC,  
Scope -> 
              Local, 
Ports -> {P,  
                N},  
Parameters -> {C}, 
Definition  -> 
Netlist[ 
{vv, {P,  N,  r,  N},  
                  C}, 
{cc,  {q,  r,  P,  
                    N},  -1}, 
{c,   {q,  N},  
                  1}
]
]
];

IndexCondition[Net7]

IndexCondition[Net7, Formulation -> ModifiedNodal]

Example 8

R-C-network with Model
test of IndexCondition for circuits with behavioural Models
Does not work for circuits with behavioural models, because you have to set MatrixEquation->False. That means no matrix available, but IndexCondition needs this matrix.

Net8  =  
        Circuit[
Netlist[
{V,  {1,  
                0},  V}, 
{R1,  {1,  2},  
              R1}, 
{R2,  {2,  3},  
              R2}, 
{C,  {3 -> P,  0 -> N}, 
              Model -> Cbehav,  Selector -> AC, 
              C ->  C3}
], 
Model[
Name -> Cbehav,  
Selector -> 
              AC,  
Scope -> 
              Local, 
Ports -> {P,  
                N},  
Parameters -> {C}, 
Variables -> {Voltage[P, N], 
                Current[P, 
                  N]}, 
Definition  -> 
Equations[ 
Current[P, N] == 
                  C*Voltage[P, 
                        N]'
]
]
];

IndexCondition[Net8]

IndexCondition[Net8, Formulation -> ModifiedNodal]

Example 9

R-C-network with operational amplifier modeled as norator and nullator

\(\(Net9 = 
        Circuit[
Netlist[
{Vue, \ {vve, 
                0}, Ui}, 
{R0, \ {vve, 1}, 
              Symbolic\  -> R0, \ 
              Value\  -> \ 10000}, 
{R1, \ {2, 0}, 
              Symbolic\  -> \ R1, \ 
              Value\  -> \ 31600}, 
{R2, \ {31, \ 0}, 
              Symbolic\  -> \ R2, \ 
              Value\  -> \ 348000}, 
{R3, \ {out, \ 0}, 
              Symbolic\  -> \ R3, \ Value\  -> \ 15400}, {C1, \ {1, 2}, 
              Symbolic\  -> \ C1, \ 
              Value\  -> \ \((3/2)\)*10^\((\(-9\))\)}, {C2, \ {2, 4}, \ 
              Symbolic\  -> C2, \ 
              Value\  -> \ \((3/2)\)*10^\((\(-9\))\)}, {C3, \ {4, 31}, 
              Symbolic\  -> \ C3, \ 
              Value\  -> \ \((3/2)\)*10^\((\(-9\))\)}, {C4, \ {4, out}, 
              Symbolic\  -> \ C4, \ 
              Value\  -> \ \((3/
                      2)\)*10^\((\(-9\))\)}, 
{Nul, {4, 
                31}, 0}, 
	{Nor, {4, 0}, 
              0}
]
];\)\)

IndexCondition[Net9,  ElementValues -> Symbolic]

IndexCondition[Net9, Formulation -> ModifiedNodal]

Example 10

Same circuit as in example 9, but operational amplifier modeled as voltage-controlled voltage source

Net10 = 
        Circuit[
Netlist[
{Vue,  {vve, 
                0}, Ui}, 
{R0,  {vve, 1}, 
              Symbolic  -> R0,  
              Value  ->  10000}, 
{R1,  {2, 0}, 
              Symbolic  ->  R1,  
              Value  ->  31600}, 
{R2,  {31,  0}, 
              Symbolic  ->  R2,  Value  ->  348000}, {R3,  {out,  0}, 
              Symbolic  ->  R3,  Value  ->  15400}, {C1,  {1, 2}, 
              Symbolic  ->  C1,  
              Value  ->  (3/2)*10^(-9)}, {C2,  {2, 4},  
              Symbolic  -> C2,  
              Value  ->  (3/2)*10^(-9)}, {C3,  {4, 31}, 
              Symbolic  ->  C3,  
              Value  ->  (3/2)*10^(-9)}, {C4,  {4, out}, 
              Symbolic  ->  C4,  
              Value  ->  (3/
                      2)*10^(-9)}, 
{VV, {4, 
                31,  4,  0}, Symbolic  ->  V,  
              Value  -> 
                15000}
]
];

IndexCondition[Net10,  
      ElementValues -> Symbolic]
IndexCondition[Net10] // N

IndexCondition[Net10, ElementValues -> Symbolic, 
      Formulation -> ModifiedNodal]
IndexCondition[Net10, Formulation -> ModifiedNodal] // 
      N

Example 11

network with operational amplifier modeled as norator and nullator

Net11 = 
        Circuit[
Netlist[
{Vue,  {vve, 
                0}, UC}, 
{R0,  {vve, 1}, 
              Symbolic  -> R0,  
              Value  ->  10000}, 
{G7,  {1, 7}, 
              G7}, 
{Nul, {1, 0}, 
              0}, 
{Nor, {7, 0}, 
              0}, 
{R1, {1, 2}, Symbolic  -> R1,  
              Value  ->  1000}, 
{C1, {2, 0}, 
              Symbolic  -> C1,  
              Value  ->  10^(-9)}, 
{R2, {2, 3}, 
              Symbolic  -> R2,  
              Value  ->  1000}, 
{C2, {3, 0}, 
              Symbolic  -> C2,  
              Value  ->  10^(-9)}, 
{R3, {3, 4}, 
              Symbolic  -> R3,  
              Value  ->  1000}, 
{C3, {4, 0}, 
              Symbolic  -> C3,  
              Value  ->  10^(-6)}, 
{R4, {4, 5}, 
              Symbolic  -> R4,  
              Value  ->  1000}, 
{C4, {5, 0}, 
              Symbolic  -> C4,  
              Value  ->  10^(-9)}, 
{R5, {5, 6}, 
              Symbolic  -> R5,  
              Value  ->  1000}, 
{C5, {6, 0}, 
              Symbolic  -> C5,  
              Value  ->  10^(-9)}, 
{R6, {6, 7}, 
              Symbolic  -> R6,  
              Value  ->  
                1000}
]
];

IndexCondition[Net11,  
      ElementValues -> Symbolic]
IndexCondition[Net11]

IndexCondition[Net11, ElementValues -> Symbolic, 
      Formulation -> ModifiedNodal]
IndexCondition[Net11, Formulation -> ModifiedNodal]

Example 12

Same circuit as in example 11, but operational amplifier modeled as voltage-controlled voltage source

\(\(Net12 = 
        Circuit[
Netlist[
{Vue, \ {vve, 
                0}, UC}, 
{R0, \ {vve, 1}, 
              Symbolic\  -> R0, \ 
              Value\  -> \ 10000}, 
{G7, \ {1, 7}, 
              G7}, 
{VV, \ {1, \ 0, \ 7, \ 0}, \ 
              V}, 
{R1, {1, 2}, Symbolic\  -> R1, \ 
              Value\  -> \ 1000}, 
{C1, {2, 0}, 
              Symbolic\  -> C1, \ 
              Value\  -> \ 10^\((\(-9\))\)}, 
{R2, {2, 3}, 
              Symbolic\  -> R2, \ 
              Value\  -> \ 1000}, 
{C2, {3, 0}, 
              Symbolic\  -> C2, \ 
              Value\  -> \ 10^\((\(-9\))\)}, 
{R3, {3, 4}, 
              Symbolic\  -> R3, \ 
              Value\  -> \ 1000}, 
{C3, {4, 0}, 
              Symbolic\  -> C3, \ 
              Value\  -> \ 10^\((\(-6\))\)}, 
{R4, {4, 5}, 
              Symbolic\  -> R4, \ Value\  -> \ 1000}, {C4, {5, 0}, 
              Symbolic\  -> C4, \ 
              Value\  -> \ 10^\((\(-9\))\)}, 			{R5, {5, 6}, 
              Symbolic\  -> R5, \ Value\  -> \ 1000}, {C5, {6, 0}, 
              Symbolic\  -> C5, \ 
              Value\  -> \ 10^\((\(-9\))\)}, 			{R6, {6, 7}, 
              Symbolic\  -> R6, \ 
              Value\  -> \ 
                1000}
]
];\)\)

IndexCondition[Net12,  ElementValues -> Symbolic, 
      MatrixOutput -> False]
IndexCondition[Net12] // N

IndexCondition[Net12, ElementValues -> Symbolic, 
      Formulation -> ModifiedNodal]
IndexCondition[Net12, Formulation -> ModifiedNodal] // 
      Simplify