sda.rlc.fit_rlc#
A module for fitting an RLC circuit to a pulsed signal.
The RLC circuit is a linear, second-order differential equation, and it can be used to model the response of a circuit to a pulsed signal. The circuit can be critically damped, underdamped, or overdamped, and the response can be oscillatory or not; For the underline physics, see the Word document in BP25 folder.
The module provides a function to calculate the current across the RLC circuit in response to a pulsed signal, and another function to calculate the current across the RL circuit in response to a pulsed signal. The module also provides a function to calculate the pulsed signal itself.
The module also provides a main block to plot the current across the RLC circuit in response to a pulsed signal, and the current across the RL circuit in response to a pulsed signal.
Attributes#
Functions#
|
Return a pulsed signal, serving as an input signal to the RLC circuit. |
|
Compute current across the RLC circuit, in response to a pulsed signal. |
|
Compute current across the RL circuit, in response to a pulsed signal. |
|
Determine the initial guess for the RLC circuit. |
|
Fit the current across the RLC circuit to a pulsed signal. |
Module Contents#
- sda.rlc.fit_rlc.pulsed_signal(t, tau, V)#
Return a pulsed signal, serving as an input signal to the RLC circuit.
The pulse is defined here as step function that goes from 0 to V at t = 0, and stays at V for 0 < t <= tau. The pulse is 0 for t > tau.
- sda.rlc.fit_rlc.rlc_current(t, R, L, C, tau, V)#
Compute current across the RLC circuit, in response to a pulsed signal.
Schema of the RLC circuit:
----------C----------L------┐ ↑ │ │ │ e(t) R │ │ │ │ ----------------------------┘
- Parameters:
- Returns:
The current across the RLC circuit at time t.
- Return type:
- Raises:
ValueError – If the circuit is critically damped.
- sda.rlc.fit_rlc.rl_current(t, R, L, tau, V)#
Compute current across the RL circuit, in response to a pulsed signal.
Schema of the RL circuit:
----------L-----┐ ↑ │ │ │ e(t) R │ │ │ │ ----------------┘
- sda.rlc.fit_rlc.initial_guess(times, current, V, tau=None)#
Determine the initial guess for the RLC circuit.
The initial guesses are based on the following assumptions: - The inductance is the inverse of the slope of the current at t = 0. - The resistance is related to the times T the current reaches 0.05 of its maximum value. - The capacitance is linked to oscillations in current.
- Parameters:
- Returns:
The initial guesses for the resistance, inductance, capacitance, and pulse duration of the RLC circuit.
- Return type:
- sda.rlc.fit_rlc.fit_signal_with_current(times, current, V, tau=None)#
Fit the current across the RLC circuit to a pulsed signal.
- Parameters:
- Returns:
The resistance, inductance, and capacitance of the RLC circuit.
- Return type:
tuple[float,float,float]
- sda.rlc.fit_rlc.times#