rizer.electrical_model.circuit.cllrp_circuit#

Solve the following CLLRp circuit.

     ┌-------------L1--------------┐
 ↑   │                             │    ↑
 │   │                             L2   │
u_c  C                             │   u_mes
 │   │                            R_p   │
 │   │                             │    │
     ┖-----------------------------┘

The circuit is composed of a capacitor C, two inductors L1 and L2 in series, and the plasma resistance R_p. The plasma resistance can vary in time.

Models require the initial value of the plasma resistance R_0, the initial current I_0 in the circuit, and the initial voltage U_c_0 across the capacitor.

The resistance model can be one of the following (see rizer.electrical_model.components.plasma_load for more details):

Some comments refer to “the documentation”. The documentation is available in the repository in the file “resistance_models.pdf”.

Classes#

CLLRp_Circuit

Solve the following CLLRp circuit.

Module Contents#

class rizer.electrical_model.circuit.cllrp_circuit.CLLRp_Circuit(C: float | int, L1: float | int, L2: float | int, R_0: float | int, I_0: float | int, U_c_0: float | int, R_model: float | Callable[[float], float] | rizer.electrical_model.circuit.base_circuit.ResistanceDerivativeModel | None = None)#

Bases: rizer.electrical_model.circuit.base_circuit.BaseCircuit

Solve the following CLLRp circuit.

    ┌-------------L1--------------┐
 ↑  │                             │    ↑
 │  │                             L2   │
u_c C                             │   u_mes
 │  │                            R_p   │
 │  │                             │    │
    ┖-----------------------------┘

The circuit is composed of a capacitor C, two inductors L1 and L2 in series, and the plasma resistance R_p. The plasma resistance can vary in time.

Models require the initial value of the plasma resistance R_0, the initial current I_0 in the circuit, and the initial voltage U_c_0 across the capacitor.

This class provides the following methods:

Parameters:
  • C (float or int) – Capacitance value in Farads.

  • L1 (float or int) – Inductance value in Henry.

  • L2 (float or int) – Inductance value in Henry.

  • R_0 (float or int) – Initial value of the plasma resistance in Ohms.

  • I_0 (float or int) – Initial current through the plasma in the circuit in Amperes.

  • U_c_0 (float or int) – Initial voltage across the capacitor in Volts.

  • R_model (float, typing.Callable, ResistanceDerivativeModel, or None, optional) – The plasma resistance used by the self-contained solve(): a constant number, a prescribed callable R_p(t) (e.g. TabulatedLoad), or an object with compute_resistance_derivative(t, y) (e.g. a VariableResistorModel, which then integrates its own resistance derivative). Not needed when the circuit is driven externally (R_p supplied by the caller). Default None.

time: numpy.ndarray | None = None#

Time at which the circuit is solved.

i: numpy.ndarray | None = None#

Current in the circuit.

u_c: numpy.ndarray | None = None#

Voltage across the capacitor.

R_p: numpy.ndarray | None = None#

Resistance of the plasma.

initial_state() → numpy.ndarray#

Return the initial circuit state [I_0, U_c_0], for externally-driven mode.

current(y: numpy.ndarray) → float#

Return the current through the plasma, y[0].

compute_derivatives_driven(t: float, y: numpy.ndarray, R_p: float) → numpy.ndarray#

Time-derivative of the circuit state [i, u_c], with R_p supplied externally.

Parameters:
  • t (float) – Time at which the circuit is solved.

  • y (numpy.ndarray of float, float) –

    Array containing the present values of the system:

    • y[0]=i_p (float): The current through the plasma.

    • y[1]=u_c (float): The voltage across the capacitor.

  • R_p (float) – Plasma resistance at time t [Ohm].

Returns:

Array containing the derivatives of the system:

  • dy[0]=di_p (float): The derivative of the current through the plasma.

  • dy[1]=du_c (float): The derivative of the voltage across the capacitor.

Return type:

numpy.ndarray of float, float

solve(time: numpy.ndarray, method: str = 'LSODA', **kwargs) → tuple[numpy.ndarray, numpy.ndarray, numpy.ndarray, numpy.ndarray]#

Solve the RLLC circuit numerically (self-contained mode: R_model drives R_p).

Internally, the method uses the scipy.integrate.solve_ivp function to solve the ODE system.

Parameters:
  • time (numpy.ndarray) – Time at which the circuit is solved.

  • method (str) – The numerical method used to solve the ODE. Default is “LSODA”.

  • **kwargs – Additional arguments to pass to the ODE solver. See the documentation of scipy.integrate.solve_ivp.

