Skip to content

Circuits

Electric circuits.

ChuaSystem(x=None, y=None, z=0.0, *, nonlinearity='piecewise-linear', alpha=None, beta=None, label='system', solver='auto', backend='auto')

Bases: BaseSystem

Chua's circuit, whose double-scroll or multiscroll attractor is chaotic.

The voltages of the two capacitors and the current of the inductor, in dimensionless form, follow x' = alpha (y - f(x)), y' = x - y + z, and z' = -β y. The piecewise-linear diode has f(x) = x + m1 x + (m0 - m1) (|x + 1| - |x - 1|) / 2, which gives the double scroll. The sine diode has f(x) = -b sin(π x / (2 a)), continued linearly beyond |x| = 2 a c, which gives several scrolls side by side. The system has the states circuit.x, circuit.y, and circuit.z.

Parameters:

Name Type Description Default
x float | None

The initial voltage of the first capacitor, or None for 0.1 with the piecewise-linear diode and 1 with the sine diode.

None
y float | None

The initial voltage of the second capacitor, or None for 0 with the piecewise-linear diode and 1 with the sine diode.

None
z float

The initial current of the inductor.

0.0
nonlinearity str

The characteristic of the diode, 'piecewise-linear' for the double scroll or 'sine' for multiple scrolls.

'piecewise-linear'
alpha float | None

The ratio of the capacitances, or None for 15.6 with the piecewise-linear diode and 10.82 with the sine diode.

None
beta float | None

The ratio of the inductance to the second capacitance, or None for 28 with the piecewise-linear diode and 14.286 with the sine diode.

None
label str

The label of the system, which names it when it is nested in another one.

'system'
solver BaseSolver | str

The solver of the problem, or 'auto' for the one the system chooses.

'auto'
backend BaseBackend | str

The backend that evaluates the compiled functions, or 'auto' for the one the system chooses.

'auto'

Raises:

Type Description
ParameterError

The nonlinearity is neither 'piecewise-linear' nor 'sine'.

Examples:

>>> from skcomplex.systems.engineering.circuits import ChuaSystem
>>> ChuaSystem(nonlinearity='sine').prepare().system_.interactions[0].alpha
10.82
Source code in src/skcomplex/systems/engineering/circuits/_circuits.py
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
def __init__(
    self,
    x: float | None = None,
    y: float | None = None,
    z: float = 0.0,
    *,
    nonlinearity: str = 'piecewise-linear',
    alpha: float | None = None,
    beta: float | None = None,
    label: str = 'system',
    solver: BaseSolver | str = 'auto',
    backend: BaseBackend | str = 'auto',
) -> None:
    super().__init__(label, solver=solver, backend=backend)
    self.x = x
    self.y = y
    self.z = z
    self.nonlinearity = nonlinearity
    self.alpha = alpha
    self.beta = beta

ColpittsCouplingInteraction(label, *, source, target, k=0.4)

Bases: Interaction

Coupling of a Colpitts oscillator to another through their second variables.

It adds y_t' += k (y_s - y_t).

Parameters:

Name Type Description Default
label str

The label of the interaction.

required
source Role

The path of the oscillator whose second variable the coupling reads.

required
target Role

The path of the oscillator whose second variable the coupling changes.

required
k Annotated[float, closed_open(0, oo)]

The coupling strength.

0.4

Examples:

>>> from skcomplex.systems.engineering.circuits import ColpittsCouplingInteraction
>>> ColpittsCouplingInteraction('coupling', source='a', target='b', k=0.4).k
0.4
Source code in src/skcomplex/systems/engineering/circuits/_coupled_colpitts.py
165
166
167
168
169
170
171
172
173
174
175
176
def __init__(
    self,
    label: str,
    *,
    source: Role,
    target: Role,
    k: Annotated[float, RealSet.closed_open(0, oo)] = 0.4,
) -> None:
    super().__init__(label)
    self.source = source
    self.target = target
    self.k = k

ColpittsDynamicsInteraction(label, *, target)

Bases: Interaction

Dynamics of one Colpitts oscillator, with the constants the oscillator holds.

