Python Encyclopedia for Academics
  • Course Outline
  • Artificial Intelligence
    • Data Science Foundation
      • Python Programming
        • Introduction and Basics
          • Variables
          • Print Function
          • Input From User
          • Data Types
          • Type Conversion
        • Operators
          • Arithmetic Operators
          • Relational Operators
          • Bitwise Operators
          • Logical Operators
          • Assignment Operators
          • Compound Operators
          • Membership Operators
          • Identity Operators
      • Numpy
        • Vectors, Matrix
        • Operations on Matrix
        • Mean, Variance, and Standard Deviation
        • Reshaping Arrays
        • Transpose and Determinant of Matrix
      • Pandas
        • Series and DataFrames
        • Slicing, Rows, and Columns
        • Operations on DataFrames
        • Different wayes to creat DataFrame
        • Read, Write Operations with CSV files
      • Matplotlib
        • Graph Basics
        • Format Strings in Plots
        • Label Parameters, Legend
        • Bar Chart, Pie Chart, Histogram, and Scatter Plot
  • Machine Learning Algorithms
    • Regression Analysis In ML
      • Regression Analysis in Machine Learning
      • Proof of Linear Regression Formulas
      • Simple Linear Regression Implementation
      • Multiple Linear Regression
      • Advertising Dataset Example
      • Bike Sharing Dataset
      • Wine Quality Dataset
      • Auto MPG Dataset
    • Classification Algorithms in ML
      • Proof of Logistic Regression
      • Simplified Mathematical Proof of SVM
      • Iris Dataset
  • Machine Learning Laboratory
    • Lab 1: Titanic Dataset
      • Predicting Survival on the Titanic with Machine Learning
    • Lab 2: Dow Jones Index Dataset
      • Dow Jones Index Predictions Using Machine Learning
    • Lab 3: Diabetes Dataset
      • Numpy
      • Pandas
      • Matplotlib
      • Simple Linear Regression
      • Simple Non-linear Regression
      • Performance Matrix
      • Preprocessing
      • Naive Bayes Classification
      • K-Nearest Neighbors (KNN) Classification
      • Decision Tree & Random Forest
      • SVM Classifier
      • Logistic Regression
      • Artificial Neural Network
      • K means Clustering
    • Lab 4: MAGIC Gamma Telescope Dataset
      • Classification in ML-MAGIC Gamma Telescope Dataset
    • Lab 5: Seoul Bike Sharing Demand Dataset
      • Regression in ML-Seoul Bike Sharing Demand Dataset
    • Lab 6: Medical Cost Personal Datasets
      • Predict Insurance Costs with Linear Regression in Python
    • Lab 6: Predict The S&P 500 Index With Machine Learning And Python
      • Predict The S&P 500 Index With Machine Learning And Python
  • Artificial Neural Networks
    • Biological Inspiration vs. Artificial Neurons
    • Review linear algebra and calculus essentials for ANNs
    • Activation Function
  • Mathematics
    • Pre-Calculus
      • Factorials
      • Roots of Polynomials
      • Complex Numbers
      • Polar Coordinates
      • Graph of a Function
    • Calculus 1
      • Limit of a Function
      • Derivative of Function
      • Critical Points
      • Indefinite Integrals
  • Calculus 2
    • 3D Coordinates and Vectors
    • Vectors and Vector Operations
    • Lines and Planes in Space (3D)
    • Partial Derivatives
    • Optimization Problems (Maxima/Minima) in Multivariable Functions
    • Gradient Vectors
  • Engineering Mathematics
    • Laplace Transform
  • Electrical & electronics Eng
    • Resistor
      • Series Resistors
      • Parallel Resistors
    • Nodal Analysis
      • Example 1
      • Example 2
    • Transient State
      • RC Circuit Equations in the s-Domain
      • RL Circuit Equations in the s-Domain
      • LC Circuit Equations in the s-Domain
      • Series RLC Circuit with DC Source
  • Computer Networking
    • Fundamental
      • IPv4 Addressing
      • Network Diagnostics
  • Cybersecurity
    • Classical Ciphers
      • Caesar Cipher
      • Affine Cipher
      • Atbash Cipher
      • Vigenère Cipher
      • Gronsfeld Cipher
      • Alberti Cipher
      • Hill Cipher
