$(instance)ChuaCircuit Icon

ChuaCircuit

Chua's circuit

Chua's circuit is the simplest nonlinear circuit which shows chaotic behaviour. The circuit consists of linear basic elements (capacitors, resistor, conductor, inductor), and one nonlinear element, which is called Chua's diode.

Usage

ChuaCircuit()

Behavior

\[ \begin{equation} \left[ \begin{array}{c} \mathrm{connect}\left( inductor_{+}n, resistor_{+}p \right) \\ \mathrm{connect}\left( inductor_{+}p, capacitor2_{+}p, conductor_{+}p \right) \\ \mathrm{connect}\left( conductor_{+}n, nonlinear_{resistor_{+}p}, capacitor1_{+}p \right) \\ \mathrm{connect}\left( ground_{+}g, resistor_{+}n, capacitor2_{+}n, capacitor1_{+}n, nonlinear_{resistor_{+}n} \right) \\ \mathtt{inductor.v}\left( t \right) = - \mathtt{inductor.n.v}\left( t \right) + \mathtt{inductor.p.v}\left( t \right) \\ \mathtt{inductor.i}\left( t \right) = \mathtt{inductor.p.i}\left( t \right) \\ \mathtt{inductor.p.i}\left( t \right) + \mathtt{inductor.n.i}\left( t \right) = 0 \\ \mathtt{inductor.L} \frac{\mathrm{d} \mathtt{inductor.i}\left( t \right)}{\mathrm{d}t} = \mathtt{inductor.v}\left( t \right) \\ \mathtt{resistor.v}\left( t \right) = - \mathtt{resistor.n.v}\left( t \right) + \mathtt{resistor.p.v}\left( t \right) \\ \mathtt{resistor.i}\left( t \right) = \mathtt{resistor.p.i}\left( t \right) \\ \mathtt{resistor.p.i}\left( t \right) + \mathtt{resistor.n.i}\left( t \right) = 0 \\ \mathtt{resistor.v}\left( t \right) = \mathtt{resistor.R} \mathtt{resistor.i}\left( t \right) \\ \mathtt{conductor.v}\left( t \right) = \mathtt{conductor.p.v}\left( t \right) - \mathtt{conductor.n.v}\left( t \right) \\ \mathtt{conductor.i}\left( t \right) = \mathtt{conductor.p.i}\left( t \right) \\ \mathtt{conductor.p.i}\left( t \right) + \mathtt{conductor.n.i}\left( t \right) = 0 \\ \mathtt{conductor.i}\left( t \right) = \mathtt{conductor.G} \mathtt{conductor.v}\left( t \right) \\ \mathtt{capacitor1.v}\left( t \right) = - \mathtt{capacitor1.n.v}\left( t \right) + \mathtt{capacitor1.p.v}\left( t \right) \\ \mathtt{capacitor1.i}\left( t \right) = \mathtt{capacitor1.p.i}\left( t \right) \\ \mathtt{capacitor1.n.i}\left( t \right) + \mathtt{capacitor1.p.i}\left( t \right) = 0 \\ \mathtt{capacitor1.C} \frac{\mathrm{d} \mathtt{capacitor1.v}\left( t \right)}{\mathrm{d}t} = \mathtt{capacitor1.i}\left( t \right) \\ \mathtt{capacitor2.v}\left( t \right) = \mathtt{capacitor2.p.v}\left( t \right) - \mathtt{capacitor2.n.v}\left( t \right) \\ \mathtt{capacitor2.i}\left( t \right) = \mathtt{capacitor2.p.i}\left( t \right) \\ \mathtt{capacitor2.n.i}\left( t \right) + \mathtt{capacitor2.p.i}\left( t \right) = 0 \\ \mathtt{capacitor2.C} \frac{\mathrm{d} \mathtt{capacitor2.v}\left( t \right)}{\mathrm{d}t} = \mathtt{capacitor2.i}\left( t \right) \\ \mathtt{nonlinear\_resistor.v}\left( t \right) = \mathtt{nonlinear\_resistor.p.v}\left( t \right) - \mathtt{nonlinear\_resistor.n.v}\left( t \right) \\ \mathtt{nonlinear\_resistor.i}\left( t \right) = \mathtt{nonlinear\_resistor.p.i}\left( t \right) \\ \mathtt{nonlinear\_resistor.n.i}\left( t \right) + \mathtt{nonlinear\_resistor.p.i}\left( t \right) = 0 \\ \mathtt{nonlinear\_resistor.i}\left( t \right) = ifelse\left( \mathtt{nonlinear\_resistor.v}\left( t \right) < - \mathtt{nonlinear\_resistor.Ve}, - \mathtt{nonlinear\_resistor.Ga} \mathtt{nonlinear\_resistor.Ve} + \mathtt{nonlinear\_resistor.Gb} \left( \mathtt{nonlinear\_resistor.Ve} + \mathtt{nonlinear\_resistor.v}\left( t \right) \right), ifelse\left( \mathtt{nonlinear\_resistor.v}\left( t \right) > \mathtt{nonlinear\_resistor.Ve}, \mathtt{nonlinear\_resistor.Ga} \mathtt{nonlinear\_resistor.Ve} + \mathtt{nonlinear\_resistor.Gb} \left( - \mathtt{nonlinear\_resistor.Ve} + \mathtt{nonlinear\_resistor.v}\left( t \right) \right), \mathtt{nonlinear\_resistor.Ga} \mathtt{nonlinear\_resistor.v}\left( t \right) \right) \right) \\ \mathtt{ground.g.v}\left( t \right) = 0 \\ \end{array} \right] \end{equation} \]

