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
  • 1. What is the s-domain?
  • 2. RC Circuit Basics in Time Domain
  • 3. Laplace Transform of RC Circuit
  • 4. Solving RC Circuit in s-domain
  • 5. Python Implementation (Symbolic & Numeric)
  • 6. Example : Step Response of RC Circuit
  • Keywords
  1. Electrical & electronics Eng
  2. Transient State

RC Circuit Equations in the s-Domain

Nerd Cafe

1. What is the s-domain?

The s-domain is the domain after applying the Laplace Transform. It’s widely used in circuit analysis because it converts differential equations to algebraic equations, which are easier to handle.

The Laplace variable s is defined as:

s=σ+jωs=\sigma+j\omegas=σ+jω

2. RC Circuit Basics in Time Domain

Components:

  • R = Resistance (Ohms)

  • C = Capacitance (Farads)

Time-domain differential equation:

For a series RC circuit with input Vin and output across the capacitor Vout:

Vin(t)=VR(t)+VC(t)VR(t)=R.i(t)    and    VC(t)=1C∫i(t)dtV_{in}(t)=V_{R}(t)+V_{C}(t) \\ \\ V_{R}(t)=R.i(t)\;\;and\;\;V_{C}(t)=\frac{1}{C}\int_{}^{}i(t)dt Vin​(t)=VR​(t)+VC​(t)VR​(t)=R.i(t)andVC​(t)=C1​∫​i(t)dt

Using:

i(t)=CdVC(t)dti(t)=C\frac{dV_{C}(t)}{dt}i(t)=CdtdVC​(t)​

We get:

Vin=RCdVC(t)dt+VC(t)V_{in}=RC\frac{dV_{C}(t) }{dt}+V_{C}(t)Vin​=RCdtdVC​(t)​+VC​(t)

3. Laplace Transform of RC Circuit

Apply Laplace Transform:

L{Vin}=L{RCdVC(t)dt+VC(t)}=RC×L{dVC(t)dt}+L{VC(t)}L\left\{ V_{in} \right\}=L\left\{ RC\frac{dV_{C}(t) }{dt}+V_{C}(t) \right\}=RC\times L\left\{ \frac{d V_{C}(t)}{dt} \right\}+L\left\{ V_{C}(t) \right\} L{Vin​}=L{RCdtdVC​(t)​+VC​(t)}=RC×L{dtdVC​(t)​}+L{VC​(t)}

So:

Vin(s)=RC(sVC(s)−VC(0))+VC(s)V_{in}(s)=RC\left( sV_{C}(s)-V_{C}(0) \right)+V_{C}(s)Vin​(s)=RC(sVC​(s)−VC​(0))+VC​(s)

If initial capacitor voltage 𝑉𝐶(0) = 0 :

Vin(s)=(RCs+1)VC(s)V_{in}(s)=(RCs+1)V_{C}(s)Vin​(s)=(RCs+1)VC​(s)

Transfer Function:

H(s)=Vout(s)Vin(s)=1RCs+1H(s)=\frac{V_{out}(s)}{V_{in}(s)}=\frac{1}{RCs+1}H(s)=Vin​(s)Vout​(s)​=RCs+11​

4. Solving RC Circuit in s-domain

Given any input Vin(s), the output is:

Vout(s)=H(s)Vin(s)V_{out}(s)=H(s)V_{in}(s)Vout​(s)=H(s)Vin​(s)

Use inverse Laplace to get 𝑉𝑜𝑢𝑡( 𝑡 ).

5. Python Implementation (Symbolic & Numeric)

We’ll use SymPy for symbolic analysis and SciPy/Matplotlib for numerical/graphical output.

import sympy as sp

# Define symbols
s, R, C = sp.symbols('s R C', positive=True)
Vin = sp.Function('Vin')(s)
Vout = sp.Function('Vout')(s)

# Transfer function H(s)
H = 1 / (1 + R * C * s)

# Output in s-domain
Vout = H * Vin
Vout

Output

Vin(s)RCs+1\frac{V_{in}(s)}{RCs+1}RCs+1Vin​(s)​

6. Example : Step Response of RC Circuit

Input:

Vin(t)=u(t)⇒u(t)=1sV_{in}(t)=u(t)\Rightarrow u(t)=\frac{1}{s}Vin​(t)=u(t)⇒u(t)=s1​

Output:

Vout(s)=1RCs+1×1s=1s(RCs+1)V_{out}(s)=\frac{1}{RCs+1}\times \frac{1}{s}=\frac{1}{s(RCs+1)}Vout​(s)=RCs+11​×s1​=s(RCs+1)1​

Inverse Laplace:

Use partial fractions:

1s(RCs+1)=1s−1s+1RC⇒Vout(t)=1−e−tRC    for    t≥0\frac{1}{s(RCs+1)}=\frac{1}{s}-\frac{1}{s+\frac{1}{RC}}\Rightarrow V_{out}(t)=1-e^{-\frac{t}{RC}} \;\;for \; \;t\ge 0s(RCs+1)1​=s1​−s+RC1​1​⇒Vout​(t)=1−e−RCt​fort≥0

Python Code for Step Response (Numeric)

import numpy as np
import matplotlib.pyplot as plt

# RC values
R = 1e3  # 1k Ohm
C = 1e-6 # 1uF
RC = R * C

# Time vector
t = np.linspace(0, 0.01, 1000)  # 0 to 10ms

# Step response
v_out = 1 - np.exp(-t / RC)

# Plot
plt.plot(t * 1000, v_out, label="Vout(t)")
plt.xlabel('Time (ms)')
plt.ylabel('Voltage (V)')
plt.title('Step Response of RC Circuit')
plt.grid(True)
plt.legend()
plt.show()

Output

Keywords

RC circuit, s-domain, Laplace transform, transfer function, step response, sinusoidal input, time domain, frequency domain, capacitor voltage, resistor current, symbolic math, SymPy, SciPy, Python simulation, inverse Laplace, first-order circuit, circuit analysis, transient response, electrical engineering, control systems, nerd cafe

PreviousTransient StateNextRL Circuit Equations in the s-Domain

Last updated 1 month ago