#import "@preview/mannot:0.3.1"
#import "@preview/zap:0.5.0"
#import "@preview/cetz:0.4.2": *
#import "@preview/cetz-plot:0.1.3"
#import "@preview/unify:0.7.1": num, qty, unit
#import "@preview/cetz-plot:0.1.3"
#import "@preview/grayness:0.5.0": image-grayscale, image-crop

#import "../lib/schaltungstheorie/opampTable.typ": *
#import "../lib/schaltungstheorie/tumCustomSymbols.typ" as tumSymbols

#import "../lib/circuit.typ": *
#import "../lib/common_rewrite.typ": *
#import "../lib/circuit.typ": *


#set math.mat(delim: "[")
#show math.equation.where(block: true): it => math.inline(it)
#set math.mat(delim: "[")
#show math.integral: it => math.limits(math.integral)
#show math.sum: it => math.limits(math.sum)
#let jVec(x) = $bold(underline(#x))$
#let jMat(x) = $bold(#x)$

#set page(
  paper: "a4",
  margin: (
    bottom: 10mm,
    top: 5mm,
    left: 5mm,
    right: 5mm,
  ),
  flipped: true,
  footer: context [
    #grid(
      align: center,
      columns: (1fr, 1fr, 1fr),
      [#align(left, datetime.today().display("[day].[month].[year]"))],
      [#align(center, counter(page).display("– 1 –"))],
      [#align(right, image("../images/cc0.png", height: 5mm))],
    )
  ],
)

#let colorAllgemein = color.hsl(105.13deg, 92.13%, 75.1%)
#let colorEigenschaften = color.hsl(145.13deg, 92.13%, 75.1%)
#let colorEineTore = color.hsl(202.05deg, 92.13%, 75.1%)
#let colorZweiTore = color.hsl(235.9deg, 92.13%, 75.1%)
#let colorAnalyseVerfahren = color.hsl(280deg, 92.13%, 75.1%)
#let colorComplexAC = color.hsl(356.92deg, 92.13%, 75.1%)
#let colorMathe = color.hsl(34.87deg, 92.13%, 75.1%)

#place(top + center, scope: "parent", float: true, heading(
  [Schaltungstheorie],
))

#set text(8.5pt)