Powered by GitBook
On this page
  • What is an LC Circuit?
  • Step 1: Time-Domain Equations of LC Circuit
  • Step 2: Convert to s-domain using Laplace Transform
  • Step 3: Python Implementation
  • Step 4: Example with Real Values
  • Keywords
  1. Electrical & electronics Eng
  2. Transient State

LC Circuit Equations in the s-Domain

Nerd Cafe

What is an LC Circuit?

An LC circuit (also known as a resonant or tank circuit) is a simple electrical circuit consisting of:

  • an Inductor L (H)

  • a Capacitor C (F)

It's used in:

  • Oscillators

  • Filters

  • Tuned circuits (like radios)

Step 1: Time-Domain Equations of LC Circuit

Let’s start from the KVL (Kirchhoff's Voltage Law) for the series LC circuit:

vL(t)+vC(t)=0v_{L}(t)+v_{C}(t)=0vL​(t)+vC​(t)=0

Where:

VL(t)=Ldi(t)dtV_{L}(t)=L\frac{d i(t)}{dt}VL​(t)=Ldtdi(t)​

and

VC(t)=1C∫i(t)dtV_{C}(t)=\frac{1}{C}\int_{}^{}i(t)dtVC​(t)=C1​∫​i(t)dt

Differentiate both sides:

Ld2idt2+1Ci(t)=0L\frac{d^{2} i}{dt^{2}}+\frac{1}{C}i(t)=0Ldt2d2i​+C1​i(t)=0

Step 2: Convert to s-domain using Laplace Transform

Apply the Laplace Transform assuming zero initial conditions:

L{Ld2idt2+1Ci(t)}=Ls2I(s)+1CI(s)=I(s)(Ls2+1C)=0L\left\{ L\frac{d^{2} i}{dt^{2}}+\frac{1}{C}i(t) \right\}=Ls^{2}I(s)+\frac{1}{C}I(s)=I(s)\left( Ls^{2}+\frac{1}{C} \right)=0L{Ldt2d2i​+C1​i(t)}=Ls2I(s)+C1​I(s)=I(s)(Ls2+C1​)=0

Final Equation in the s-domain:

Ls2+1C=0⇒s2=−1LC⇒s=±jω0    where    ω0=1LCLs^{2}+\frac{1}{C}=0\Rightarrow s^{2}=-\frac{1}{LC}\Rightarrow s=\pm j\omega_{0}\;\;where\;\;\omega_{0}=\frac{1}{\sqrt{LC}}Ls2+C1​=0⇒s2=−LC1​⇒s=±jω0​whereω0​=LC​1​

Step 3: Python Implementation

Let’s use sympy to model this in Python.

Installation:

pip install sympy matplotlib

Python Code:

import sympy as sp

# Define symbols
s, L, C = sp.symbols('s L C', real=True, positive=True)

# Define the equation in s-domain
Z_total = L*s**2 + 1/C

# Solve for s
s_solutions = sp.solve(Z_total, s)
print("Roots of the LC circuit equation (s-domain):")
print(s_solutions)

# Resonant frequency
omega_0 = sp.sqrt(1/(L*C))
print("\nResonant Frequency ω₀ =")
sp.pprint(omega_0)

Output:

Roots of the LC circuit equation (s-domain):
[]

Resonant Frequency ω₀ =
  1  
─────
√C⋅√L

Step 4: Example with Real Values

Let's say:

  • L=10 mH=10×10−3

  • C=100 nF=100×10−9C

Python Code:

# Numerical evaluation
L_val = 10e-3  # 10 mH
C_val = 100e-9  # 100 nF

omega_0_num = omega_0.subs({L: L_val, C: C_val})
f_0 = omega_0_num / (2 * sp.pi)
print(f"\nResonant frequency (Hz): {f_0.evalf():.2f}")

Output

Resonant frequency (Hz): 5032.92

Keywords

LC circuit, s-domain, Laplace transform, inductor, capacitor, resonant frequency, transfer function, electrical engineering, differential equations, impedance, resonance, oscillation, symbolic math, Python, SymPy, frequency response, current waveform, undamped oscillation, time-domain analysis, circuit analysis, nerd cafe

PreviousRL Circuit Equations in the s-DomainNextSeries RLC Circuit with DC Source

Last updated 1 month ago