Source

# Chua's circuit
#
# Chua's circuit is the simplest nonlinear circuit which shows chaotic behaviour.
# The circuit consists of linear basic elements (capacitors, resistor, conductor,
# inductor), and one nonlinear element, which is called Chua's diode.
component ChuaCircuit
  inductor = Inductor(L=18) [{
    "JuliaSim": {"placement": {"icon": {"x1": 0, "y1": 200, "x2": 200, "y2": 400, "rot": 90}}}
  }]
  resistor = Resistor(R=12.5e-3) [{
    "JuliaSim": {"placement": {"icon": {"x1": 0, "y1": 500, "x2": 200, "y2": 700, "rot": 90}}}
  }]
  conductor = Conductor(G=0.565) [{
    "JuliaSim": {"placement": {"icon": {"x1": 450, "y1": 50, "x2": 650, "y2": 250, "rot": 0}}}
  }]
  capacitor1 = Capacitor(C=10) [{
    "JuliaSim": {"placement": {"icon": {"x1": 600, "y1": 350, "x2": 800, "y2": 550, "rot": 90}}}
  }]
  capacitor2 = Capacitor(C=100) [{
    "JuliaSim": {"placement": {"icon": {"x1": 300, "y1": 350, "x2": 500, "y2": 550, "rot": 90}}}
  }]
  nonlinear_resistor = NonlinearResistor(Ga=-0.757576, Gb=-0.409091, Ve=1) [{
    "JuliaSim": {
      "placement": {"icon": {"x1": 900, "y1": 350, "x2": 1100, "y2": 550, "rot": 90}}
    }
  }]
  ground = Ground() [{
    "JuliaSim": {"placement": {"icon": {"x1": 450, "y1": 800, "x2": 650, "y2": 1000, "rot": 0}}}
  }]
relations
  initial inductor.i = 0
  initial capacitor1.v = 4
  initial capacitor2.v = 0
  connect(inductor.n, resistor.p) [{"JuliaSim": {"edges": [{"S": 1, "E": 2}]}}]
  connect(inductor.p, capacitor2.p, conductor.p) [{
    "JuliaSim": {
      "edges": [
        {"S": -1, "M": [{"x": 100, "y": 150}], "E": 1},
        {"S": -1, "E": 2},
        {"S": -1, "E": 3}
      ],
      "junctions": [{"x": 400, "y": 150}]
    }
  }]
  connect(conductor.n, nonlinear_resistor.p, capacitor1.p) [{
    "JuliaSim": {
      "edges": [
        {"S": -1, "E": 1},
        {"S": -1, "M": [{"x": 1000, "y": 150}], "E": 2},
        {"S": -1, "E": 3}
      ],
      "junctions": [{"x": 700, "y": 150}]
    }
  }]
  connect(ground.g, resistor.n, capacitor2.n, capacitor1.n, nonlinear_resistor.n) [{
    "JuliaSim": {
      "edges": [
        {"S": -1, "E": 1},
        {"S": -1, "M": [{"x": 100, "y": 750}], "E": 2},
        {"S": -1, "M": [{"x": 400, "y": 750}], "E": 3},
        {"S": -1, "M": [{"x": 700, "y": 750}], "E": 4},
        {"S": -1, "M": [{"x": 1000, "y": 750}], "E": 5}
      ],
      "junctions": [{"x": 550, "y": 750}]
    }
  }]