#columns(4, gutter: 2mm)[
  // Allgemein
  #bgBlock(fill: colorAllgemein)[
    #subHeading(fill: colorAllgemein)[Allgemeine]
    *Konzentriertheitshypotese*\
    $lambda >> d quad quad lambda = c/f quad quad c approx 3.10dot 10^8 m/s$

    d: größe Bauteil Dimension

    f: Maximal Frequenze

    *Kirchhoff*

    #grid(
      columns: (1fr, 1fr),
      row-gutter: 5mm,
      [
        KCL: $sum_(k=1)^n i_k =0$ (Knotenregel)
      ],
      /*[
        #cetz.canvas(length: 8mm, {
          import cetz.draw: *

          circle((0, 0), radius: 1)

          line((angle: 0deg, radius: 0.2), (angle: 0deg, radius: 1.5), stroke: red)
          line((angle: 120deg, radius: 1.5), (angle: 120deg, radius: 0.2), stroke: red)
          line((angle: 240deg, radius: 1.5), (angle: 240deg, radius: 0.2), stroke: red)

          set-style(mark: (end: "straight"))
          line((angle: 0deg, radius: 0.2), (angle: 0deg, radius: 0.8), stroke: red)
          line((angle: 120deg, radius: 1.2), (angle: 120deg, radius: 0.4), stroke: red)
          line((angle: 240deg, radius: 1.2), (angle: 240deg, radius: 0.4), stroke: red)
        })
      ],*/

      [
        KVL: $sum_(k=1)^n u_k =0$ (Maschenregel)
      ],
      /*[
        #zap.circuit({
          import zap: wire
          import cetz.draw: *

          registerAllCustom()

          einTor("F1", (0, -1), (0, 1))
          einTor("F2", (1.5, 0), (1.5, 1), flip: true)
          einTor("F3", (1.5, 0), (1.5, -1), flip: true)
          wire((0, -1), (1.5, -1))
          wire((0, 1), (1.5, 1))

          translate((0.75, 0))
          circle((0, 0), radius: 4mm, stroke: blue)
          translate((0, 1mm))
          mark((angle: 180deg, radius: 4mm), 90deg, symbol: "straight", stroke: blue, scale: 0.75)
          translate((0, -2mm))
          mark((angle: 0deg, radius: 4mm), 270deg, symbol: "straight", stroke: blue, scale: 0.75)
        })
      ],*/
    )

    $u dot i > 0$: Nimmt Energie auf\
    $u dot i = 0$: Verlustlos\
    $u dot i < 0$: Gibt Energie ab\
  ]

  // Verschaltung
  #bgBlock(fill: colorAllgemein)[
    #subHeading(fill: colorAllgemein)[Verschaltung]

    $1/x_"ges" = 1/x_1 + 1/x_2 + 1/x_3 + ...$

    $x_1 parallel x_2 = 1/(1/x_1 + 1/x_2) = (x_1 x_2)/(x_1 + x_2)$

    $x_1 parallel x_2 parallel x_3 = (x_1 x_2 x_3)/(x_1 x_2 + x_2 x_3 + x_1 x_3)$

    #table(
      columns: (1fr, 1fr),
      fill: (x, y) => if calc.rem(x, 2) == 1 { tableFillLow } else { tableFillHigh },

      [*Serie*], [*Reihe/Parrallel*],

      align(
        horizon + center,
        scale(100%, zap.circuit({
          import zap: *

          resistor("R1", (0, 0.375), (1.5, 0.375), fill: none, width: 1, height: 0.4)
          resistor("R2", (1.5, 0.375), (3, 0.375), fill: none, width: 1, height: 0.4)
        })),
      ),
      align(
        horizon + center,
        scale(
          100%,
          zap.circuit({
            import zap: *

            resistor("R1", (0, 0), (2, 0), fill: none, width: 1, height: 0.4)
            resistor("R2", (0, 0.75), (2, 0.75), fill: none, width: 1, height: 0.4)
            wire("R1.in", "R2.in")
            wire("R1.out", "R2.out")

            node("N2", (0, 0.375))
            node("N3", (2, 0.375))

            wire("N2", (rel: (-0.3, 0)))
            wire("N3", (rel: (0.3, 0)))
          }),
        ),
      ),

      $R_"ges" = R_1+R_2$, $R_"ges" = R_1 parallel R_2$,
      $G_"ges" = G_1 parallel G_2$, $G_"ges" = G_1 + G_2$,
      $L_"ges" = L_1 + L_2$, $L_"ges" = L_1 parallel L_2$,
      $C_"ges" = C_1 parallel C_2$, $C_"ges" = C_1 + C_2$,

      $U_"ges" = U_1 + U_2$, $U_"ges" = U_1 = U_2$,
      $I_"ges" = I_1 = I_2$, $I_"ges" = I_1 + I_2$,
      [In $U$-Richtung Addieren], [In $I$-Richtung Addieren],
    )
  ]


  // Quell Wandlung
  #bgBlock(fill: colorEineTore)[
    #subHeading(fill: colorEineTore)[Ein-Tor]

    #grid(
      columns: (auto, auto),
      column-gutter: 3mm,
      zap.circuit({
        import zap: *
        registerAllCustom()
        einTor(
          "F1",
          (0, 0),
          (2, 0),
          i: (content: $i_(cal(F),1)$, anchor: "south-east", label-distance: -10pt),
          u: $u_1$,
        )
        einTor("F1", (0, 0), (2, 0), i: (content: $i_(cal(F),2)$, anchor: "west", label-distance: -10pt, invert: true))
      }),
      [
        Tor-Bedinung:\
        $i_(cal(F),2) = i_(cal(F),1)$
      ],
    )

    *Kennline Addition* \

    #grid(
      columns: (1fr, auto, 1fr),
      row-gutter: 2mm,
      column-gutter: 3mm,
      [Parallel-Schaltung], $-->$, [$i$-Richtung],
      [Reihe-Schaltung], $-->$, [$u$-Richtung],
    )

    Bei Idealer Diode: Ruhe Bewahren. \
    Sich vorstellen als hätte die Diode eine endlich Steigung!
  ]

  #bgBlock(fill: colorAllgemein)[
    #subHeading(fill: colorAllgemein)[Spannungs Teiler/Strom Teiler]

    #table(
      columns: (1fr, 1fr),
      fill: (x, y) => if calc.rem(x, 2) == 1 { tableFillLow } else { tableFillHigh },
      [*Spannungsteiler*],
      [*Stromteiler*],
      zap.circuit({
        import zap : *

        node("N1", (0,1.5))
        node("N2", (0,0))
        node("N3", (0,-1.5))

        resistor("R1", "N1", "N2", label: (content: $R_2$, distance: 0.1), scale: 0.7, fill: none)
        resistor("R2", "N2", "N3", label: (content: $R_1$, distance: 0.1), scale: 0.7, fill: none)

        joham.voltage((-0.4, 0), (-0.4, -1.5), $u_"out"$)
        joham.voltage((0.8, 1.5), (0.8, -1.5), $u_"ges"$, anchor: "west")

        wire((-0.6, 1.5),(0.8, 1.5))
        wire((-0.6, -1.5),(0.8, -1.5))
        wire((-0.6, 0),(0,0))
      }),
      zap.circuit({
        import zap : *

        node("N1", (0,0))
        node("N2", (0,2))

        resistor("R1", "N1", "N2", label: (content: $R_1$, distance: 0.1), scale: 0.7, fill: none, i: (content: $i_"out"$, anchor: "south", distance: 0.25, invert: true))
        resistor("R2", (1,0), (1,2), label: (content: $R_2$, distance: 0.1), scale: 0.7, fill: none)

        wire((-1, 0), "R2.in")
        wire((-1, 2), "R2.out")
        wire((-1, 2), "N2", i: (content: $i_"ges"$, distance: 0.1))

      }),
      $ u_"out" = R_1/(R_1 + R_2) $, $ i_"out" = R_2/(R_1 + R_2) i_"ges" $,
      $ u_"out" = G_2/(G_1 + G_2) $, $ i_"out" = G_1/(G_1 + G_2) i_"ges" $
    )
  ]

  // Lineare Quelle
  #bgBlock(fill: colorEineTore)[
    #subHeading(fill: colorEineTore)[Lineare Quelle]

    #align(
      center + horizon,
      cetz.canvas({
        import cetz.draw: *
        import cetz-plot: *
        plot.plot(
          size: (3, 3),
          name: "plot",
          axis-style: "school-book",
          x-label: "u",
          y-label: "i",
          x-tick-step: none,
          y-tick-step: none,
          axes: ("u", "i"),
          x-min: -1,
          x-max: 2,
          x-grid: "both",
          y-min: -2,
          y-max: 1,
          y-grid: "both",
          {
            plot.add(((-2, -3), (3, 2)))
            plot.add-anchor("u0", (1, 0))
            plot.add-anchor("i0", (0, -1))
          },
        )

        content("plot.u0", $U_0$, anchor: "south", padding: .2)
        content("plot.i0", $-I_0$, anchor: "east", padding: .2)

        mark("plot.u0", 0deg, symbol: "+", fill: black)
        mark("plot.i0", 0deg, symbol: "+", fill: black)

        line(
          "plot.i0",
          (horizontal: "plot.u0", vertical: "plot.i0"),
          "plot.u0",
          stroke: (dash: "dashed", paint: rgb("#005c00")),
        )

        content(
          (horizontal: "plot.u0", vertical: "plot.i0"),
          anchor: "south-west",
          text(rgb("#005c00"))[$R$],
          padding: 0.1,
        )
      }),
    )

    $U_0$: LL-Spannung ($i = 0 => u = U_0$) \
    $I_0$: KS-Strom ($u = 0 => i = -I_0$)

    $R_i$: Innenwiderstand $R_i = U_0/I_0$

    *Quell Wandlung*
    #table(
      columns: (1fr, 1fr),
      fill: (x, y) => if calc.rem(x, 2) == 1 { tableFillLow } else { tableFillHigh },
      inset: 3mm,
      align(center, [
        *$u$-gesteuert* \
        Helmholz / Thévenin
      ]), align(center, [
        *$i$-gesteuert* \
        Mayer / Norton
      ]),

      align(
        horizon + center,
        zap.circuit({
          import zap: *
          import cetz.draw

          zap.resistor("R1", (1, 0), (1, -1.5), fill: none, width: 0.8, height: 0.3)
          zap.isource("I0", (0, 0), (0, -1.5), fill: none, scale: 0.6, i: (
            content: $-I_0$,
            distance: 6pt,
            label-distance: -11pt,
            anchor: "west",
            invert: true,
          ))
          node("N0", "R1.in")
          node("N0", "R1.out")

          wire("I0.out", "R1.out", (rel: (0.5, 0)))
          wire("I0.in", "R1.in")
          wire("R1.in", (rel: (0.5, 0)), i: (content: $i$, invert: true))

          cetz.draw.content((0.62, -0.75), [$G_i$])
          cetz.draw.set-style(mark: (end: ">", fill: black, scale: 0.6))
          cetz.draw.content((1.7, -0.75), [$u$])
          cetz.draw.line((1.5, -0.1), (1.5, -1.4), stroke: 0.5pt)
        }),
      ),
      align(
        horizon + center,
        zap.circuit({
          import zap: *
          import cetz.draw

          zap.vsource("U0", (0, 0), (0, -1.5), fill: none, scale: 0.6, u: (
            content: $U_0$,
            distance: -4pt,
            label-distance: -8pt,
            anchor: "south-west",
            invert: true,
          ))
          zap.resistor("R1", (0, 0), (1.75, 0), fill: none, width: 0.8, height: 0.3, i: (
            content: $i$,
            invert: true,
            distance: 0.3,
          ))
          wire((0, -1.5), (1.75, -1.5))

          cetz.draw.content((0.9, -0.4), [$R_i$])
          cetz.draw.set-style(mark: (end: ">", fill: black, scale: 0.6))
          cetz.draw.content((1.95, -0.75), [$u$])
          cetz.draw.line((1.75, -0.1), (1.75, -1.4), stroke: 0.5pt)
        }),
      ),

      [
        $u = R_i i + U_0$ \

      ],
      [
        $i = G_i u - I_0$
      ],


      table.cell(colspan: 2)[
        #align(center, [*$u"-gesteuert" --> i"-gestuert"$*])

        $ R_i = 1/G_i quad quad quad U_0 = -I_0 1/G_i $
      ],

      table.cell(colspan: 2, fill: tableFillLow)[
        #align(center, [*$i"-gesteuert" --> u"-gestuert"$*])

        $ G_i = 1/R_i quad quad quad I_0 = -U_0 1/R_i $
      ],
    )
  ]

  /*// Quell Wandlung
  #bgBlock(fill: colorEineTore)[
    #subHeading(fill: colorEineTore)[Quelle Wandlung]

    #grid(
      columns: (1fr, 1fr),
      align: center,
      scale(x: 65%, y: 65%,
        zap.circuit({
          import zap : *
          import cetz.draw : line, content

          vsource("U0", (0, 1.5), (0, -1.5), fill: none)

          node("n2", (3.5,1.5), fill: false)
          node("n3", (3.5,-1.5), fill: false)

          resistor("R0", "U0.in", "n2", fill: none, label: (content: $R_i$, anchor: "south", distance: 0.1))
          wire("U0.out", "n3")

          wire((2.49,1.5), "n2", i: (content: $i$, anchor: "south", invert: true))

          set-style(mark: (end: ">", fill: black))
          line((3.5, 1.2), (3.5, -1.2), stroke: 0.5pt)
          content((3.9, 0), $u$)

          line((0.7, 0.5), (0.7, -0.5), stroke: 0.5pt)
          content((1.7, 0), $U_0 = I_0 / G_i$)
      })),
      scale(x: 65%, y: 65%,
      zap.circuit({
        import zap : *
        import cetz.draw : line, content

        isource("I0", (0, 1.5), (0, -1.5), fill: none)
        node("n0", (2,1.5))
        node("n1", (2,-1.5))

        node("n2", (3.5,1.5), fill: false)
        node("n3", (3.5,-1.5), fill: false)

        resistor("g0", "n1", "n0", fill: none, label: (content: $G_i$, anchor: "south", distance: 0.2))
        wire("I0.in", "n0", "n2")
        wire("I0.out", "n1", "n3")
        wire("n0", "n2", i: (content: $i$, anchor: "south", invert: true))
        wire((0,0.6), "I0.in", i: (content: $I_0 = U_0 / R_i$, anchor: "east", invert: false, distance: 0.2))

        set-style(mark: (end: ">", fill: black))
        line((3.5, 1.2), (3.5, -1.2), stroke: 0.5pt)
        content((3.9, 0), $u$)
      })),
      [
        $U_0 = I_0 R_i$

        $R_i=1/G_i$

        $u = r(i) = R_i i + U_0$
      ],
      [
        $I_0 = U_0 G_i$

        $G_i=1/R_i$

        $i = g(u) = G_i u + I_0$
      ]
    );
  ]
  */

  // Dual Wandlung
  #bgBlock(fill: colorAllgemein)[
    #subHeading(fill: colorAllgemein)[Dual Wandlung]
    Stumpfe Ersetzung mit:

    #table(
      columns: (1fr, 1fr),
      fill: (x, y) => if calc.rem(y, 2) == 0 { tableFillHigh } else { tableFillLow },
  
      $ u --> R_d i^d $,
      $ i --> u^d / R_d $,
      $ Phi --> R_d q^d $,
      $ q --> Phi / R_d $,

      $ R --> G^d = R / R_d^2 $,
      $ G --> R^d = R_d^2 G $,

      $C --> L^d = R_d^2 C$,
      $L --> C^d = L / R_d^2$,

      $"KS" --> "LL"$, $"LL" -> "KS"$,
      $"Nullator" --> "Nullator"$, $"Norator" -> "Norator"$,

      $"Parallel" --> "Seriell"$,
      $"Seriell" --> "Parallel"$,

      table.cell(colspan: 2)[
      *Dualwandlung: Steurende & Ausgangs Größe*  
      $
        "VCVS" &: u_"out" &= mu dot u_"in"   &--> i_"out"^d = mu i_"in"^d\
        "VCCS" &: i_"out" &= g dot u_"in"    &--> u_"out"^d = g R_d^2 dot i_"in"^d \
        "CCVS" &: u_"out" &= r dot i_"in"    &--> i_"out"^d = r/R_d^2 dot u_"in"\
        "CCCS" &: i_"out" &= beta dot i_"in" &--> u_"out"^d = beta u_"in"^d\
      $
      ],

      table.cell(colspan: 2)[$ (u, i) in cal(F) --> (u_d, i_d) in cal(F) = (R_d i, 1/R_d u) $]
    )
  ]

  // Linearsierung
  #bgBlock(fill: colorEineTore)[
    #subHeading(fill: colorEineTore)[Linearisierung (Ein-Tore)]

    1. Arbeitspunkt bestimmen \ $"AP" =(u_"AP", i_"AP")$

    2. Ableitung $g_cal(F)(u)$/$r_cal(F)(i)$ bilden \ $g'_cal(F)(u)$/$r'_cal(F)(i)$

    #line(length: 100%)

    *Stromgesteuert*

    *Groß-Signal* \
    #grid(columns: (1fr, 1fr),
      column-gutter: 4mm,
      $I_0 = i_"AP" - g'_cal(F)(u_"AP")u_"AP"$,
      $g_0 = g'_cal(F)(u_"AP")u$
    )

    #linebreak()

    $i_"lin" = g_"lin" (u) = g'_cal(F)(u_"AP")(u-u_"AP") + i_"AP"\
    i_"lin" = g_"lin" (u) = g_0 u + I_0$

    #block(
      height: 20mm,
      scale(x: 75%, y: 75%, zap.circuit({
        import zap: *
        import cetz.draw: content, line

        isource("I0", (0, 1.5), (0, -1.5), fill: none)
        node("n0", (2, 1.5))
        node("n1", (2, -1.5))

        node("n2", (3.5, 1.5), fill: false)
        node("n3", (3.5, -1.5), fill: false)

        resistor("g0", "n1", "n0", fill: none, label: (content: $g_0$, anchor: "south", distance: 0.2))
        wire("I0.in", "n0", "n2")
        wire("I0.out", "n1", "n3")
        wire("n0", "n2", i: (content: $i_"lin"$, anchor: "south", invert: true))
        wire((0, 0.6), "I0.in", i: (content: $I_0$, anchor: "east", invert: true))

        set-style(mark: (end: ">", fill: black))
        line((3.5, 1.2), (3.5, -1.2), stroke: 0.5pt)
        content((3.9, 0), $u$)
      })),
    );

    #linebreak()

    *Klein-Signal* $quad Delta i_"lin" = g_"lin" (Delta u) = g'(u_"AP") Delta u$

    #line(length: 100%)


    *Spannungsgesteuert*

    *Groß-Signal* \
    #grid(columns: (1fr, 1fr),
      column-gutter: 4mm,
      $U_0 = u_"AP" - r'(i_"AP") i_"AP"$,
      $r_0 = r'(i_"AP")$
    )
    #linebreak()
    $u_"lin" = r_"lin" (i) = r'(i_"AP")(i-i_"AP") + u_"AP"\
    u_"lin" = r_"lin" (i) = r_0 i + U_0$
    #block(
      height: 25mm,
      scale(x: 75%, y: 75%, zap.circuit({
        import zap: *
        import cetz.draw: content, line

        vsource("U0", (0, 1.5), (0, -1.5), fill: none)

        node("n2", (3.5, 1.5), fill: false)
        node("n3", (3.5, -1.5), fill: false)

        resistor("R0", "U0.in", "n2", fill: none, label: (content: $r_0$, anchor: "south", distance: 0.1))
        wire("U0.out", "n3")

        wire((2.49, 1.5), "n2", i: (content: $i$, anchor: "south", invert: true))

        set-style(mark: (end: ">", fill: black))
        line((3.5, 1.2), (3.5, -1.2), stroke: 0.5pt)
        content((3.9, 0), $u_"lin"$)

        line((0.7, 0.5), (0.7, -0.5), stroke: 0.5pt)
        content((1.2, 0), $U_0$)
      })),
    );
    #linebreak()
    *Klein-Signal* $quad Delta u_"lin" = r_"lin" (Delta i) = r'(i_"AP") Delta i$
  ]

  // Graphen und Matrizen
  #bgBlock(fill: colorAnalyseVerfahren)[
    #subHeading(fill: colorAnalyseVerfahren)[Graphen und Matrizen]

    $n:$ Knotenanzahle (mit Referenzknoten)

    $b:$ Zweiganzahle

    *Lineare Unabhänige KCL/KVLs*

    Für $2b$ unbekannte ($b$ Ströme + $b$ Spannungen)

    KCLs: $n-1$\
    KVLs: $b-(n-1)$

    #line(length: 100%, stroke: (thickness: 0.2mm))

    $bold(i_b)$ (oder $bold(i)$): Zweigstrom-Vektor \
    $bold(u_b)$ (oder $bold(u)$): Zweigspannungs-Vektor \
    $bold(i_m)$ : Maschenstrom-Vektor \
    #text(rgb(20%, 20%, 20%))[(Strom in einer viruellen Masche)] \
    $bold(u_k)$ : Kontenspannungs-Vektor \
    #text(rgb(20%, 20%, 20%))[(Spannung zwischen Referenzknoten und Knoten k)] \

    #line(length: 100%, stroke: (thickness: 0.2mm))

    Knotenzidenzmatrix $bold(A)$

    $bold(A) : bold(i_k) -> text("Knotenstrombilanz") = 0$ \
    $bold(A^T) : bold(u_b)-> bold(u_k)$
    $
      bold(A) = quad space space mannot.mark(
        mat(
          a_11, a_12, ..., a_(1m);
          a_21, a_22, ..., a_(2m);
          dots.v, dots.v, dots.down, dots.v;
          a_(n 1), a_(n 2), ..., a_(n m)
        ), tag: #<1>
      )
      #mannot.annot(<1>, pos: left, text(rgb("#404296"))[#rotate(-90deg)[$<-$ Knoten \ ($n-1$)]], dx: 2mm)
      #mannot.annot(<1>, pos: bottom, text(rgb("#404296"))[Zweige ($b$) $->$], dy: -0.5mm)
      a in {-1, 0, 1}
    $
    #linebreak()
    $-1 &: "In Knoten rein" \
    1 &: "Aus Knoten raus"$

    #line(length: 100%, stroke: (thickness: 0.2mm))

    Mascheninsidenz Matrix $bold(B)$\


    $bold(B) : bold(u_b) -> text("Zweigspannungsbilanz") = 0$ \
    $bold(B^T) : bold(i_m) -> i_b$

    $ 
      bold(B) = quad space space mannot.mark(mat(
        b_11, b_12, ..., b_(1m);
        b_21, b_22, ..., b_(2m);
        dots.v, dots.v, dots.down, dots.v;
        b_(n 1), b_(n 2), ..., b_(n m)
      ), tag: #<1>)

      #mannot.annot(<1>, pos:left, text(rgb("#404296"))[#rotate(-90deg)[$<-$ Maschen \ $b-(n-1)$]], dx: 4mm)
      #mannot.annot(<1>, pos:bottom, text(rgb("#404296"))[Zweige ($b$) $->$], dy: -0.5mm)

      b in {-1, 0, 1}
    $

    #linebreak()
    $-1 &: "Gegen Maschenrichtung" \
    1 &: "In Maschenrichtung"$

    #line(length: 100%, stroke: (thickness: 0.2mm))

    #colbreak()
    *KCL und KVL* \

    KCL in Nullraum: $bold(A) bold(i_b) = bold(0)$ \
    KVL in Bildraum: $bold(A^T) bold(u_k) = bold(u_b)$

    KVL in Nullraum: $bold(B) bold(u_b) = bold(0)$ \
    KCL in Bildraum: $bold(B^T) bold(i_m) = bold(i_b)$ \

    #line(length: 100%, stroke: (thickness: 0.2mm))


    *Tellegen'sche Satz* \
    $bold(A B^T) = bold(B^T A) = 0$ \
    $bold(u_b^T i_b) = 0$
  ]

  // Baumkonzept
  #bgBlock(fill: colorAnalyseVerfahren)[
    #subHeading(fill: colorAnalyseVerfahren)[Baumkonzept]


    1. Baum einzeichnen (Keine Schleifen!) \
      Muss alle Knoten umfassen

    2. $n-1$ KCLs: \
      Superknoten mit NUR einer Baumkante \
      $jMat(A) = mat(jMat(1)_(n-1), jMat(A)_e)$ \
    

    3. $b - (n-1)$ KVLs: \
      Maschen mit NUR einer NICHT Baumkante \
      $jMat(B) = mat(jMat(B)_t, jMat(1)_(b-(n-1)))$


    *Nur bei Baumkonzept:* $B_t = - A_e^T$

  ]

  // Tablauematrix
  #bgBlock(fill: colorAnalyseVerfahren)[
    #subHeading(fill: colorAnalyseVerfahren)[Allgemeine Analyse Verfahren]

    *Tableaugleichung*

    Alle Element Gleichungen in Nullraum + KVLs/KCLs in eine Matrix

    KCLs in Nullraum: $jMat(A) jVec(i)_b = jVec(0)$\
    KVLs in Nullraum: $jMat(B) jVec(u)_b = jVec(0)$\
    Elementgleichungen: $jMat(N) jVec(u)_b + jMat(M) jVec(i)_b = jVec(e)$
  
    $ mannot.mark(mat( 
      jMat(B), jMat(0); 
      jMat(0), jMat(A);
      jMat(M), jMat(N)
    ), tag: #<1>) vec(jVec(u)_b, jVec(i)_b) = vec(jVec(0), jVec(0), jVec(e)) 

      #mannot.annot(<1>, text($b - (n-1)  space$, rgb("#00318b")), pos: left, dy: -2.8mm, dx: 1mm)
      #mannot.annot(<1>, text($n-1 space$, rgb("#00318b")), pos: left, dy: 0mm, dx: 1mm)
      #mannot.annot(<1>, text($b space$, rgb("#00318b")), pos: left, dy: 2.8mm, dx: 1mm)
      #mannot.annot(<1>, text($2b$, rgb("#00318b")), pos: bottom, dy: -0.5mm)
    $

    #line(stroke: (thickness: 0.2mm), length: 100%)

    *Knotenspannungs-Analyse*

    KVL in Bildraum: $jVec(u)_b = jMat(A)^T jVec(u)_k$\
    KCLs in Nullraum: $jMat(A) jVec(i)_b = jVec(0)$\
    Elementgleichungen: $jMat(N) jVec(u)_b + jMat(M) jVec(i)_b = jVec(e)$

    $
      mannot.mark(mat(
        -jMat(A)^T, jMat(1), jMat(0); 
        jMat(0), jMat(0), jMat(A);
        jMat(0), jMat(M), jMat(N)
      ), tag: #<1>) vec(jVec(u)_k, jVec(u)_b, jVec(i)_b) = vec(jVec(0), jVec(0), jVec(e)) 

      #mannot.annot(<1>, text($b  space$, rgb("#00318b")), pos: left, dy: -2.8mm, dx: 1mm)
      #mannot.annot(<1>, text($n-1 space$, rgb("#00318b")), pos: left, dy: 0mm, dx: 1mm)
      #mannot.annot(<1>, text($b space$, rgb("#00318b")), pos: left, dy: 2.8mm, dx: 1mm)
      #mannot.annot(<1>, text($2b + (n-1)$, rgb("#00318b")), pos: bottom, dy: -0.5mm)
    $

    #line(stroke: (thickness: 0.2mm), length: 100%)

    *Maschenstrom-Analyse*

    Nur für Planare Schaltungen

    KCL in Bildraum: $jVec(i)_b = jMat(B)^T jVec(i)_m$\
    KCLs in Nullraum: $jMat(B) jVec(u)_b = jVec(0)$\
    Elementgleichungen: $jMat(N) jVec(u)_b + jMat(M) jVec(i)_b = jVec(e)$

    $
      mannot.mark(mat(
        jMat(B), jMat(0), jMat(0); 
        jMat(0), jMat(1), -jMat(B)^T;
        jMat(M), jMat(N), jMat(0)
      ), tag: #<1>) vec(jVec(u)_b, jVec(i)_b, jVec(i)_m) = vec(jVec(0), jVec(0), jVec(e)) 

      #mannot.annot(<1>, text($b - (n-1)  space$, rgb("#00318b")), pos: left, dy: -2.8mm, dx: 1mm)
      #mannot.annot(<1>, text($b space$, rgb("#00318b")), pos: left, dy: 0mm, dx: 1mm)
      #mannot.annot(<1>, text($b space$, rgb("#00318b")), pos: left, dy: 2.8mm, dx: 1mm)
      #mannot.annot(<1>, text($3b - (n-1)$, rgb("#00318b")), pos: bottom, dy: -0.5mm)
    $

    #line(stroke: (thickness: 0.2mm), length: 100%)

    Nicht Lineare Gleichungen: $underline(f)'(jVec(u), jVec(i)) = 0$
  ]

  // Netwon Rephson
  #bgBlock(fill: colorAnalyseVerfahren)[
    #subHeading(fill: colorAnalyseVerfahren)[Netwen-Raphson]


  ]

  // ZweiTor Beschreibungen
  #bgBlock(fill: colorZweiTore)[
    #subHeading(fill: colorZweiTore)[Zwei-Tor Beschreibungen]

    *Parametrisch/Bildraum*\
    Parameter: $c in RR^n$

    *Streng Linear:* $vec(jVec(u), jVec(i)) = mat(jMat(U); jMat(I))jVec(c)$\

    *Linear:* $vec(jVec(u), jVec(i)) = mat(jMat(U); jMat(I))jVec(c) + vec(jVec(u), jVec(i))$

    #line(length: 100%, stroke: (thickness: 0.2mm))

    *Implizite/Kern/Nullraum*

    $forall (jVec(i), jVec(u))$ wo gilt $jMat(M) jVec(i) + jMat(N) jVec(u) = 0$

    #line(length: 100%, stroke: (thickness: 0.2mm))


    *Explizit*
    $r(u) = i \/ g(u) = i$

    (siehe Tabelle)

    #line(length: 100%, stroke: (thickness: 0.2mm))

    *Umrechnung*

    #table(
      columns: (1fr),
      fill: (x, y) => if calc.rem(y, 2) == 0 { tableFillHigh } else { tableFillLow },

      [
        *$"Explizit" -> "Implizit(Nullraum)"$*\
        Umstellen nach Null: \
        $jMat(1) jVec(u) - jMat(R) jVec(i) = jVec(0) quad jMat(1) jVec(i) - jMat(G) jVec(u) = jVec(0)$ \
        $==> jMat(N)jVec(u) + jMat(M)jVec(i) = jMat(0)$
      ],

      [
        *Implizit $->$ Explizit* \
        $jMat(R) = -jMat(M)^(-1) jMat(N) quad jMat(G) = -jMat(N)^(-1) jMat(M)$ \
      ],
      [
        *Parametrisch $->$ Explizit* \
        $jMat(R) = jMat(U) jMat(I)^(-1) quad jMat(G) = jMat(I) jMat(U)^(-1)$ \
      ],
      [
        *Explizit $->$ Parametrisch* \
        Zwei ausgesuchte Punkte $jVec(u) \/ jVec(i)$ einsetzen\
        $-> vec(jVec(u)_1, jVec(i)_1),vec(jVec(u)_2, jVec(i)_2)$ \

        In Matrix Eintrag: $mat(jMat(U); jMat(I)) = mat(jVec(u)_1, jVec(u)_2; jVec(i)_1, jVec(i)_2)$
      ],
      [
        *Implizit $->$ Parametrisch* \

        $vec(jMat(U), jMat(I)) = vec(-jMat(M)^(-1) jMat(N), jMat(1)) = vec(jMat(1), -jMat(N)^(-1) jMat(M))$
      ],
      [
        *Parametrisch* $->$ *Implizit*\
        Paramterisch $->$ Explizit $->$ Implizit

        $-jMat(I) jMat(U)^(-1) jVec(u) + jMat(1) jVec(i) = 0 quad jMat(1)jVec(u) - jMat(U)jMat(I)^(-1) jVec(i) = 0$
      ]
    )

  ]

  // ZweiTor Verschaltung
  #bgBlock(fill: colorZweiTore)[
    #subHeading(fill: colorZweiTore)[Zweitor Verschaltung]
    #grid(
      columns: (auto, auto),
      gutter: 5mm,
      [
        Parallel-Parallel \
        $jMat(G)_"ges" = jMat(G_1) + jMat(G_2)$
      ],
      [
        #zap.circuit({
          import zap: *

          registerAllCustom()
          zweiTor("G1", (0, -6mm), $jMat(G_1)$)
          zweiTor("G2", (0, 6mm), $jMat(G_2)$)

          zwire("G1.in1", (-8mm, -3.5mm), (-8mm, 8.5mm), "G2.in1")
          zwire("G1.in0", (-10mm, -8.5mm), (-10mm, 3.5mm), "G2.in0")
          node("n0", (13mm, 8.5mm), fill: false)
          node("n1", (13mm, -8.5mm), fill: false)
          node("n00", (10mm, 8.5mm))
          node("n11", (8mm, -8.5mm))
          wire("n0", "n00")
          wire("n1", "n11")

          zwire("G1.out1", (10mm, -3.5mm), (10mm, 8.5mm), "G2.out1")
          zwire("G1.out0", (8mm, -8.5mm), (8mm, 3.5mm), "G2.out0")
          node("n2", (-13mm, 8.5mm), fill: false)
          node("n3", (-13mm, -8.5mm), fill: false)
          node("n22", (-8mm, 8.5mm))
          node("n33", (-10mm, -8.5mm))
          wire("n2", "n22")
          wire("n3", "n33")
        })
      ],

      [
        Seriel-Seriel \
        $jMat(G)_"ges" = jMat(G_1) + jMat(G_2)$
      ],
      [
        #zap.circuit({
          import zap: *

          registerAllCustom()
          zweiTor("G1", (0, -6mm), $jMat(R_1)$)
          zweiTor("G2", (0, 6mm), $jMat(R_2)$)

          node("n0", (13mm, 8.5mm), fill: false)
          node("n1", (13mm, -8.5mm), fill: false)

          node("n2", (-13mm, 8.5mm), fill: false)
          node("n3", (-13mm, -8.5mm), fill: false)

          zwire("G1.in1", (-8mm, -3.5mm), (-8mm, 3.5mm), "G2.in0")
          zwire("G1.out1", (8mm, -3.5mm), (8mm, 3.5mm), "G2.out0")

          zwire("G1.in0", "n3")
          zwire("G1.out0", "n1")
          zwire("G2.out1", "n0")
          zwire("G2.in1", "n2")
        })
      ],

      [
        Seriel-Parallel \
        $jMat(H)_"ges" = jMat(H_1) + jMat(H_2)$
      ],
      [
        #zap.circuit({
          import zap: *

          registerAllCustom()
          zweiTor("G1", (0, -6mm), $jMat(H_1)$)
          zweiTor("G2", (0, 6mm), $jMat(H_2)$)

          node("n0", (13mm, 8.5mm), fill: false)
          node("n1", (13mm, -8.5mm), fill: false)

          node("n2", (-13mm, 8.5mm), fill: false)
          node("n3", (-13mm, -8.5mm), fill: false)

          zwire("G1.in1", (-8mm, -3.5mm), (-8mm, 3.5mm), "G2.in0")

          zwire("G1.in0", "n3")
          zwire("G2.in1", "n2")

          zwire("G1.out1", (10mm, -3.5mm), (10mm, 8.5mm), "G2.out1")
          zwire("G1.out0", (8mm, -8.5mm), (8mm, 3.5mm), "G2.out0")
          node("n00", (10mm, 8.5mm))
          node("n11", (8mm, -8.5mm))
          wire("n0", "n00")
          wire("n1", "n11")
        })
      ],

      [
        Parallel-Seriel \
        $jMat(H')_"ges" = jMat(H'_1) + jMat(H'_2)$
      ],
      [
        #zap.circuit({
          import zap: *

          registerAllCustom()
          zweiTor("G1", (0, -6mm), $jMat(H'_1)$)
          zweiTor("G2", (0, 6mm), $jMat(H'_2)$)

          node("n0", (13mm, 8.5mm), fill: false)
          node("n1", (13mm, -8.5mm), fill: false)

          node("n2", (-13mm, 8.5mm), fill: false)
          node("n3", (-13mm, -8.5mm), fill: false)

          zwire("G1.out1", (8mm, -3.5mm), (8mm, 3.5mm), "G2.out0")

          zwire("G1.out0", "n1")
          zwire("G2.out1", "n0")

          zwire("G1.in1", (-8mm, -3.5mm), (-8mm, 8.5mm), "G2.in1")
          zwire("G1.in0", (-10mm, -8.5mm), (-10mm, 3.5mm), "G2.in0")
          node("n22", (-8mm, 8.5mm))
          node("n33", (-10mm, -8.5mm))
          wire("n2", "n22")
          wire("n3", "n33")
        })
      ],

      [
        Kette normal \
        $jMat(A)_"ges" = jMat(A_1) dot jMat(A_2)$
      ],
      [
        #zap.circuit({
          import zap: *

          registerAllCustom()
          zweiTor("A2", (6mm, 0), $jMat(A_2)$, height: 8mm, width: 8mm)
          zweiTor("A1", (-6mm, 0), $jMat(A_1)$, height: 8mm, width: 8mm)

          node("n0", (-13mm, 2mm), fill: false)
          node("n1", (-13mm, -2mm), fill: false)
          node("n2", (13mm, 2mm), fill: false)
          node("n3", (13mm, -2mm), fill: false)

          wire((-13mm, 2mm), "A1.in1")
          wire((-13mm, -2mm), "A1.in0")
          wire((13mm, 2mm), "A2.out1")
          wire((13mm, -2mm), "A2.out0")
          wire("A2.in1", "A1.out1")
          wire("A2.in0", "A1.out0")
        })
      ],

      [
        Kette invers \
        $jMat(A')_"ges" = jMat(A'_2) dot jMat(A'_1)$
      ],
      [
        #zap.circuit({
          import zap: *

          registerAllCustom()
          zweiTor("A2", (6mm, 0), $jMat(A'_2)$, height: 8mm, width: 8mm)
          zweiTor("A1", (-6mm, 0), $jMat(A'_1)$, height: 8mm, width: 8mm)

          node("n0", (-13mm, 2mm), fill: false)
          node("n1", (-13mm, -2mm), fill: false)
          node("n2", (13mm, 2mm), fill: false)
          node("n3", (13mm, -2mm), fill: false)

          wire((-13mm, 2mm), "A1.in1")
          wire((-13mm, -2mm), "A1.in0")
          wire((13mm, 2mm), "A2.out1")
          wire((13mm, -2mm), "A2.out0")
          wire("A2.in1", "A1.out1")
          wire("A2.in0", "A1.out0")
        })
      ],
    )
  ],

  // KS/LL  
  #bgBlock(fill: colorZweiTore)[
    #subHeading(fill: colorZweiTore)[Kurzschluss/Leerlauf Methode für Zweitore]

    1. Was sind die Input-Größen/Output-Größen? \
      $u"-gesteuert:" u = 0 &--> "Kurzschluss (KS)" \
      i"-gesteuert:" i = 0 &--> "Leerlauf (LL)"$ \

    2. Steuernde Größe 1 beschalten KS/LL \
      $-->$ BEIDE gesteuerten Größe errechen \
      (2. Spalte der Matrix)
    3. Steuernde Größe 2 beschalten KS/LL \
      $-->$ BEIDE gesteuerten Größe errechen \
      (1. Spalte der Matrix)
     
    4. Matrix/Gleichung aufstellen \
      Addition der Beschreibung pro gesteuerter Größe \
      (Superpositions Prinzip)
  ]

  // Linearsierung (N-Tore)
  #bgBlock(fill: colorAnalyseVerfahren)[
    #subHeading(fill: colorAnalyseVerfahren)[Linearisierung (N-Tore)]

    1. Arbeitspunk bestimmen/schätzen/ist gegeben \ 
      $vec(jVec(u)_"AP", jVec(i)_"AP") hat(=) vec(jVec(x)_"AP", jVec(y)_"AP")$

    $bold(f)(jVec(x))=jVec(y)$

    2. Ableitung: Jacobi-Matrix

    $jMat(J) = mat(
      #mannot.mark($delta y_1$, color: red)/(#mannot.mark($delta x_1$, color: red)), #mannot.mark($delta y_1$, color: red)/(#mannot.mark($delta x_2$, color: purple)), ..., #mannot.mark($delta y_1$, color: red)/(#mannot.mark($delta x_n$, color: blue));
      #mannot.mark($delta y_2$, color: purple)/(#mannot.mark($delta x_1$, color: red)), #mannot.mark($delta y_2$, color: purple)/(#mannot.mark($delta x_2$, color: purple)), ..., #mannot.mark($delta y_2$, color: purple)/(#mannot.mark($delta x_n$, color: blue));
      dots.v, dots.v, dots.down, dots.v;
      #mannot.mark($delta y_n$, color: blue)/(#mannot.mark($delta x_1$, color: red)), #mannot.mark($delta y_n$, color: blue)/(#mannot.mark($delta x_2$, color: purple)), ..., #mannot.mark($delta y_n$, color: blue)/(#mannot.mark($delta x_n$, color: blue));
    )$

    *Großsignal Beschreibung:* \
    $jVec(y)_"lin" = jMat(J)|_(jVec(x)_"AP") (jVec(x)_"lin" - jVec(x)_"AP") + jVec(y)_"AP"$

    *Kleinsingal Beschreibung:* \
    $jVec(y)_"lin" = jMat(J)|_(jVec(x)_"AP") jVec(x)_"lin"$
  ]

  // Newton-Raphson
  #bgBlock(fill: colorEineTore)[
    #subHeading(fill: colorEineTore)[Newton-Raphson (Eine-Tor)]
    $x_(n+1) = x_n - f(x_n)/(f'(x_n))$
  ]

  // Netwen-Raphson N-Tore
  #bgBlock(fill: colorZweiTore)[
    #subHeading(fill: colorZweiTore)[Newton-Raphson (N-Tore)]
    Nicht lineare Beschreibung in Nullraum/Implizit Darstellung:
    $jVec(f)'(jVec(x)) = jVec(0)$\

    
    0. Jakobi Matrix $jMat(J)(x^((k)))$ aufstellen (ableiten)

    Schrit $n+1$ Berechnen:

    1. Jacobi Matrix $jMat(J)(x^((n)))$ ausrechnen 

    2. Linearisiertes Gleichungs System aufstellen: \
      $M_"lin"^((n)) jVec(u)^((n)) + N_"lin"^((n)) jVec(i)^((n))$ aus $jMat(J)(x^((n)))$ rauslesen

      $jVec(e)_"lin" = jMat(J)(x^((n))) dot x^((n)) - jVec(f)(x^((n)))$

      $n$te-Linearisierte Elementgleichungen: \
      $M_"lin"^((n)) jVec(u)^((n)) + N_"lin"^((n)) jVec(i)^((n)) = jVec(e)^((n))_"lin"$

      Tablaue: $jMat(T)^((n)) jVec(x)^((n + 1)) = jVec(e)^((n))$ \
    
    3. Gleichungsystem lösen: $jVec(x)^((n+1))$

    4. Fehler $epsilon$ berechnen
  ]

  // Reaktive Elemeten
  #colbreak()
  #bgBlock(fill: colorComplexAC)[
    #subHeading(fill: colorComplexAC)[Reaktive Element]

    *Zustandsgrößen*\

    #grid(
      columns: (1fr, 0pt, 1fr),
      row-gutter: 10mm,
      column-gutter: 2mm,
      [
        *Kapazitiv*

        $[i(t)] = unit("A")$\
        $[q(t)] = unit("A s") = unit("C")$\
      ],
      grid.vline(stroke: 0.75pt),
      [],
      [
        *Induktiv*

        $[u(t)] = unit("V")$ \
        $[Phi(t)] = unit("V s") = unit("W b")$ \
      ],

      [
        $q(t) = integral_(-infinity)^(t) i(tau) d tau = \
        q(0) + integral_(0)^(t) i(tau) d tau$ \

        $i(t) = (d q)/(d t) = dot(q(t))$
      ],
      [],
      [
        $Phi(t) = integral_(-infinity)^(t) u(tau) d tau = \
        Phi(0) + integral_(0)^(t) u(tau) d tau$ \

        $u(t) = (d Phi)/(d t) dot(Phi(t))$
      ],
    )

    #linebreak()

    $P(t) = u(t) i(t)$

    $W(t_1, t_2) = integral_(t_1)^(t_2) P(tau) d tau$

    $W(t_1, t_2) > 0$: Nimmt Energie auf\
    $W(t_1, t_2) = 0$: Verlustlos\
    $W(t_1, t_2) < 0$: Gibt Energie ab\
  ]

  #bgBlock(fill: colorComplexAC)[
    #subHeading(fill: colorComplexAC)[Reaktive Bauelemente]
    #grid(
      columns: (1fr, 0pt, 1fr),
      row-gutter: 4mm,
      column-gutter: 2mm,
      [*Kapazitiv*],
      grid.vline(stroke: 0.75pt),
      [],
      [*Induktiv*],
      [
        $q = c(u) \ u = chi(q)$\

        $W(t_1, t_2), integral_(q_1 = q(t_1))^(q_2 = q(t_2)) chi(q) d q$
      ],
      [],
      [
        $Phi = l(i) \ i = lambda(Phi)$ \

        $W(t_1, t_2), integral_(Phi_1 = Phi(t_1))^(Phi_2 = Phi(t_2)) lambda(Phi) d Phi$
      ],

      [$u,q$ stetig und beschränkt],
      [],
      [$i,Phi$ stetig und beschränkt],

      grid.hline(stroke: 0.75pt),
      [],
      [],
      [],

      [*Restiv*],
      [],
      [*Memristiv*],
      [
        $i = g(u) \ u = r(i)$\
      ],
      [],
      [
        $Phi = l(i) \ i = lambda(Phi)$
      ],

      [$u,q$ stetig und beschränkt],
      [],
      [$i,Phi$ stetig und beschränkt],
      [],
    )

    #line(length: 100%, stroke: (thickness: 0.2mm))

    #align(center, [*Lineare Bauelemente*])
    #grid(
      columns: (1fr, 0pt, 1fr),
      row-gutter: 4mm,
      column-gutter: 2mm,
      [
        *Kapazitiv*
      ],
      grid.vline(stroke: 0.75pt),
      [],
      [
        *Induktivität*
      ],
      [
        $q(t) = C dot u(t)$\
        $i(t) = C dot (d u)/(d t)$\
        $[C] = F = unit("A s")/unit("V")$
      ],
      [],
      [
        $Phi(t) = L dot i(t)$\
        $u(t) = L dot (d i)/(d t)$\
        $[L] = H = unit("V s") / unit("A")$
      ],
      [
        $E_C = q^2 / 2C = C/2 u^2$
      ],
      [],
      [
        $E_L = Phi^2/2L = (L i^2)/2$
      ],
      [
        $C$: Admittanz $hat(=) G$
      ],
      [],
      [
        $L$: Impedanz $hat(=) R$
      ],
    )

    Admittanz: $Y = I/U$\
    Impedanz: $Z = U/I$

  ]

  // Reaktive Dual Wandlung
  #bgBlock(fill: colorComplexAC)[
    #subHeading(fill: colorComplexAC)[Reaktive Dualwandlung]

    #grid(
      columns: (1fr, 1fr),
      row-gutter: 4mm,
      $u --> R_d i^d$, $i --> u^d/R_d$,
      $q --> Phi^d / R_d$, $Phi --> q^d R_d$,
    )
  ]

  // Complex AC
  #bgBlock(fill: colorComplexAC)[
    #subHeading(fill: colorComplexAC)[Komplex Wechselstrom Rechnnung]
    Im Eingeschwungenem Zustand

    $u(t) = "Re"{U_m e^(j omega t + phi)}$

    $u(t) = U_m cos(omega t + alpha)$ \
    $i(t) = I_m cos(omega t + beta)$

    $(d u)/(d t) = A_m$

    Kreisfrequenz: $omega = 2 pi f$ \
    Amplitude: $A_m$ \
    Phaseverschieben: $alpha$

    *Ohm:* $u(t) = R I_m cos(omega t + beta) = omega A_m cos(omega)$)

    *Serienschaltung*\
    $u_1(t) = U_1 cos(omega t)$\
    $u_2(t) = U_2 cos(omega t + phi)$

    $u(t)_"ges" = u_1(t) + u_2(t) = \
    U_"ges"^2 = U_1^2 + 2 U_1 U_2 + U_2^2 \
    tan(phi) = (U_2 sin(phi))/(U_1 + U_2 cos(phi))$
  ]


  #bgBlock(fill: colorComplexAC)[
    #subHeading(fill: colorComplexAC)[Komplex Beziehungen]
    #let size = 1.4
    #let margin = 0.2

    *Bauelement Beziehungen*
    #align(center+horizon, [
      #canvas({
        import cetz.draw : content, set-style, line, scale
        content((-size, size), $i$)
        content((size, size), $u$)
        content((-size, -size), $q$)
        content((size, -size), $Phi$)

        set-style(mark: (symbol: ">"))
        line((-size + margin, size), (size - margin, size), 
          stroke: (thickness: 0.2mm, paint: rgb("#005500"))
        )
        line((-size + margin, -size), (size - margin, -size),
          stroke: (thickness: 0.2mm, paint: rgb("#008b00"))
        )


        set-style(mark: (symbol: ">"))
        line((-size+margin, -size+margin), (size -margin, size -margin),
          stroke: (thickness: 0.2mm, paint: rgb("#2534ff"))
        )
        line((size -margin, -size+margin), (-size+margin, size -margin),
          stroke: (thickness: 0.2mm, paint: rgb("#ff4625"))
        )

        scale(y: 75%, x: 75%)
        content((0.0, -size - 0.8), text(rgb("#008b00"))[$"Memristiv" q = f(Phi)$], auto-scale: true)

        content((0.0, size+0.8), text(rgb("#005500"))[$"Resitiv" u = r(i)$], auto-scale: true)


        content((0.0, 0.2), text(rgb("#ff4625"))[$"Induktiv" quad i = lambda(Phi)$], angle: -45deg, auto-scale: true)

        
        content((-0.2, 0.1), text(rgb("#2534ff"))[$"Kapazitiv" quad u = chi(Phi)$], angle: 45deg, auto-scale: true)
      })
    ])

    *Allgemeine Beziehungen (gilt immer)*
    #align(center+horizon, [
      #canvas({
        import cetz.draw : content, set-style, line, bezier
        content((-size, size), $i$)
        content((size, size), $u$)
        content((-size, -size), $q$)
        content((size, -size), $Phi$)
        
        set-style(mark: (end: ">"))
        bezier((-size -margin*0.5, -size +margin), (-size -margin*0.5, size -margin), (-size - 0.5, 0), stroke: (thickness: 0.2mm, paint: rgb("#00318b")))
        bezier((size -margin*0.5, -size +margin), (size -margin*0.5, size -margin), (size - 0.5, 0), stroke: (thickness: 0.2mm, paint: rgb("#00318b")))


        bezier((-size +margin*0.5, size -margin), (-size +margin*0.5, -size +margin), (-size + 0.5, 0), stroke: (thickness: 0.2mm, paint: rgb("#8b2000")))
        bezier((size +margin*0.5, size -margin), (size +margin*0.5, -size +margin), (size + 0.5, 0), stroke: (thickness: 0.2mm, paint: rgb("#8b2000")))

        content((-size + 0.2, 0), scale(75%, text(rgb("#8b2000"), $integral i(tau) d tau$)), anchor: "west")
        content((-size - 0.3, 0), scale(75%, text(rgb("#00318b"), $(d q)/(d t)$)), anchor: "east")

        content((size + 0.2, 0), scale(75%, text(rgb("#8b2000"), $integral u(tau) d tau$)), anchor: "west")
        content((size - 0.3, 0), scale(75%, text(rgb("#00318b"), $(d Phi)/(d t)$)), anchor: "east")

      })
    ])
  ]

  // AC Components
  #bgBlock(fill: colorComplexAC)[
    #subHeading(fill: colorComplexAC)[Komplexe Komponent]
    #table(
      columns: (1fr, 2fr, 2fr, 2fr),
      inset: (bottom: 2mm, top: 2mm),
      fill: (x, y) => if calc.rem(y, 2) == 1 { tableFillLow } else { tableFillHigh },
      [], [*$Z = U/I$*], [*$Y = I/U$*], [*$phi$*],
      [], [*$I -> U$*], [*$U -> I$*], [*$phi$*],
      [], [*$Omega  space (R)$*], [*$S space (G)$*], [*rad*],
      zap.circuit({
        import zap: *
        resistor("R", (0, 0), (0.6, 0), width: 3mm, height: 2mm, fill: none)
      }),
      $R = 1/G$,
      $G = 1/R$,
      $0$,

      zap.circuit({
        import zap: *
        capacitor("R", (0, 0), (0.6, 0), width: 4mm, height: 6mm, fill: none)
      }),
      $1/(j w C)$,
      $j w C$,
      $-pi/2$,

      zap.circuit({
        import zap: *
        inductor("R", (0, 0), (0.6, 0), width: 4mm, height: 2mm, fill: none, variant: "ieee")
      }),
      $j w L$,
      $1/(j w L)$,
      $pi/2$,
    )
  ]

  #bgBlock(fill: colorComplexAC)[
    #subHeading(fill: colorComplexAC)[*Levi's Lustig Leistung*]
    $P=P_W + j P_B$\
    
    #table(
      columns: (auto, 1fr, auto),
      fill: (x, y) => if calc.rem(y, 2) == 0 { tableFillLow } else { tableFillHigh },
      [Scheinleitsung], [$S = abs(P)$], [$["VA"]$],
      [Wirkleistung], [$P_W = "Re"{P}$], [$["W"]$],
      [Blindleistung], [$P_B = "Im"{P}$], [$["var"]$],
    )

    $P = 1/2 U I^* = 1/2 abs(U)^2 Y^* = 1/2 abs(I)^2 Z^*$
    
    //Bei Wiederstand: $R$

    //$P_w = U_m^2 / 2R = (I_m^2 R)/2$

    

    $U_"eff" = U_m/sqrt(2), I_"eff" = I_m / sqrt(2)$
  ]

  // Komplexe Zahlen
  #bgBlock(fill: colorAllgemein)[
    #subHeading(fill: colorAllgemein)[Komplexe Zahlen]

    #ComplexNumbersSection(i: $j$)

    *Trigonometire*

    #grid(
      columns: (auto, auto),
      column-gutter: 2mm,
      row-gutter: 3mm,
      $cos(x) = cos(-x)$, $sin(-x) = -sin(x)$, $cos(x)^2 + sin(x)^2 = 1$, $cos(x) = sin(x + pi/2)$, $sin(x) = cos(x - pi/2)$, $$,
      grid.cell(colspan: 2, $cos(x + y) = cos(x)cos(y) - sin(x)sin(y)$), 
      grid.cell(colspan: 2, $sin(x + y) = sin(x)cos(y) + cos(x)sin(y)$)
    )
  ]

  // SinTable
  #bgBlock(fill: colorAllgemein, [
    #subHeading(fill: colorAllgemein, [Sin-Table])
    #sinTable

    #SineCircle()
  ])
]