Returns:

Tuple containing the following arrays:

  • i (numpy.ndarray): Current in the circuit.

  • didt (numpy.ndarray): Derivative of the current.

  • u_mes (numpy.ndarray): Voltage across R_p and L_p.

  • R_p (numpy.ndarray): Resistance of the plasma.

Return type:

tuple of numpy.ndarray

Raises:

ValueError – If the numerical solution did not converge, or if the circuit was constructed without an R_model.

compute_derivatives(t: float, y: numpy.ndarray) → numpy.ndarray#

Right-hand side of the system: \(\frac{dy}{dt} = f(t, y)\).

This method computes the derivatives of the system of ODEs that describe the CLLRp circuit, when R_model is an ODE-based resistance model. It is used by the CLLRp_Circuit.solve() method to solve the ODE system.

Parameters:
  • t (float) – Time at which the circuit is solved.

  • y (numpy.ndarray of float, float, float) –

    Array containing the present values of the system:

    • y[0]=i_p (float): The current through the plasma.

    • y[1]=u_c (float): The voltage across the capacitor.

    • y[2]=R_p (float): The plasma resistance.

Returns:

Array containing the derivatives of the system:

  • dy[0]=di_p (float): The derivative of the current through the plasma.

  • dy[1]=du_c (float): The derivative of the voltage across the capacitor.

  • dy[2]=dR_p (float): The derivative of the plasma resistance.

Return type:

numpy.ndarray of float, float, float

Notes

The system of ODEs is given by:

\[\begin{split}\begin{cases} \frac{di_p}{dt} &= \frac{u_c - R_p i_p}{L_1 + L_2} \\ \frac{du_c}{dt} &= -\frac{1}{C} i_p \\ \frac{dR_p}{dt} &= \text{compute_resistance_derivative}(t, [i_p, R_p]) \end{cases}\end{split}\]
compute_resistance_power() → numpy.ndarray#

Compute the power dissipated in the resistor.

Returns:

The power dissipated in the resistor.

Return type:

numpy.ndarray

Raises:

ValueError – If the circuit has not been solved yet.

Notes

The power dissipated in the resistor is given by:

\[P_R(t) = R_p(t) i(t)^2\]
compute_inductance_power() → numpy.ndarray#

Compute the power dissipated in the inductors.

Returns:

The power dissipated in the inductors.

Return type:

numpy.ndarray

Raises:

ValueError – If the circuit has not been solved yet.

Notes

The power dissipated in the inductors is given by:

\[P_L(t) = \frac{1}{2} (L_1 + L_2) \frac{di^2}{dt}(t)\]
compute_capacitance_power() → numpy.ndarray#

Compute the power dissipated in the capacitor.

Returns:

The power dissipated in the capacitor.

Return type:

numpy.ndarray

Raises:

ValueError – If the circuit has not been solved yet.

Notes

The power dissipated in the capacitor is given by:

\[P_C(t) = \frac{1}{2} C \frac{du_c^2}{dt}(t)\]
compute_resistance_energy() → numpy.ndarray#

Compute the cumulated energy dissipated in the resistor.

Returns:

The energy dissipated in the resistor.

Return type:

numpy.ndarray

Raises:

ValueError – If the circuit has not been solved yet.

Notes

The energy dissipated in the resistor is given by:

\[E_R(t) = \int_0^t P_R(\tau) d\tau = \int_0^t R_p(\tau) i(\tau)^2 d\tau\]
compute_inductance_energy() → numpy.ndarray#

Compute the energy dissipated in the inductors.

Returns:

The energy dissipated in the inductors.

Return type:

numpy.ndarray

Raises:

ValueError – If the circuit has not been solved yet.

Notes

The energy dissipated in the inductors is given by:

\[E_L(t) = \int_0^t P_L(\tau) d\tau = \frac{1}{2} (L_1 + L_2) (i(t)^2 - i(0)^2)\]
compute_capacitance_energy() → numpy.ndarray#

Compute the energy dissipated in the capacitor.

Returns:

The energy dissipated in the capacitor.

Return type:

numpy.ndarray

Raises:

ValueError – If the circuit has not been solved yet.

Notes

The energy dissipated in the capacitor is given by:

\[E_C(t) = \int_0^t P_C(\tau) d\tau = \frac{1}{2} C (u_c(t)^2 - u_c(0)^2)\]