It sets x' = omega y - a F(z), y' = c - omega x - z - b y, and z' = epsilon (y - d), with F(z) = max(0, -1 - z).

Parameters:

Name Type Description Default
label str

The label of the interaction.

required
target Role

The path of the oscillator.

required

Examples:

>>> from skcomplex.systems.engineering.circuits import ColpittsDynamicsInteraction
>>> ColpittsDynamicsInteraction('dynamics', target='oscillator').target
'oscillator'
Source code in src/skcomplex/systems/engineering/circuits/_coupled_colpitts.py
118
119
120
def __init__(self, label: str, *, target: Role) -> None:
    super().__init__(label)
    self.target = target

ColpittsOscillatorElement(label, *, x=0.1, y=0.0, z=0.0, omega=1.0, a=30.0, b=1.0, c=20.0, d=1.0, epsilon=1.0)

Bases: Element

Colpitts oscillator in dimensionless form.

Its transistor conducts below a threshold of its third variable. The oscillator follows x' = omega y - a F(z), y' = c - omega x - z - b y, and z' = epsilon (y - d), with the transistor characteristic F(z) = max(0, -1 - z), which is chaotic for a = 30, b = 1, c = 20, d = 1, and epsilon = 1.

Parameters:

Name Type Description Default
label str

The label of the oscillator.

required
x float

The initial first variable.

0.1
y float

The initial second variable.

0.0
z float

The initial third variable.

0.0
omega Annotated[float, open(0, oo)]

The natural frequency.

1.0
a Annotated[float, closed_open(0, oo)]

The gain of the transistor.

30.0
b Annotated[float, closed_open(0, oo)]

The damping of the second variable.

1.0
c float

The bias of the second variable.

20.0
d float

The offset of the third variable.

1.0
epsilon Annotated[float, open(0, oo)]

The time scale of the third variable.

1.0

Examples:

>>> from skcomplex.systems.engineering.circuits import ColpittsOscillatorElement
>>> ColpittsOscillatorElement('oscillator').a
30.0
Source code in src/skcomplex/systems/engineering/circuits/_coupled_colpitts.py
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
def __init__(
    self,
    label: str,
    *,
    x: float = 0.1,
    y: float = 0.0,
    z: float = 0.0,
    omega: Annotated[float, RealSet.open(0, oo)] = 1.0,
    a: Annotated[float, RealSet.closed_open(0, oo)] = 30.0,
    b: Annotated[float, RealSet.closed_open(0, oo)] = 1.0,
    c: float = 20.0,
    d: float = 1.0,
    epsilon: Annotated[float, RealSet.open(0, oo)] = 1.0,
) -> None:
    super().__init__(label)
    self.x = x
    self.y = y
    self.z = z
    self.omega = omega
    self.a = a
    self.b = b
    self.c = c
    self.d = d
    self.epsilon = epsilon

CoupledColpittsSystem(k=0.4, *, omegas=(1.02, 0.98), a=30.0, b=1.0, c=20.0, d=1.0, epsilon=1.0, label='system', solver='auto', backend='auto')

Bases: BaseSystem

Two detuned chaotic Colpitts oscillators.

They are coupled through the difference of their second variables. Oscillator i follows x' = omega_i y - a F(z), y' = c - omega_i x - z - b y + k (y_j - y_i), and z' = epsilon (y - d), with the transistor characteristic F(z) = max(0, -1 - z). The phase of an oscillator is the angle of its orbit in the plane of y and z, around the means of both. Without coupling the two oscillators run at different mean frequencies and their phases drift apart, while for k near 0.3 to 0.5 their phases lock although their amplitudes stay irregular.

The system has the states oscillator_0.x, oscillator_0.y, oscillator_0.z, and the same states of oscillator_1.

Parameters:

Name Type Description Default
k float

The coupling strength.

0.4
omegas tuple[float, float]

The natural frequencies of the two oscillators.

(1.02, 0.98)
a float

The gain of the transistor.

30.0
b float

The damping of the second variable.

1.0
c float

The bias of the second variable.

20.0
d float

The offset of the third variable.

1.0
epsilon float

The time scale of the third variable.

1.0
label str

The label of the system, which names it when it is nested in another one.