#pagebreak()

#let NodeRed = rgb("#ff5656")
#let NodeGreen = rgb("#5eff56")
#let NodeBlue = rgb("#6156ff")
#let NodeYellow = rgb("#ffa856")

#columns(2)[
  #bgBlock(fill: colorAnalyseVerfahren)[
    #subHeading(fill: colorAnalyseVerfahren)[Reduzierte Knotenpotenzial-Analyse Komponetent]
    #import mannot: *

    #let ImageHeight = 2.5cm

    Reduzierte Knotenpotenzial-Analyse: $jMat(G_k) = jVec(u)_k = jVec(i)_q$

    *Cramersche Regel:* $u_(k i) = (det jMat(G)_(k i))/(det jMat(G)_k)$ ($jMat(G)_(k i)$ entshet aus $G_k$ durch ersetzen der $i$-ten Splate mit $jVec(i)_q$)

    #table(
      columns: (1fr, 1fr),
      fill: (x, y) => if calc.rem(y, 2) == 0 { tableFillHigh } else { tableFillLow },

      grid(
        columns: 3,
        column-gutter: 5mm,
        row-gutter: 3mm,
        zap.circuit({
          import zap : *
          
          vsource("V", (0,0), (0,1.5), scale: 0.4, fill: none)
          joham.voltage((-0.3,1), (-0.3,0), $U_0$)
          resistor("G", (0,1.5), (1,1.5), scale: 0.4, fill: none, label: (content: $G$, distance: 0.6mm, anchor: "south"))
          wire("V.in", (1,0))
        }),
        align(center+horizon, $==>$),
        zap.circuit({
          import zap : *

          isource("V", (0,0), (0,1.5), scale: 0.4, fill: none, i: (content: $G U_0 space$, invert: false, distance: 0.2, anchor: "east"))

          resistor("G", (1,0), (1,1.5), n: "*-*", scale: 0.4, fill: none, label: (content: $G$, distance: 0.6mm))
          wire("V.in", (1.5,0))
          wire("V.out", (1.5,1.5))
        }),
      ),

      grid(
        columns: 3,
        column-gutter: 5mm,
        row-gutter: 3mm,
        zap.circuit({
          import zap : *
          
          vsource("V", (0,0), (0,1.5), scale: 0.4, fill: none)
          joham.voltage((-0.3,1), (-0.3,0), $U_0$)
          
          wire("V.in", (1,0))
          wire("V.out", (1,1.5))
        }),
        align(center+horizon, $==>$),
        zap.circuit({
          import zap : *

          isource("V", (0,0), (0,1.5), scale: 0.4, fill: none, i: (content: $G U_0 space$, invert: false, distance: 0.2, anchor: "east"))

          resistor("G", (1,0), (1,1.5), n: "*-*", scale: 0.4, fill: none, label: (content: $G$, distance: 0.6mm))
          resistor("-G", (2.3,1.5), (1,1.5), scale: 0.4, fill: none, label: (content: $-G$, distance: 0.6mm))
          wire("V.in", (2.3,0))
          wire("V.out", "G.out")
        }),
      ),

      grid(
        columns: 3,
        column-gutter: 5mm,
        row-gutter: 3mm,
        zap.circuit({
          import zap : *
          
          vsource("V", (0,0), (0,1.5), scale: 0.4, fill: none)
          joham.voltage((-0.3,1), (-0.3,0), $U_0$)
          
          wire("V.in", (1,0))
          wire("V.out", (1,1.5))
        }),
        align(center+horizon, $==>$),
        zap.circuit({
          import zap : *
          joham.gyrator("G", (0,0), scale: 0.4, constant: $G_d$, invert: true)
          joham.ground("GND", "G.12")
          node("A", "G.12")
          node("B", (-0.75,0.67), label: (content: $alpha$, distance: 0.1))
          isource("V", "G.12", "G.11", scale: 0.4, fill: none, i: (content: $G_d U_0 space$, invert: true, distance: 0.3, anchor: "east"))
        }),
      ),

      [*Übertrager/NIK* siehe Zweitor-Tabelle],

      scale(90%, grid(
        columns: (auto, 0mm, 1fr),
        column-gutter: 5mm,
        row-gutter: 3mm,
        
        [
          *VCVS + 1 Knoten* \
          #zap.circuit({
            import zap : vsource, node, disource, dvsource, wire
            import cetz.draw : line, rect, mark, content

            node("A", (0,0), fill: false)
            node("B", (0,1), fill: false)
            node("C", (0.8,0), fill: false)
            node("D", (0.8,1), fill: false)
            
            joham.voltage((0, 1), (0, 0), $u_"in"$, anchor: "west")
            dvsource("S", (0.8,0), (0.8,1), fill: none, scale: 0.4)

            joham.voltage((1.1, 1), (1.1, 0), $u_"out"$, anchor: "west")
          })

          $u_"out" = mu u_"in"$
        ],
        align(center+horizon, $==>$),
        [
          #zap.circuit({
            import zap : vsource, node, disource, dvsource, wire
            import cetz.draw : line, rect, mark, content

            joham.gyrator("G0", (3,0), scale: 0.4, invert: true, constant: $G_d$)

            disource("S", "G0.11", "G0.12", scale: 0.4, fill: none, i: (content: $i_"out"$, distance: 0.3, anchor: "west", invert: true))
            node("N4", "G0.11", label: (content: $beta$, distance: 0.1),)
            node("N3", "G0.12",)
            joham.ground("GND1", "N3")

            node("A", (1, 0.67), fill: false)
            node("B", (1, -0.67), fill: false)
            joham.voltage((1, 0.7), (1, -0.7), $u_"in"$, anchor: "west")

          })
          $i_"out" = mu G_d u_"in"$
        ],
      )),

      scale(90%, grid(
          columns: (auto, 0mm, 1fr),
          column-gutter: 5mm,
          row-gutter: 3mm,
          
          [
            *CCCS + 1 Knoten* \
            #zap.circuit({
              import zap : vsource, node, disource, dvsource, wire
              import cetz.draw : line, rect, mark, content

              node("A", (0,0), fill: false)
              node("B", (0,1), fill: false)
              node("C", (0.8,0), fill: false)
              node("D", (0.8,1), fill: false)
              
              wire((0,0), (0,1), i: (content: $i_"in"$, invert: true, anchor: "east", distance: 0.1), size: 0.2)
              disource("S", (0.8,0), (0.8,1), fill: none, scale: 0.4)

              line((0.8,0.15), (0.8,0.1), mark: (end: ">", scale: 0.2, fill: black))
              content((0.9, 0.15), $i_"out"$, anchor: "west")
            })
            $i_"out" = beta i_"in"$
          ],
          align(center+horizon, $==>$),
        [
          #zap.circuit({
            import zap : vsource, node, disource, dvsource, wire
            import cetz.draw : line, rect, mark, content

            joham.gyrator("G1", (0,0), scale: 0.4, constant: $G_d$)

            node("A", (1.8,-0.67))
            node("B", (1.8,0.67))

            disource("S", "A", "B", scale: 0.4, fill: none, i: (content: $i_"out"$, distance: 0.2, label-distance: -0.4, anchor: "east", invert: true))
            node("N1", "G1.21", label: (content: $alpha$, distance: 0.1),)
            node("N2", "G1.22",)
            joham.ground("GND1", "N2")

            joham.voltage("G1.21", "G1.22", $u_"in"$)
          })
          $i_"out" = beta G_d u_in$
        ],
      )),
      
      table.cell(
        align(center+horizon, grid(
          columns: (auto, 0mm, auto),
          column-gutter: 5mm,
          row-gutter: 3mm,
          [
            *CCVS + 2 Knoten* \
            #zap.circuit({
              import zap : vsource, node, disource, dvsource, wire
              import cetz.draw : line, rect, mark, content

              node("A", (0,0), fill: false)
              node("B", (0,1), fill: false)
              node("C", (0.8,0), fill: false)
              node("D", (0.8,1), fill: false)
              
              wire((0,0), (0,1), i: (content: $i_"in"$, invert: true, anchor: "east", distance: 0.1), size: 0.2)
              dvsource("S", (0.8,0), (0.8,1), fill: none, scale: 0.4)

              joham.voltage((1.1, 1), (1.1, 0), $u_"out"$, anchor: "west")
            })

            $u_"out" = r i_"in"$
          ],
          align(center+horizon, $==>$),
          [
            #zap.circuit({
              import zap : vsource, node, disource, dvsource, wire
              import cetz.draw : line, rect, mark, content

              joham.gyrator("G1", (0,0), scale: 0.4, constant: $G_d$)
              joham.gyrator("G0", (3,0), scale: 0.4, invert: true, constant: $G_d$)

              disource("S", "G0.11", "G0.12", scale: 0.4, fill: none, i: (content: $i_"out"$, distance: 0.3, anchor: "west", invert: true))
              node("N1", "G1.21", label: (content: $alpha$, distance: 0.1),)
              node("N4", "G0.11", label: (content: $beta$, distance: 0.1),)
              node("N2", "G1.22",)
              node("N3", "G0.12",)
              joham.ground("GND1", "N3")
              joham.ground("GND1", "N2")

              joham.voltage("G1.21", "G1.22", $u_"in"$)
            })
            $i_"out" = r G_d^2 u_"in"$
          ],
        )),
        colspan: 2
      )
    )
    
    #table(
      columns: (1fr, 1fr),
      fill: (x, y) => if calc.rem(y, 2) == 0 { tableFillHigh } else { tableFillLow },
      align(center, image("../images/schaltungstheorie/knotenpotenzial/schaltKontenPotenziell3-1.png", height: ImageHeight, fit: "contain")),

      align(center, image("../images/schaltungstheorie/knotenpotenzial/schaltKontenPotenziell4.png", height: ImageHeight, fit: "contain")),

      align(center, image("../images/schaltungstheorie/knotenpotenzial/schaltKnotenPotenziell12.png", height: ImageHeight, fit: "contain")),

      align(center, image("../images/schaltungstheorie/knotenpotenzial/schaltKontenPotenziell11.png", height: ImageHeight, fit: "contain")),

      align(center, image("../images/schaltungstheorie/knotenpotenzial/schaltKontenPotenziell7.png", height: ImageHeight, fit: "contain")),

      align(center, image("../images/schaltungstheorie/knotenpotenzial/schaltKontenPotenziell8.png", height: ImageHeight, fit: "contain")),

      align(center, image("../images/schaltungstheorie/knotenpotenzial/schaltKontenPotenziell9.png", height: ImageHeight, fit: "contain")),

      align(center, image("../images/schaltungstheorie/knotenpotenzial/schaltKontenPotenziell10.png", height: ImageHeight, fit: "contain")),

      align(center, image("../images/schaltungstheorie/knotenpotenzial/schaltKontenPotenziell1.png", height: ImageHeight, fit: "contain")),

      align(center, image("../images/schaltungstheorie/knotenpotenzial/schaltKontenPotenziell2.png", height: ImageHeight, fit: "contain")),
    
      align(center, image("../images/schaltungstheorie/knotenpotenzial/nullator.jpg", height: ImageHeight, fit: "contain")),
    
      align(center, image("../images/schaltungstheorie/knotenpotenzial/norator.jpg", height: ImageHeight, fit: "contain")),

    )
  ]

  #colbreak()

  // Bauelemente
  #bgBlock(fill: colorEineTore)[
    #subHeading(fill: colorEineTore)[Bauelemente]
    
    #table(
      columns: (1fr, 1fr, 1fr, 1fr),
      stroke: none,
      fill: (x, y) => if (calc.rem(y, 2) == 0) { tableFillLow } else { tableFillHigh },
      align: center,
      table.header(
        [*Zeichen*], [*Gleichungen*], [*Abbildung*], [*Eigenschaften*]),
      table.hline(),


      // Nullator
      [
        Nullator
        #scale(x: 100%, y: 100%, zap.circuit({
          import zap: *
          import cetz.draw: content, line
          joham.nullator("nullator1",(0,0), (-1.75,0))
        }))
      ],
      align(center+horizon,
        $u = 0 \ i = 0$
      ),
      [
        #scale(x: 75%, y: 75%, cetz.canvas({
          import cetz.draw: *
          import cetz-plot: *

          let opts = (x-tick-step: none, y-tick-step: none, size: (2, 1), x-label: [u], y-label: [i])

          plot.plot(axis-style: "school-book", ..opts, name: "plot", {

            plot.add(((0,0), (0,0)), 
            mark-style: (stroke: red, fill: red), mark: "o", )
          })
        }))
      ],
      align(left+top)[
        - Verlustlos
        - Streng linear
          - Linear
          - Quellenfrei
          - Ungepolt
        - Resitiv, Induktiv, Kapazitiv, Memristiv
      ],

      // Norator
      [
        Norator
        #scale(x: 100%, y: 100%, zap.circuit({
          import zap: *
          import cetz.draw: content, line
          joham.norator("norator1",(0,0), (-1.75,0))
        }))
      ],
      align(horizon+center, [
        $u = "bel." \ 
        i = "bel."$
      ]),
      [
        #scale(x: 75%, y: 75%, cetz.canvas({
          import cetz.draw: *
          import cetz-plot: *

          let opts = (x-tick-step: none, y-tick-step: none, size: (2, 1), x-label: [u], y-label: [i])

          plot.plot(axis-style: "school-book", ..opts, name: "plot", {
            plot.add-contour(x-domain: (-3, 3), y-domain: (-3, 3),
            style: (fill: rgb("#f7000832"), stroke: none),
            fill: true,
            op: "<", // Find contours where data < z
            z: (0,100000), // Z values to find contours for
            (x, y) => calc.sqrt(x*x + y * y))
          })
        }))
      ],
      align(left+top)[
        - #text("NICHT", red)  Verlustlos
        - Streng linear
          - Linear
          - Quellenfrei
          - Ungepolt
        - Resitiv, Induktiv, Kapazitiv, Memristiv
      ],
  table.hline(),

      // Kurzschluss
      [
        Kurzschluss
        #scale(x: 100%, y: 100%, zap.circuit({
          import zap: *
          import cetz.draw: content, line
        
          node("n1", (0, 0), fill: false)
          node("n2", (1, 0), fill: false)

          wire((0,0), (1,0))
          wire((-0.25,0), (0,0))
          wire((1,0), (1.25,0))

        }))
      ],
      align(horizon+center, [
        $u = 0 \
        i = "bel."$
      ]),
      [
        #scale(x: 75%, y: 75%, cetz.canvas({
          import cetz.draw: *
          import cetz-plot: *

          let opts = (x-tick-step: none, y-tick-step: none, size: (2, 1), x-label: [u], y-label: [i])

          plot.plot(axis-style: "school-book", ..opts, name: "plot", {

            plot.add(((0, -1), (0, 1)), style: (stroke: red))
          })
        }))
      ],
      align(left+top)[
        - Verlustlos
        - Streng linear
          - Linear
          - Quellenfrei
          - Ungepolt
        - #text("NICHT", red) u-gest.
        - i-gest.
      ],

      // Leerlauf
      [
        Leerlauf
        #scale(x: 100%, y: 100%, zap.circuit({
          import zap: *
          import cetz.draw: content, line
          node("n1", (0, 0), fill: false)
          node("n2", (1, 0), fill: false)
          
          wire((-0.25,0), (0,0))
          wire((1,0), (1.25,0))
        }))
      ],
      align(horizon+center, [
        $u = "bel." \
        i = 0$
      ]),
      [
        #scale(x: 75%, y: 75%, cetz.canvas({
          import cetz.draw: *
          import cetz-plot: *

          let opts = (x-tick-step: none, y-tick-step: none, size: (2, 1), x-label: [u], y-label: [i])

          plot.plot(axis-style: "school-book", ..opts, name: "plot", {

            plot.add(((-1, 0), (1, 0)), style: (stroke: red))
          })
        }))
      ],
      align(left+top)[
        - Verlustlos
        - Streng linear
          - Linear
          - Quellenfrei
          - Ungepolt
        - u-gest.
        - #text("NICHT", red) i-gest.
      ],

  table.hline(),
 // Quellen: //
      // Spannungs-quelle
      [
        Spannungs-quelle
        #scale(x: 100%, y: 100%, zap.circuit({
          import zap: *
          import cetz.draw: content, line
          vsource(
            fill: none,
            "b1",
            (0, 0),
            (1.75, 0),
          )
        }))
      ],
      align(horizon+center, [
        $u = U_0 \
        i = "bel."$
      ]),
      [
        #scale(x: 75%, y: 75%, cetz.canvas({
          import cetz.draw: *
          import cetz-plot: *

          let opts = (x-tick-step: none, y-tick-step: none, size: (2, 1), x-label: [u], y-label: [i])

          plot.plot(axis-style: "school-book", ..opts, name: "plot", {

            plot.add(((1, -1), (1, 1)), style: (stroke: red))
            plot.add-anchor("pt",(1,0))
          })
          content("plot.pt", [$U_0$], anchor: "north-west", padding: .1)
        }))
      ],
      align(left+top)[
      - Aktiv
      - Linear
      - Gepolt
      - i-gest.
      ],

      // Strom-quelle
      [
        Strom-quelle
        #scale(x: 100%, y: 100%, zap.circuit({
          import zap: *
          import cetz.draw: content, line
          isource(
            fill: none,
            "b1",
            (0, 0),
            (1.75, 0),
          )
        }))
      ],
      align(horizon+center, [
        $u = "bel." \
        i = I_0$
      ]),
      [
        #scale(x: 75%, y: 75%, cetz.canvas({
          import cetz.draw: *
          import cetz-plot: *

          let opts = (x-tick-step: none, y-tick-step: none, size: (2, 1), x-label: [u], y-label: [i])

          plot.plot(axis-style: "school-book", ..opts, name: "plot", {

            plot.add(((-1, 1), (1, 1)), style: (stroke: red))
            plot.add-anchor("pt",(0,1))
          })
          content("plot.pt", [$I_0$], anchor: "south-east", padding: .1)
        }))
      ],
      align(left+top)[
      - Aktiv
      - Linear
      - Gepolt
      - u-gest.
      ],

  table.hline(),

