Note
Go to the end to download the full example code or to run this example in your browser via JupyterLite.
RLC current after a voltage step#
Compute an inspectable engineering model using SI inputs. See the linked domain guide for assumptions and benchmark checks.

import matplotlib.pyplot as plt
import numpy as np
from engineeringkit.electrical_engineering import SeriesRLC
t = np.linspace(0, 8, 801)
fig, ax = plt.subplots()
for resistance in [1, 2, 4]:
result = SeriesRLC(resistance, 1, 0.25).step_response(t)
ax.plot(result.t, result.response, label=f"R={resistance} ohm")
ax.set(xlabel="time [s]", ylabel="current [A] for a 1 V step")
ax.legend()
plt.show()
Total running time of the script: (0 minutes 0.085 seconds)