'system'
solver BaseSolver | str

The solver of the problem, or 'auto' for the one the system chooses.

'auto'
backend BaseBackend | str

The backend that evaluates the compiled functions, or 'auto' for the one the system chooses.

'auto'

Examples:

>>> from skcomplex.systems.engineering.circuits import CoupledColpittsSystem
>>> [element.omega for element in CoupledColpittsSystem().prepare().system_.elements]
[1.02, 0.98]
Source code in src/skcomplex/systems/engineering/circuits/_coupled_colpitts.py
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
def __init__(
    self,
    k: float = 0.4,
    *,
    omegas: tuple[float, float] = (1.02, 0.98),
    a: float = 30.0,
    b: float = 1.0,
    c: float = 20.0,
    d: float = 1.0,
    epsilon: float = 1.0,
    label: str = 'system',
    solver: BaseSolver | str = 'auto',
    backend: BaseBackend | str = 'auto',
) -> None:
    super().__init__(label, solver=solver, backend=backend)
    self.k = k
    self.omegas = omegas
    self.a = a
    self.b = b
    self.c = c
    self.d = d
    self.epsilon = epsilon

ImpulsiveCircuitsSystem(x=0.0, current=0.0, *, L=1.0, R=0.1, C=1.0, A=1.0, T=2.0, label='system', solver='auto', backend='auto')

Bases: BaseSystem

An RLC circuit driven by a periodic train of current impulses.

It follows L x'' + R x' + x / C = (A / C) Σ δ(t - k T). Every impulse is an event that raises the rate of change x' by A / (L C), and between impulses the circuit rings down freely. The response settles on a periodic, non-sinusoidal waveform of period T. The system has the response circuit.x and its rate circuit.x', kicked by the impulses impulse.

Parameters:

Name Type Description Default
x float

The initial value of the response, the current of the coil.

0.0
current float

The initial rate of change of the response.

0.0
L float

The inductance.

1.0
R float

The resistance.

0.1
C float

The capacitance.

1.0
A float

The strength of every impulse.

1.0
T float

The period of the impulses.

2.0
label str

The label of the system, which names it when it is nested in another one.

'system'
solver BaseSolver | str

The solver of the problem, or 'auto' for the one the system chooses.

'auto'
backend BaseBackend | str

The backend that evaluates the compiled functions, or 'auto' for the one the system chooses.

'auto'

Examples:

>>> from skcomplex.systems.engineering.circuits import ImpulsiveCircuitsSystem
>>> ImpulsiveCircuitsSystem(T=3.0).prepare().system_.interactions[0].period
3.0
Source code in src/skcomplex/systems/engineering/circuits/_circuits.py
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
def __init__(
    self,
    x: float = 0.0,
    current: float = 0.0,
    *,
    L: float = 1.0,
    R: float = 0.1,
    C: float = 1.0,
    A: float = 1.0,
    T: float = 2.0,
    label: str = 'system',
    solver: BaseSolver | str = 'auto',
    backend: BaseBackend | str = 'auto',
) -> None:
    super().__init__(label, solver=solver, backend=backend)
    self.x = x
    self.current = current
    self.L = L
    self.R = R
    self.C = C
    self.A = A
    self.T = T

KirchhoffVoltageInteraction(label, *, target, state='q', V=0.0, omega=1.0)

Bases: Interaction

Kirchhoff's voltage law of a series RLC loop driven by a sinusoidal source.

The charge q of the loop follows L q'' + R q' + q / C = V cos(omega t), with the inductance L, the resistance R, and the capacitance C of the loop. The same equation rings down a loop without a source, V = 0, and holds for a mass on a damped spring, with the mass, the damping, and the compliance in place of L, R, and C.

Parameters:

Name Type Description Default
label str

The label of the interaction.

required
target Role

The path of the loop, which holds the charge and the values L, R, and C.

required
state str

The name of the charge of the loop.

'q'
V float

The amplitude of the source voltage.

0.0
omega Annotated[float, closed_open(0, oo)]

The angular frequency of the source.

1.0

Examples:

>>> from skcomplex.core.components.elements import Element
>>> from skcomplex.core.systems import System
>>> from skcomplex.systems.engineering.circuits import KirchhoffVoltageInteraction
>>> loop = Element('loop', values={'q': 1.0, 'L': 1.0, 'R': 0.1, 'C': 1.0})
>>> System(elements=[loop], interactions=[KirchhoffVoltageInteraction('kvl', target='loop')]).prepare().states_
('loop.q', "loop.q'")
Source code in src/skcomplex/systems/engineering/circuits/_circuits.py
64
65
66
67
68
69
70
71
72
73
74
75
76
77
def __init__(
    self,
    label: str,
    *,
    target: Role,
    state: str = 'q',
    V: float = 0.0,
    omega: Annotated[float, RealSet.closed_open(0, oo)] = 1.0,
) -> None:
    super().__init__(label)
    self.target = target
    self.state = state
    self.V = V
    self.omega = omega

MemristiveCircuitElement(label, *, x=0.0, y=0.0, z=0.0, w=0.0, epsilon=0.01, R=2.0, alpha=1.55, beta=0.15, e=-0.04, a=-0.34, b=0.05)

Bases: Element

Slow-fast circuit with a cubic flux-controlled memristor.

Its oscillations mix small and large amplitudes. The memristor has the charge q = a w + b w^3 of its flux w, so its memductance is a + 3 b w^2, and the circuit follows epsilon x' = -y - (a + 3 b w^2) x, y' = alpha (x - R y - z + e), z' = -β y, and w' = x.

Parameters:

Name Type Description Default
label str

The label of the circuit.

required
x float

The initial voltage of the memristor.

0.0
y float

The initial current of the inductor.

0.0
z float

The initial voltage of the second capacitor.

0.0
w float

The initial flux of the memristor.

0.0
epsilon Annotated[float, open(0, oo)]

The first capacitance, which sets the fast time scale.

0.01
R Annotated[float, closed_open(0, oo)]

The resistance.

2.0
alpha Annotated[float, open(0, oo)]

The inverse inductance.

1.55
beta Annotated[float, open(0, oo)]

The gain of the controlled source over the second capacitance.

0.15
e float

The voltage of the source.

-0.04
a float

The linear coefficient of the memristor characteristic.

-0.34
b float

The cubic coefficient of the memristor characteristic.

0.05

Examples:

>>> from skcomplex.systems.engineering.circuits import MemristiveCircuitElement
>>> MemristiveCircuitElement('circuit').a
-0.34
Source code in src/skcomplex/systems/engineering/circuits/_memristive_mixed_mode_oscillator.py
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
def __init__(
    self,
    label: str,
    *,
    x: float = 0.0,
    y: float = 0.0,
    z: float = 0.0,
    w: float = 0.0,
    epsilon: Annotated[float, RealSet.open(0, oo)] = 0.01,
    R: Annotated[float, RealSet.closed_open(0, oo)] = 2.0,
    alpha: Annotated[float, RealSet.open(0, oo)] = 1.55,
    beta: Annotated[float, RealSet.open(0, oo)] = 0.15,
    e: float = -0.04,
    a: float = -0.34,
    b: float = 0.05,
) -> None:
    super().__init__(label)
    self.x = x
    self.y = y
    self.z = z
    self.w = w
    self.epsilon = epsilon
    self.R = R
    self.alpha = alpha
    self.beta = beta
    self.e = e
    self.a = a
    self.b = b

MemristiveDynamicsInteraction(label, *, target)

Bases: Interaction

Dynamics of a memristive circuit, with the constants the circuit holds.

It sets epsilon x' = -y - (a + 3 b w^2) x, y' = alpha (x - R y - z + e), z' = -beta y, and w' = x.

Parameters:

Name Type Description Default
label str

The label of the interaction.

required
target Role

The path of the circuit.

required

Examples:

>>> from skcomplex.systems.engineering.circuits import MemristiveDynamicsInteraction
>>> MemristiveDynamicsInteraction('dynamics', target='circuit').target
'circuit'
Source code in src/skcomplex/systems/engineering/circuits/_memristive_mixed_mode_oscillator.py
126
127
128
def __init__(self, label: str, *, target: Role) -> None:
    super().__init__(label)
    self.target = target