// Ohmscher Wiederstand
      [
        Ohm'sche Wiederstand
        #scale(x: 100%, y: 100%, zap.circuit({
          import zap: *
          import cetz.draw: content, line
          resistor(
            "b1",
            (0, 0),
            (2, 0),
          )
        }))
      ],
      align(center+horizon,
        $u = r dot i \
        i = u/r$
      ),
      [
        #scale(x: 75%, y: 75%, cetz.canvas({
          import cetz.draw: *
          import cetz-plot: *

          let opts = (x-tick-step: none, y-tick-step: none, size: (2, 1), x-label: [u], y-label: [i])

          plot.plot(axis-style: "school-book", ..opts, name: "plot", {

            plot.add(((-1, -1), (1, 1)), style: (stroke: red))
          })
        }))
      ],
      align(left+top)[
        - #text("NICHT", red)  Verlustlos
        - Streng linear
          - Linear
          - Quellenfrei
          - Ungepolt
        - u-gest.
        - i-gest.
      ],

      // Induktivität
      [
        Induktivität
        #scale(x: 100%, y: 100%, zap.circuit({
          import zap: *
          import cetz.draw: content, line
          inductor(
            "b1",
            (0, 0),
            (2, 0),
            variant: "ieee",
          )
        }))
      ],
      align(center+horizon)[
        $Phi(t) = L i(t)$\
        $u(t) = L (d i(t))/(d t)$
        $E_L (Phi_1) = Phi_1^2/(2L)$\ 
        $E_L (i_1) = L/2 i_1^2$
      ],
      [
         #scale(x: 75%, y: 75%, cetz.canvas({
          import cetz.draw: *
          import cetz-plot: *

          let opts = (x-tick-step: none, y-tick-step: none, size: (2, 1), x-label: [$Phi$], y-label: [$i$])

          plot.plot(axis-style: "school-book", ..opts, name: "plot", {

            plot.add(((-1, -1), (1, 1)), style: (stroke: red))
          })
        }))
      ],
      [],

      // Kapazität
      [
        Kapazität
        #scale(x: 100%, y: 100%, zap.circuit({
          import zap: *
          import cetz.draw: content, line
          capacitor(
            "b1",
            (0, 0),
            (2, 0),
          )
        }))
      ],
      align(center+horizon)[
        $q(t) = C u(t)$\
        $i(t) = C (d u(t))/(d t)$\
        $E_C (q_1) = q_1^2/(2C)$\ 
        $E_C (u_1) = C/2 u_1^2$
      ],
      [
        #scale(x: 75%, y: 75%, cetz.canvas({
          import cetz.draw: *
          import cetz-plot: *

          let opts = (x-tick-step: none, y-tick-step: none, size: (2, 1), x-label: [u], y-label: [q])

          plot.plot(axis-style: "school-book", ..opts, name: "plot", {

            plot.add(((-1, -1), (1, 1)), style: (stroke: red))
          })
        }))
      ],
      [],
      
  table.hline(),

      // Dioden ://
      //
      // ideale Diode
      [
        ideale Diode
        #scale(x: 100%, y: 100%, zap.circuit({
          import zap: *
          import cetz.draw: content, line
          //diode("b1", (0, 0), (1., 0), stroke: black, fill: false)
          joham.diode("id_di", (0,0), (1,0))
        }))
      ],
      align(horizon+center, [
        $i=0$ falls $u<0$\
        $i>=0$. falls $u=0$
      ]),
      [
        /*
        #scale(x: 50%, y: 50%,
          cetz.canvas({
            import cetz.draw: *
              line((-1.5, 0), (1.5, 0), mark: (end: "straight"))
              line((0, -1.5), (0, 1.5), mark: (end: "straight"))

              content( (1.55, 0), $u$, anchor: "west")
              content( (0.15, 1.4), $i$, anchor: "west")

              line((-1.5, 0), (0, 0), stroke: red)      // u = 0
              line((0, 0), (0, 1.35), stroke: red)      // i = 0

        }))
        */
        #scale(x: 75%, y: 75%, cetz.canvas({
          import cetz.draw: *
          import cetz-plot: *

          let opts = (x-tick-step: none, y-tick-step: none, size: (2, 1), x-label: [u], y-label: [i])

          plot.plot(axis-style: "school-book", ..opts, name: "plot", {
            plot.add(((-1, 0), (0, 0)), style: (stroke: red))
            plot.add(((0, 0), (0, 1)), style: (stroke: red))
          })
        }))
      ],
      [],

      // reale/pn Diode
      [
        reale/pn Diode
        #scale(x: 100%, y: 100%, zap.circuit({
          import zap: *
          import cetz.draw: content, line
          diode("b1", (0, 0), (1., 0), stroke: black, fill: black)
        }))
      ],

      align(horizon+center, [
        $u_D = u_T dot ln((i_D/I_S)+1) \
        i_D = I_S dot (e^(u_D/U_T)-1)$
      ]),
      [
        #scale(x: 75%, y: 75%, cetz.canvas({
          import cetz.draw: *
          import cetz-plot: *

          let opts = (x-tick-step: none, y-tick-step: none, size: (2, 1), x-label: [u], y-label: [i])
          let data = plot.add(x => calc.exp(x) - 1, domain: (-2, 2), style: (stroke: red))

          plot.plot(axis-style: "school-book", ..opts, data, name: "plot")
        }))
      ],
      [],

      // Photodiode
      [
        Photodiode
        #scale(x: 100%, y: 100%, zap.circuit({
          import zap: *
          import cetz.draw: content, line
          photodiode("b1", (0, 0), (1., 0), stroke: black, fill: black)
        }))
      ],
      align(horizon+center,
        $i = I_S dot (e^(u_D/U_T)-1)- i_L$
      ),
      [
        #scale(x: 75%, y: 75%, cetz.canvas({
          import cetz.draw: *
          import cetz-plot: *

          let opts = (x-tick-step: none, y-tick-step: none, size: (2, 1), x-label: [u], y-label: [i])

          plot.plot(axis-style: "school-book", ..opts, name: "plot", {
            plot.add(x => calc.exp(x) - 1, domain: (-2, 2), style: (stroke: red))

            plot.add(x => calc.exp(x) - 2, domain: (-2, 2), style: (stroke: red))

            plot.add(x => calc.exp(x) - 3, domain: (-2, 2), style: (stroke: red))
          })
        }))
      ],
      [],

      // Zenerdiode
      [
        Zenerdiode
        #scale(x: 100%, y: 100%, zap.circuit({
          import zap: *
          import cetz.draw: content, line
          zener("b1", (0, 0), (1., 0), stroke: black, fill: black)
        }))
      ],
      align(horizon+center, [
        Durchbruch bei $u=U_Z$ :
        $u<=U_Z$ stark leitend
      ]),
      [

      ],
      [],

      // Tunneldiode
      [
        Tunneldiode
        #scale(x: 100%, y: 100%, zap.circuit({
          import zap: *
          import cetz.draw: content, line
          tunnel("b1", (0, 0), (1., 0), stroke: black, fill: black)
        }))
      ],
      [

      ],
      [

      ],
      [],
      
    );
  ]
]