metadata {
  "JuliaSim": {"tests": {"case1": {"stop": 50000, "expect": {"signals": ["capacitor1.v"]}}}}
}
end
Flattened Source
# Chua's circuit
#
# Chua's circuit is the simplest nonlinear circuit which shows chaotic behaviour.
# The circuit consists of linear basic elements (capacitors, resistor, conductor,
# inductor), and one nonlinear element, which is called Chua's diode.
component ChuaCircuit
  inductor = Inductor(L=18) [{
    "JuliaSim": {"placement": {"icon": {"x1": 0, "y1": 200, "x2": 200, "y2": 400, "rot": 90}}}
  }]
  resistor = Resistor(R=12.5e-3) [{
    "JuliaSim": {"placement": {"icon": {"x1": 0, "y1": 500, "x2": 200, "y2": 700, "rot": 90}}}
  }]
  conductor = Conductor(G=0.565) [{
    "JuliaSim": {"placement": {"icon": {"x1": 450, "y1": 50, "x2": 650, "y2": 250, "rot": 0}}}
  }]
  capacitor1 = Capacitor(C=10) [{
    "JuliaSim": {"placement": {"icon": {"x1": 600, "y1": 350, "x2": 800, "y2": 550, "rot": 90}}}
  }]
  capacitor2 = Capacitor(C=100) [{
    "JuliaSim": {"placement": {"icon": {"x1": 300, "y1": 350, "x2": 500, "y2": 550, "rot": 90}}}
  }]
  nonlinear_resistor = NonlinearResistor(Ga=-0.757576, Gb=-0.409091, Ve=1) [{
    "JuliaSim": {
      "placement": {"icon": {"x1": 900, "y1": 350, "x2": 1100, "y2": 550, "rot": 90}}
    }
  }]
  ground = Ground() [{
    "JuliaSim": {"placement": {"icon": {"x1": 450, "y1": 800, "x2": 650, "y2": 1000, "rot": 0}}}
  }]
relations
  initial inductor.i = 0
  initial capacitor1.v = 4
  initial capacitor2.v = 0
  connect(inductor.n, resistor.p) [{"JuliaSim": {"edges": [{"S": 1, "E": 2}]}}]
  connect(inductor.p, capacitor2.p, conductor.p) [{
    "JuliaSim": {
      "edges": [
        {"S": -1, "M": [{"x": 100, "y": 150}], "E": 1},
        {"S": -1, "E": 2},
        {"S": -1, "E": 3}
      ],
      "junctions": [{"x": 400, "y": 150}]
    }
  }]
  connect(conductor.n, nonlinear_resistor.p, capacitor1.p) [{
    "JuliaSim": {
      "edges": [
        {"S": -1, "E": 1},
        {"S": -1, "M": [{"x": 1000, "y": 150}], "E": 2},
        {"S": -1, "E": 3}
      ],
      "junctions": [{"x": 700, "y": 150}]
    }
  }]
  connect(ground.g, resistor.n, capacitor2.n, capacitor1.n, nonlinear_resistor.n) [{
    "JuliaSim": {
      "edges": [
        {"S": -1, "E": 1},
        {"S": -1, "M": [{"x": 100, "y": 750}], "E": 2},
        {"S": -1, "M": [{"x": 400, "y": 750}], "E": 3},
        {"S": -1, "M": [{"x": 700, "y": 750}], "E": 4},
        {"S": -1, "M": [{"x": 1000, "y": 750}], "E": 5}
      ],
      "junctions": [{"x": 550, "y": 750}]
    }
  }]
metadata {
  "JuliaSim": {"tests": {"case1": {"stop": 50000, "expect": {"signals": ["capacitor1.v"]}}}}
}
end

Test Cases

Test Case case1

Signal `capacitor1.v` for test `case1` of `ChuaCircuit`

  • Examples
  • Experiments
  • Analyses