MemristiveMixedModeOscillatorSystem(x=0.0, y=0.0, z=0.0, w=0.0, *, epsilon=0.01, R=2.0, alpha=1.55, beta=0.15, e=-0.04, a=-0.34, b=0.05, label='system', solver='auto', backend='auto')

Bases: BaseSystem

A slow-fast circuit with a cubic flux-controlled memristor.

Its oscillations mix two amplitudes. The memristor has the charge q = a w + b w^3 of its flux w, and with the voltage x of the memristor, the current y of the inductor, and the voltage z of the second capacitor, the circuit follows epsilon x' = -y - (a + 3 b w^2) x, y' = alpha (x - R y - z + e), z' = -β y, and w' = x. Trzaska prints the memductance as a + 3 b w, but only the derivative a + 3 b w^2 of the characteristic gives the response he reports: for the defaults, from rest, the voltage settles on the mixed-mode oscillation 2^11, two large spikes and eleven small oscillations in a period of about 7.9, against the 7.816 he reports. The spikes last about a hundredth of the period, so the tuned solver runs at the relative tolerance 1e-8, below which looser runs drift to an irregular pattern of shorter periods.

The system has the states circuit.x, circuit.y, circuit.z, and circuit.w.

Parameters:

Name Type Description Default
x float

The initial voltage of the memristor.

0.0
y float

The initial current of the inductor.

0.0
z float

The initial voltage of the second capacitor.

0.0
w float

The initial flux of the memristor.

0.0
epsilon float

The first capacitance, which sets the fast time scale.

0.01
R float

The resistance.

2.0
alpha float

The inverse inductance.

1.55
beta float

The gain of the controlled source over the second capacitance.

0.15
e float

The voltage of the source.

-0.04
a float

The linear coefficient of the memristor characteristic.

-0.34
b float

The cubic coefficient of the memristor characteristic.

0.05
label str

The label of the system, which names it when it is nested in another one.

'system'
solver BaseSolver | str

The solver of the problem, or 'auto' for the one the system chooses.

'auto'
backend BaseBackend | str

The backend that evaluates the compiled functions, or 'auto' for the one the system chooses.

'auto'

Examples:

>>> from skcomplex.systems.engineering.circuits import MemristiveMixedModeOscillatorSystem
>>> MemristiveMixedModeOscillatorSystem(a=-0.5).prepare().system_.elements[0].a
-0.5
Source code in src/skcomplex/systems/engineering/circuits/_memristive_mixed_mode_oscillator.py
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
def __init__(
    self,
    x: float = 0.0,
    y: float = 0.0,
    z: float = 0.0,
    w: float = 0.0,
    *,
    epsilon: float = 0.01,
    R: float = 2.0,
    alpha: float = 1.55,
    beta: float = 0.15,
    e: float = -0.04,
    a: float = -0.34,
    b: float = 0.05,
    label: str = 'system',
    solver: BaseSolver | str = 'auto',
    backend: BaseBackend | str = 'auto',
) -> None:
    super().__init__(label, solver=solver, backend=backend)
    self.x = x
    self.y = y
    self.z = z
    self.w = w
    self.epsilon = epsilon
    self.R = R
    self.alpha = alpha
    self.beta = beta
    self.e = e
    self.a = a
    self.b = b

MemristorOscillatorSystem(v=0.1, i=0.0, w=0.1, *, C=1.0, L=3.0, alpha=0.6, beta=1.5, label='system', solver='auto', backend='auto')

Bases: DynamicalSystem

The simplest memristor oscillator.

It is a capacitor, an inductor, and a memristor in series. The capacitor voltage, the inductor current, and the internal state of the memristor follow C v' = i, L i' = -v - β (w^2 - 1) i, and w' = -i - alpha w + w i. The memristor has the memristance β (w^2 - 1), and the circuit oscillates chaotically for the default values. The system has the states circuit.v, circuit.i, and circuit.w.

Parameters:

Name Type Description Default
v float

The initial voltage of the capacitor.

0.1
i float

The initial current.

0.0
w float

The initial internal state of the memristor.