#pagebreak()
#bgBlock(fill: colorZweiTore, width: 100%)[
  #subHeading(fill: colorZweiTore)[OpAmp Schaltungen]

  #scale(opampTable, 100%)
]

// Zwei-Tor Tabelle

#grid(columns: (1fr))[
  #bgBlock(fill: colorZweiTore, width: 100%)[
  #subHeading(fill: colorZweiTore)[Zwei-Tor-Übersichts]

  
  #let opampSymbol = zap.circuit({
    import zap : wire, node
    import cetz.draw : line, rect

    joham.ideal-opamp("Op", (0,0), scale: 0.7, invert: true)

    wire("Op.plus", (rel: (-0.25, 0)))
    wire("Op.minus", (rel: (-0.25, 0)))
    wire("Op.ground", (rel: (0, -0.3)))
    wire("Op.out", (rel: (0.2,0)))

    node("a", (to: "Op.plus", rel: (-0.25, 0)), fill: false, label: (content: text($alpha$, fill: rgb("#8b2000")), anchor: "west", distance: 0.05))
    node("b", (to: "Op.minus", rel: (-0.25, 0)), fill: false, label: (content: text($beta$, fill: rgb("#8b2000")), anchor: "west", distance: 0.05))
    node("c", (to: "Op.out", rel: (0.25, 0)), fill: false, label: (content: text($gamma$, fill: rgb("#00318b")), anchor: "east", distance: 0.05))
    node("d", (to: "Op.ground", rel: (0, -0.3)), fill: false, label: (content: text($delta$, fill: rgb("#00318b")), anchor: "south", distance: 0.05))

    joham.voltage((to: "Op.plus", rel: (-0.25, 0)), (to: "Op.minus", rel: (-0.25, 0)), $u_"in"$)

    joham.voltage((to: "Op.out", rel: (0.25, 0)), (to: "Op.out", rel: (0.25, -0.7)), $u_"out"$, anchor: "west")
  })

  #table(
    fill: (x, y) => if calc.rem(y, 2) == 0 { tableFillHigh } else { tableFillLow },
    columns: (auto, auto, auto, auto, auto),
    [*Name*], [*Schaltbild*], [*Ersatz-Schaltbild*], [*Eigenschaften*], [*Beschreibung*],

    [Nullor], [], [#zap.circuit({
      import zap: *
      import cetz.draw: content, line, rect

      joham.nullator("a", (0,0), (0,1.5), scale: 0.5)
      joham.norator("b", (0.5,0), (0.5,1.5), scale: 0.5)

      wire("a.in", (rel: (-0.5, 0)))
      wire("a.out", (rel: (-0.5, 0)))
      wire("b.in", (rel: (0.5, 0)))
      wire("b.out", (rel: (0.5, 0)))

      node("N1", (rel: (-0.5, 0), to: "a.in"), fill: false)
      node("N2", (rel: (-0.5, 0), to: "a.out"), fill: false)
      node("N3", (rel: (0.5, 0), to: "b.in"), fill: false)
      node("N4", (rel: (0.5, 0), to: "b.out"), fill: false)

    })], 
    [
      - Verlustlos
      - Reziprok
      - Passiv
      - Symetrisch
    ], [$ A = mat(0, 0; 0, 0) $],

    [OpAmp \ $U_"sat+"$\ (4-polig)], opampSymbol, [], [], [],

    [OpAmp \ $U_"sat+"$], opampSymbol, [#zap.circuit({
      import zap : wire, vsource, node
      import cetz.draw : line, rect

      node("a", (0,1), fill: false, label: (content: text($alpha$, fill: rgb("#8b2000")), anchor: "west", distance: 0.05))
      node("b", (0,0), fill: false, label: (content: text($beta$, fill: rgb("#8b2000")), anchor: "west", distance: 0.05))

      wire((0,1), (0.4, 1))
      wire((0,0), (0.4, 0))

      joham.voltage((0.4, 1), (0.4, 0), $u_d$)
      joham.voltage((1.3, 1), (1.3, 0), $U_"sat"$, anchor: "west")

      vsource("v", (1,1), (1,0), scale: 0.4, fill: none)

      wire((1,1), (1.3,1))
      wire((1,0), (1.3,0))

      node("c", (1.3,1), fill: false, label: (content: text($gamma$, fill: rgb("#00318b")), anchor: "east", distance: 0.05))
      node("d", (1.3,0), fill: false, label: (content: text($delta$, fill: rgb("#00318b")), anchor: "east", distance: 0.05))
    })], [], [],

    [OpAmp \ $U_"sat-"$], opampSymbol, [#zap.circuit({
      import zap : wire, vsource, node
      import cetz.draw : line, rect

      node("a", (0,1), fill: false, label: (content: text($alpha$, fill: rgb("#8b2000")), anchor: "west", distance: 0.05))
      node("b", (0,0), fill: false, label: (content: text($beta$, fill: rgb("#8b2000")), anchor: "west", distance: 0.05))
      node("c", (1.3,1), fill: false, label: (content: text($gamma$, fill: rgb("#00318b")), anchor: "east", distance: 0.05))
      node("d", (1.3,0), fill: false, label: (content: text($delta$, fill: rgb("#00318b")), anchor: "east", distance: 0.05))

      wire((0,1), (0.4, 1))
      wire((0,0), (0.4, 0))

      joham.voltage((0.4, 1), (0.4, 0), $u_d$)
      joham.voltage((1.3, 1), (1.3, 0), $- U_"sat"$, anchor: "west")

      vsource("v", (1,1), (1,0), scale: 0.4, fill: none)

      wire((1,1), (1.3,1))
      wire((1,0), (1.3,0))
    })], [], [],

    [VCVS], [#zap.circuit({
      import zap : vsource, node, disource, dvsource, wire
      import cetz.draw : line, rect, mark, content

      node("A", (0,0), fill: false)
      node("B", (0,1), fill: false)
      node("C", (0.8,0), fill: false)
      node("D", (0.8,1), fill: false)
      
      joham.voltage((0, 1), (0, 0), $u_"in"$, anchor: "west")
      dvsource("S", (0.8,0), (0.8,1), fill: none, scale: 0.4)

      joham.voltage((1.1, 1), (1.1, 0), $u_"out" = mu u_"in"$, anchor: "west")
    })], [], [
      - NICHT Verlustlos
      - NICHT Reziprok
      - Aktiv
      - NICHT Symetrisch
    ], [$ H' = mat(0, 0; mu, 0) quad A = mat(1/mu, 0; 0, 0) $],

    [VCCS], [#zap.circuit({
      import zap : vsource, node, disource, dvsource, wire
      import cetz.draw : line, rect, mark, content

      node("A", (0,0), fill: false)
      node("B", (0,1), fill: false)
      node("C", (0.8,0), fill: false)
      node("D", (0.8,1), fill: false)
      
      joham.voltage((0, 1), (0, 0), $u_"in"$, anchor: "west")
      disource("S", (0.8,0), (0.8,1), fill: none, scale: 0.4)

      line((0.8,0.10), (0.8,0.09), mark: (end: ">", scale: 0.4, fill: black))
      content((0.9, 0.15), $i_"out" = g u_"in"$, anchor: "west")

    })], [], [
      - NICHT Verlustlos
      - NICHT Reziprok
      - Aktiv
      - NICHT Symetrisch
    ], [$ G = mat(0, 0; g, 0) quad A = mat(0, -1/g; 0, 0) $],

    [CCVS], [#zap.circuit({
      import zap : vsource, node, disource, dvsource, wire
      import cetz.draw : line, rect, mark, content

      node("A", (0,0), fill: false)
      node("B", (0,1), fill: false)
      node("C", (0.8,0), fill: false)
      node("D", (0.8,1), fill: false)
      
      wire((0,0), (0,1), i: (content: $i_"in"$, invert: true, anchor: "east", distance: 0.1), size: 0.2)
      dvsource("S", (0.8,0), (0.8,1), fill: none, scale: 0.4)

      joham.voltage((1.1, 1), (1.1, 0), $u_"out" = r i_"in"$, anchor: "west")
    })], [], [
      - NICHT Verlaustlos
      - NICHT Reziprok
      - Aktiv
      - NICHT Symetrisch
    ], [$ R = mat(0, 0; r, 0) quad A = mat(0, 0; 1/r, 0) $],

    [CCCS], [#zap.circuit({
      import zap : vsource, node, disource, dvsource, wire
      import cetz.draw : line, rect, mark, content

      node("A", (0,0), fill: false)
      node("B", (0,1), fill: false)
      node("C", (0.8,0), fill: false)
      node("D", (0.8,1), fill: false)
      
      wire((0,0), (0,1), i: (content: $i_"in"$, invert: true, anchor: "east", distance: 0.1), size: 0.2)
      disource("S", (0.8,0), (0.8,1), fill: none, scale: 0.4)

      line((0.8,0.15), (0.8,0.1), mark: (end: ">", scale: 0.2, fill: black))
      content((0.9, 0.15), $i_"out" = beta i_"in"$, anchor: "west")
    })], [], [
      - NICHT Verlustlos
      - NICHT Reziprok
      - Aktiv
      - NICHT Symetrisch
    ], [$ H = mat(0, 0; beta, 0) quad A = mat(0, 0; 0, -1/beta) $],

    [Übertrager], [#zap.circuit({
      import zap : vsource, node, disource, dvsource, wire
      import cetz.draw : line, rect, mark, content

      joham.transformer("T", (0,0), scale: 0.35)

      line((-0.6,0.58), (-0.5,0.58), mark: (end: ">", scale: 0.4, fill: black))
      line((0.5,0.58), (0.6,0.58), mark: (start: ">", scale: 0.4, fill: black))

      content((0.5, 0.8), $i_2$, anchor: "west")
      content((-0.65, 0.8), $i_1$, anchor: "west")
      joham.voltage((0.9, 0.7), (0.9, -0.7), $u_2$, anchor: "west")
      joham.voltage((-0.9, 0.7), (-0.9, -0.7), $u_1$, anchor: "east")
    })
      $ i_2 &= - ü i_1 &quad i_1 &= - 1/ü i_2 \
        u_2 &= 1/ü u_1 &quad u_1 &= ü u_2
      $
    ], [
      #align(horizon+center, zap.circuit({
        import zap : *
        import cetz.draw : line, rect, mark, content

        joham.gyrator("G1", (0,0), scale: 0.4, constant: $G_d$)
        joham.gyrator("G2", (1.6,0), scale: 0.4, constant: $ü G_d$)
        joham.ground("G", (0.8, -0.67))

        node("N1", "G1.12", fill: false, label: (content: $beta$, distance: 0.1))
        node("N1", "G1.11", fill: false, label: (content: $alpha$, distance: 0.1))
        node("N1", "G2.22", fill: false, label: (content: $delta$, distance: 0.1))
        node("N1", "G2.21", fill: false, label: (content: $gamma$, distance: 0.1))

        node("N1", (0.8, 0.67), label: (content: $epsilon$, distance: 0.1))
        node("N1", (0.8, -0.67))

      }))
    ], 
    [
      - Verlustlos
      - Reziprok
      - Passiv
      - Schief-Symetrisch (Symetrisch für $ü = plus.minus 1$)

    ], 
    [$ H = mat(0, ü; -ü, 0) &quad
    H' = mat(0, -1/ü; 1/ü, 0) \
    A = mat(ü, 0; 0, 1/ü) &quad A' = mat(1/ü, 0; 0, ü) \

    M = mat(1, -ü; 0, 0) &quad N = mat(0, 0; ü, 1)
    $], 
    

    [Gyrator],
    [#zap.circuit({
      import zap : *
      import cetz.draw : line, rect, mark, content

      joham.gyrator("G", (0, 0), scale: 0.35)

      line((-0.6,0.58), (-0.5,0.58), mark: (end: ">", scale: 0.4, fill: black))
      line((0.5,0.58), (0.6,0.58), mark: (start: ">", scale: 0.4, fill: black))

      content((0.5, 0.8), $i_2$, anchor: "west")
      content((-0.65, 0.8), $i_1$, anchor: "west")
      joham.voltage((1, 0.7), (1, -0.7), $u_2$, anchor: "west")
      joham.voltage((-1, 0.7), (-1, -0.7), $u_1$, anchor: "east")

      content((-0.7, -0.8), text([Output $cal(F)^d$], fill: rgb("#8b2000")))

      content((0.8, -0.8), text([Input $cal(F)$], fill: rgb("#00318b")))
    })
      $ u_1 = - R_d i_2 &quad i_1 = 1/R_d u_2 \
        u_2 = R_d i_1 &quad u_2 = - 1/R_d u_1
      $
    ],
    [],
    [
      - Verlustlos
      - NICHT Reziprok (Antireziprok)
      - Nicht Symetrisch (schiefsysmetrisch)

      Der Pfeil zeigt AUF die NORMAL Eintor
    ],
    [$ R = mat(0, -R_d; R_d, 0) &quad G = mat(0, G_d; -G_d, 0) \ 
      A = mat(0, R_d; 1/R_d, 0) &quad A' = mat(0, -R_d; -1/R_d, 0) \
      R_d = 1/G_d
     
     $],

    [NIK],
    [#zap.circuit({
      joham.zweitor("NIK", (0,0), label: "NIK")
    })],
    [#grid(
      columns: (auto, auto),
      column-gutter: -3mm,
      align(center+horizon, scale(75%, zap.circuit({
      import zap : *
      import cetz.draw : line, rect, mark, content

      node("A", (-2, 0), fill: false)
      node("B", (2, 0), fill: false)
      node("C", (-2, 1.5), fill: false)
      node("D", (2, 1.5), fill: false)

      wire("A", "B")

      joham.norator("Q1", (-1.5, 2), (1.5, 2), scale: 0.5)
      node("N1", (-1.5,1.5))
      node("N2", (0,1.5))
      node("N3", (1.5,1.5))
      resistor("R1", "N1", "N2", scale: 0.5, fill: none, label: (content: $R$, anchor: "south", distance: 1mm))
      resistor("R2", "N2", "N3", scale: 0.5, fill: none, label: (content: $R$, anchor: "south", distance: 1mm))
      wire("N1", "Q1.in")
      wire("N3", "Q1.out")
      wire("N1", "C", i: (content: $i_1$, invert: true))
      wire("N3", "D", i: (content: $i_2$, invert: true))
      joham.nullator("Q0", "N2", n:"*-*", (0,0), scale: 0.5)

      joham.voltage("C", "A", $u_1$)
      joham.voltage("D", "B", $u_2$)

      content((0,-0.4), $k = +1$, anchor: "south")
    }))),
    align(center+horizon, scale(75%, zap.circuit({
      import zap : *
      import cetz.draw : line, rect, mark, content

      node("A", (-2, 0), fill: false)
      node("B", (2, 0), fill: false)
      node("C", (-2, 1.5), fill: false)
      node("D", (2, 1.5), fill: false)

      wire("A", "B")

      joham.nullator("Q1", (-1.5, 2), (1.5, 2), scale: 0.5)
      node("N1", (-1.5,1.5))
      node("N2", (0,1.5))
      node("N3", (1.5,1.5))
      resistor("R1", "N1", "N2", scale: 0.5, fill: none, label: (content: $R$, anchor: "south", distance: 1mm))
      resistor("R2", "N2", "N3", scale: 0.5, fill: none, label: (content: $R$, anchor: "south", distance: 1mm))
      wire("N1", "Q1.in")
      wire("N3", "Q1.out")
      wire("N1", "C", i: (content: $i_1$, invert: true))
      wire("N3", "D", i: (content: $i_2$, invert: true))
      joham.norator("Q0", "N2", n:"*-*", (0,0), scale: 0.5)

      joham.voltage("C", "A", $u_1$)
      joham.voltage("D", "B", $u_2$)

      content((0,-0.4), $k = -1$, anchor: "south")
    }))))
    
    ],
    [
      - Aktiv
      - Antireziprok
      - Symetrisch für $abs(k) = 1$
    ],
    [$ H = mat(0, -k; -k, 0) quad H' = mat(0, -1/k; -1/k, 0) \ A = mat(-k, 0; 0, 1/k) quad A'= mat(-1/k, 0; 0, k) $]
  )
  ]
]