0.1
C float

The capacitance.

1.0
L float

The inductance.

3.0
alpha float

The decay rate of the memristor state.

0.6
beta float

The scale of the memristance.

1.5
label str

The label of the system, which names it when it is nested in another one.

'system'
solver BaseSolver | str

The solver of the problem, or 'auto' for the one the system chooses.

'auto'
backend BaseBackend | str

The backend that evaluates the compiled functions, or 'auto' for the one the system chooses.

'auto'

Examples:

>>> from skcomplex.systems.engineering.circuits import MemristorOscillatorSystem
>>> MemristorOscillatorSystem(L=2.0).prepare().system_.elements[0].values['L']
2.0
Source code in src/skcomplex/systems/engineering/circuits/_circuits.py
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
def __init__(
    self,
    v: float = 0.1,
    i: float = 0.0,
    w: float = 0.1,
    *,
    C: float = 1.0,
    L: float = 3.0,
    alpha: float = 0.6,
    beta: float = 1.5,
    label: str = 'system',
    solver: BaseSolver | str = 'auto',
    backend: BaseBackend | str = 'auto',
) -> None:
    super().__init__(label=label, solver=solver, backend=backend)
    self.v = v
    self.i = i
    self.w = w
    self.C = C
    self.L = L
    self.alpha = alpha
    self.beta = beta

MixedModeChuaSystem(x=0.01, y=0.0, z=0.0, *, epsilon=0.01, a=1.5, b=-1.0, alpha=1.0, R=0.0, beta=0.005, c=0.00053, label='system', solver='auto', backend='auto')

Bases: BaseSystem

A modified Chua circuit on three time scales.

Its oscillations mix small and large amplitudes. The circuit follows ε x' = -y + (a + b x) x^2, y' = alpha (x - R y - z), and z' = c - β y. For ε = 0.01, a = 1.5, b = -1, and β = 0.005, the circuit has small oscillations only for c = 0, large ones only for c = 0.00105, and mixed-mode oscillations for c = 0.00053. The system has the states circuit.x, circuit.y, and circuit.z.

Parameters:

Name Type Description Default
x float

The initial voltage of the first capacitor.

0.01
y float

The initial current of the inductor.

0.0
z float

The initial voltage of the second capacitor.

0.0
epsilon float

The first capacitance, which sets the fast time scale.

0.01
a float

The quadratic coefficient of the diode.

1.5
b float

The cubic coefficient of the diode.

-1.0
alpha float

The inverse inductance.

1.0
R float

The resistance.

0.0
beta float

The gain of the controlled source over the second capacitance.

0.005
c float

The offset of the controlled source.

0.00053
label str

The label of the system, which names it when it is nested in another one.

'system'
solver BaseSolver | str

The solver of the problem, or 'auto' for the one the system chooses.

'auto'
backend BaseBackend | str

The backend that evaluates the compiled functions, or 'auto' for the one the system chooses.

'auto'

Examples:

>>> from skcomplex.systems.engineering.circuits import MixedModeChuaSystem
>>> MixedModeChuaSystem(c=0.0).prepare().system_.interactions[0].c
0.0
Source code in src/skcomplex/systems/engineering/circuits/_circuits.py
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
def __init__(
    self,
    x: float = 0.01,
    y: float = 0.0,
    z: float = 0.0,
    *,
    epsilon: float = 0.01,
    a: float = 1.5,
    b: float = -1.0,
    alpha: float = 1.0,
    R: float = 0.0,
    beta: float = 0.005,
    c: float = 0.00053,
    label: str = 'system',
    solver: BaseSolver | str = 'auto',
    backend: BaseBackend | str = 'auto',
) -> None:
    super().__init__(label, solver=solver, backend=backend)
    self.x = x
    self.y = y
    self.z = z
    self.epsilon = epsilon
    self.a = a
    self.b = b
    self.alpha = alpha
    self.R = R
    self.beta = beta
    self.c = c

RlcCircuitSystem(q=1.0, current=0.0, *, L=1.0, R=0.1, C=1.0, V=0.0, omega=1.0, label='system', solver='auto', backend='auto')

Bases: BaseSystem

A series RLC circuit written as Kirchhoff's voltage law.

The law is L q'' + R q' + q / C = V cos(ω t). The system has the charge circuit.q and the current circuit.q'.

Parameters:

Name Type Description Default
q float

The initial charge of the capacitor.

1.0
current float

The initial current.

0.0
L float

The inductance.

1.0
R float

The resistance.

0.1
C float

The capacitance.

1.0
V float

The amplitude of the source voltage.

0.0
omega float

The angular frequency of the source.

1.0
label str

The label of the system, which names it when it is nested in another one.

'system'
solver BaseSolver | str

The solver of the problem, or 'auto' for the one the system chooses.

'auto'
backend BaseBackend | str

The backend that evaluates the compiled functions, or 'auto' for the one the system chooses.

'auto'

Examples:

>>> from skcomplex.systems.engineering.circuits import RlcCircuitSystem
>>> RlcCircuitSystem(R=0.5).prepare().states_
('circuit.q', "circuit.q'")
Source code in src/skcomplex/systems/engineering/circuits/_circuits.py
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
def __init__(
    self,
    q: float = 1.0,
    current: float = 0.0,
    *,
    L: float = 1.0,
    R: float = 0.1,
    C: float = 1.0,
    V: float = 0.0,
    omega: float = 1.0,
    label: str = 'system',
    solver: BaseSolver | str = 'auto',
    backend: BaseBackend | str = 'auto',
) -> None:
    super().__init__(label, solver=solver, backend=backend)
    self.q = q
    self.current = current
    self.L = L
    self.R = R
    self.C = C
    self.V = V
    self.omega = omega

RoadInteraction(label, *, target, state='y1', mass='m1', k1=200000.0, A=0.01, omega=9.42)

Bases: Interaction

Tyre between the unsprung mass of a car and a road of the profile z(t) = A sin(omega t).

The tyre pushes the mass with the force -k1 (y1 - z(t)), which accelerates it divided by the mass.

Parameters:

Name Type Description Default
label str

The label of the interaction.

required
target Role

The path of the element that holds the unsprung mass.

required
state str

The name of the displacement of the unsprung mass.

'y1'
mass str

The name of the unsprung mass.

'm1'
k1 Annotated[float, closed_open(0, oo)]

The stiffness of the tyre.

200000.0
A Annotated[float, closed_open(0, oo)]

The amplitude of the road profile.

0.01
omega Annotated[float, closed_open(0, oo)]

The angular frequency of the road profile.

9.42

Examples:

>>> from skcomplex.systems.engineering.circuits import RoadInteraction
>>> RoadInteraction('road', target='harvester', A=0.02).A
0.02
Source code in src/skcomplex/systems/engineering/circuits/_harvesters.py
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
def __init__(
    self,
    label: str,
    *,
    target: Role,
    state: str = 'y1',
    mass: str = 'm1',
    k1: Annotated[float, RealSet.closed_open(0, oo)] = 200000.0,
    A: Annotated[float, RealSet.closed_open(0, oo)] = 0.01,
    omega: Annotated[float, RealSet.closed_open(0, oo)] = 9.42,
) -> None:
    super().__init__(label)
    self.target = target
    self.state = state
    self.mass = mass
    self.k1 = k1
    self.A = A
    self.omega = omega

TunnelDiodeOscillatorSystem(V=0.1, i=0.0, *, L=1.0, C=1.0, alpha=1.0, gamma=1.0, label='system', solver='auto', backend='auto')

Bases: DynamicalSystem

A tunnel-diode oscillator.

It is an inductor and a capacitor in parallel with a negative-resistance diode. The diode current is h(V) = gamma V^3 - alpha V, so Kirchhoff's laws give C V' = -h(V) - i and L i' = V, which is the van der Pol oscillator with ε = alpha sqrt(L / C). The voltage settles on a limit cycle of amplitude near 2 sqrt(alpha / (3 gamma)). The system has the voltage circuit.V and the inductor current circuit.i.

Parameters:

Name Type Description Default
V float

The initial voltage.

0.1
i float

The initial current of the inductor.

0.0
L float

The inductance.

1.0
C float