// Knoten Spannungs Analyse
#pagebreak()
// Tor Eigenschaften
#bgBlock(fill: colorEigenschaften, width: 100%)[
  #subHeading(fill: colorEigenschaften)[Tor Eigenschaften]

  #table(
    columns: (auto, auto, auto, auto),
    inset: 2mm,
    align: horizon,
    fill: (x, y) => if calc.rem(y, 2) == 1 { rgb("#c5c5c5") } else { white },

    table.header([], [*Ein-Tor*], [*Zwei-Tor*], [*Reaktive Elemente*]),
    [*passiv*\ (nimmt Energie auf)\ $not$aktiv],
    [$forall (u,i) in cal(F): u dot i >= 0$],
    [
      $jMat(U)^T jMat(I) + jMat(I)^T jMat(U) = 0$\
      $forall vec(jVec(u), jVec(v)) in cal(F) : jVec(u)^T jVec(i) >=0 \
      jMat(G) = - jMat(G)^T quad jMat(R) = - jMat(R)^T$
    ],
    [],

    [*verlustlos*],
    [
      $forall (u,i) in cal(F): u dot i = 0$\

      Kennline nur $u\/i$-Achsen
    ],
    [$forall vec(jVec(u), jVec(v)) in cal(F) : jVec(u)^T jVec(i) = 0$],
    grid(columns: (auto, auto), 
      column-gutter: 5mm,
    [
      $u\/q$-Plot: Wenn keine Schleifen \
      $i\/Phi$-Plot: Wenn keine Schleifen  
    ], [
      $u\/i$-Plot: Wenn Auf Achse \
      $Phi\/q$-Plot: Wenn auf Achse \
    ], [
      
    ]),

    [*linear*],
    [Kennline ist Gerade],
    [
      Darstellbar: Matrix $+$ Aufpunkt\
      $lambda_1 vec(jVec(u)_1, jVec(i)_1) + lambda_2 vec(jVec(u)_2, jVec(i)_2) in cal(F)$
    ],
    [],

    [*quellenfrei*],
    [$(qty("0", "A"), qty("0", "V")) in cal(F)$],
    [$(qty("0", "A"), qty("0", "V")) in cal(F)$],
    [$(qty("0", "A"), qty("0", "V")) in cal(F)$],

    [*streng linear*], [linear UND quellenfrei UND ungepolt], [linear UND quellenfrei\ Darstellbar: Nur Matrix], [],

    [*ungepolt* \ (Punkt sym.)],
    [$(u,i) in cal(F) <=> (-u, -i) in cal(F)\
    g(u) = i, r(i) = u$],
    [
      N/A
    ],
    [],

    [*symetrisch*\ $<=>$ Umkehrbar],
    [N/A],
    [
      $jMat(A) = jMat(A')$\
      $jMat(G) = jMat(P) jMat(G) jMat(P), space jMat(R) = jMat(P) jMat(R) jMat(P), quad jMat(P) = mat(0, 1; 1, 0) \
      det(H) = 1,$

      Für Eintore: Streng Linear $=>$ Umkehrbar

    ],
    [],

    [*Reziprok*],
    [Immer Reziprok],
    [
      Symetrisch $=>$ Reziprok \
      Für Eintore: Streng Linear $=>$ Reziprok

      $jMat(U)^T jMat(I) - jMat(I)^T jMat(U) = 0 \
      jMat(R)^T = jMat(R), quad jMat(G)^T = jMat(G) quad h_21 = -h_12 \ det(jMat(A)) = 1 quad det(jMat(A')) = 1 quad h'_21 = -h'_12$],
    [],

    [*$x$-gesteudert*], [Existiert $r(i) = u \/g(u) = i$], [Existiert die Matrix? siehe Tabelle], [],

    [Alle Beschreibung], [Klar], [$det(M) != 0$, Alle Eintrag $!= 0$],
  )
]

#pagebreak()
#bgBlock(fill: colorZweiTore)[
  #set text(size: 10pt)

  #subHeading(fill: colorZweiTore)[Umrechnung Zweitormatrizen]
  #table(
    columns: (12mm, 1fr, 1fr, 1fr, 1fr, 1fr, 1fr),
    align: center,
    inset: (bottom: 4mm, top: 4mm),
    gutter: 0.1mm,
    fill: (x, y) => if x != 0 and calc.rem(x, 2) == 0 { rgb("#c5c5c5") } else { white },

    table.cell(
      inset: 0mm,
      [
        #cetz.canvas(length: 12mm, {
          import cetz.draw: *
          line((1, 0), (0, 1))
          content((0.309, 0.25), "Out")
          content((0.75, 0.75), "In")
        })
      ],
    ),
    $bold(R) quad mat(Omega, Omega; Omega, Omega)$,
    $bold(G) quad mat(S, S; S, S)$,
    $bold(H) quad mat(Omega, 1; 1, S)$,
    $bold(H') quad mat(S, 1; 1, Omega)$,
    $bold(A) quad mat(S, 1; 1, Omega)$,
    $bold(A') quad mat(S, 1; 1, Omega)$,

    $bold(R)$,
    $mat(r_11, r_12; r_21, r_22)$,
    $jMat(G^(-1) =) 1/det(bold(G)) mat(g_22, -g_12; -g_21, g_11)$,
    $1/h_22 mat(det(bold(H)), h_12; -h_21, 1)$,
    $1/h'_11 mat(1, -h'_12; h'_21, det(bold(H')))$,
    $1/a_21 mat(a_11, det(bold(A)); 1, a_22)$,
    $1/a'_21 mat(a'_22, 1; det(bold(A')), a'_11)$,

    $bold(G)$,
    $jMat(R^(-1) =) 1/det(bold(R)) mat(r_22, -r_12; -r_21, r_11)$,
    $mat(g_11, g_12; g_21, g_22)$,
    $1/h_11 mat(1, -h_12; h_21, det(bold(H)))$,
    $1/h'_22 mat(det(bold(H')), h'_12; -h'_21, 1)$,
    $1/a_12 mat(a_22, -det(bold(A)); -1, a_11)$,
    $1/a'_12 mat(a'_11, -1; -det(bold(A')), a'_22)$,

    $bold(H)$,
    $1/r_22 mat(det(bold(R)), r_12; -r_21, 1)$,
    $1/g_11 mat(1, -g_12; g_21, det(bold(G)))$,
    $mat(h_11, h_12; h_21, h_22)$,
    $jMat(H')^(-1)= 1/det(bold(H')) mat(h'_22, -h'_12; -h'_21, h'_11)$,
    $1/a_22 mat(a_12, det(bold(A)); -1, a_21)$,
    $1/a'_11 mat(a'_12, 1; -det(bold(A')), a'_21)$,

    $bold(H')$,
    $1/r_11 mat(1, -r_12; r_21, det(bold(R)))$,
    $1/g_22 mat(det(bold(G)), g_12; -g_21, 1)$,
    $jMat(H^(-1))= 1/det(bold(H)) mat(h_22, -h_12; -h_21, h_11)$,
    $mat(h'_11, h'_12; h'_21, h'_22)$,
    $1/a_11 mat(a_21, -det(bold(A)); 1, a_12)$,
    $1/a'_22 mat(a'_21, -1; det(bold(A')), a'_12)$,

    $bold(A)$,
    $1/r_21 mat(r_11, det(bold(R)); 1, r_22)$,
    $1/g_21 mat(-g_22, -1; -det(bold(G)), -g_11)$,
    $1/h_21 mat(-det(bold(H)), -h_11; -h_22, -1)$,
    $1/h'_21 mat(1, h'_22; h'_11, det(bold(H')))$,
    $mat(a_11, a_12; a_21, a_22)$,
    $jMat(A'^(-1))= 1/det(bold(A')) mat(a'_22, a'_12; a'_21, a'_11)$,

    $bold(A')$,
    $1/r_12 mat(r_22, det(bold(R)); 1, r_11)$,
    $1/g_12 mat(-g_11, -1; -det(bold(G)), -g_22)$,
    $1/h_12 mat(1, h_11; h_22, det(bold(H)))$,
    $1/h'_12 mat(-det(bold(H')), -h'_22; -h'_11, -1)$,
    $jMat(A^(-1))= 1/det(bold(A)) mat(a_22, a_12; a_21, a_11)$,
    $mat(a'_11, a'_12; a'_21, a'_22)$,
  )

  #table(
    columns: (12mm, 1fr, 1fr, 1fr, 1fr, 1fr, 1fr),
    align: center,
    inset: (bottom: 4mm, top: 4mm),
    gutter: 0.1mm,
    fill: (x, y) => if x != 0 and calc.rem(x, 2) == 0 { rgb("#c5c5c5") } else { white },
    [],
    $bold(R) jVec(i) = jVec(u)$,
    $bold(G) jVec(u) = jVec(i)$,
    $bold(H) vec(i_1, u_2) = vec(u_1, i_2)$,
    $bold(H') vec(u_1, i_2) = vec(i_1, u_2)$,
    $bold(A) vec(u_2, -i_2) = vec(i_1, u_1)$,
    $bold(A') vec(u_1, -i_1) = vec(i_2, u_2)$,
    [],
    [Stromge-steuert],
    [Spannung-gesteuert],
    [Hybrid-beschreibung],
    [Inverse-Hybrid],
    [Ketten-Beschreibung],
    [Inverse-Ketten],
    [],
    $jVec(r)vec(i_1, i_2) = vec(u_1, u_2)$,
    $jVec(g)vec(u_1, u_2) = vec(i_1, i_2)$,
    $jVec(h) vec(i_1, u_2) = vec(u_1, i_2)$,
    $jVec(h') vec(u_1, i_2) = vec(i_1, u_2)$,
    $jVec(a) vec(u_2, -i_2) = vec(i_1, u_1)$,
    $jVec(a') vec(u_1, -i_1) = vec(i_2, u_2)$,
  )
]

#place(bottom+center, float: true)[#text(rgb("#992893"), size: 60pt, font: "DejaVu Sans")[*DON'T PANIC!*]]