The capacitance.

1.0
alpha float

The negative conductance of the diode at zero voltage.

1.0
gamma float

The cubic coefficient of the diode.

1.0
label str

The label of the system, which names it when it is nested in another one.

'system'
solver BaseSolver | str

The solver of the problem, or 'auto' for the one the system chooses.

'auto'
backend BaseBackend | str

The backend that evaluates the compiled functions, or 'auto' for the one the system chooses.

'auto'

Examples:

>>> from skcomplex.systems.engineering.circuits import TunnelDiodeOscillatorSystem
>>> TunnelDiodeOscillatorSystem(alpha=2.0).prepare().system_.elements[0].values['alpha']
2.0
Source code in src/skcomplex/systems/engineering/circuits/_circuits.py
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
def __init__(
    self,
    V: float = 0.1,
    i: float = 0.0,
    *,
    L: float = 1.0,
    C: float = 1.0,
    alpha: float = 1.0,
    gamma: float = 1.0,
    label: str = 'system',
    solver: BaseSolver | str = 'auto',
    backend: BaseBackend | str = 'auto',
) -> None:
    super().__init__(label=label, solver=solver, backend=backend)
    self.V = V
    self.i = i
    self.L = L
    self.C = C
    self.alpha = alpha
    self.gamma = gamma

VibrationEnergyHarvesterSystem(*, m1=40.0, m2=400.0, k1=200000.0, k2=20000.0, b=1500.0, A=0.01, omega=9.42, n=10.0, d=4e-10, C=1e-08, label='system', solver='auto', backend='auto')

Bases: BaseSystem

A dual-mass piezoelectric harvester in a car suspension.

The roughness of the road drives it. The unsprung and sprung masses follow m1 y1'' + b (y1' - y2') + k2 (y1 - y2) + k1 (y1 - z(t)) = 0 and m2 y2'' + b (y2' - y1') + k2 (y2 - y1) = 0, with the road profile z(t) = A sin(ω t). A lever with arm ratio n presses a piezoelectric bar of constant d and capacitance C, whose charge is n d k2 (y2 - y1) and whose voltage is the observable voltage. The damper b stands for the energy the bar absorbs. The system has the displacements harvester.y1 and harvester.y2, and the observable voltage.

Parameters:

Name Type Description Default
m1 float

The unsprung mass.

40.0
m2 float

The sprung mass.

400.0
k1 float

The stiffness of the tyre.

200000.0
k2 float

The stiffness of the suspension spring.

20000.0
b float

The damping coefficient of the harvester.

1500.0
A float

The amplitude of the road profile.

0.01
omega float

The angular frequency of the road profile.

9.42
n float

The ratio of the arms of the lever.

10.0
d float

The piezoelectric constant of the bar.

4e-10
C float

The capacitance of the bar.

1e-08
label str

The label of the system, which names it when it is nested in another one.

'system'
solver BaseSolver | str

The solver of the problem, or 'auto' for the one the system chooses.

'auto'
backend BaseBackend | str

The backend that evaluates the compiled functions, or 'auto' for the one the system chooses.

'auto'

Examples:

>>> from skcomplex.systems.engineering.circuits import VibrationEnergyHarvesterSystem
>>> VibrationEnergyHarvesterSystem(b=1000.0).prepare().system_.interactions[1].b
1000.0
Source code in src/skcomplex/systems/engineering/circuits/_harvesters.py
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
def __init__(
    self,
    *,
    m1: float = 40.0,
    m2: float = 400.0,
    k1: float = 2.0e5,
    k2: float = 2.0e4,
    b: float = 1500.0,
    A: float = 0.01,
    omega: float = 9.42,
    n: float = 10.0,
    d: float = 4.0e-10,
    C: float = 1.0e-8,
    label: str = 'system',
    solver: BaseSolver | str = 'auto',
    backend: BaseBackend | str = 'auto',
) -> None:
    super().__init__(label, solver=solver, backend=backend)
    self.m1 = m1
    self.m2 = m2
    self.k1 = k1
    self.k2 = k2
    self.b = b
    self.A = A
    self.omega = omega
    self.n = n
    self.d = d
    self.C = C