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
  • Step 1: Identify the Nodes
  • Step 2: Apply Kirchhoff’s Current Law (KCL) at Node A
  • Python script
  • Keywords
  1. Electrical & electronics Eng
  2. Nodal Analysis

Example 2

Nerd Cafe

PreviousExample 1NextTransient State

Last updated 2 months ago

Let's determine the voltage at node A using nodal analysis step by step.

Step 1: Identify the Nodes

  • Node A: The voltage at this node is 𝑉𝐴, which we need to determine.

  • Ground Node: The bottom of 𝑅2 is connected to the ground (0V).

Step 2: Apply Kirchhoff’s Current Law (KCL) at Node A

Using KCL, the sum of all currents leaving node A must be zero:

VAβˆ’125kΞ©+VA2kΞ©βˆ’1mA=0\frac{V_{A}-12}{5k\Omega}+\frac{V_{A}}{2k\Omega}-1mA=05kΞ©VAβ€‹βˆ’12​+2kΞ©VAβ€‹β€‹βˆ’1mA=0

Rewriting the equation:

VAβˆ’125000+VA2000βˆ’0.001=0\frac{V_{A}-12}{5000}+\frac{V_{A}}{2000}-0.001=05000VAβ€‹βˆ’12​+2000VAβ€‹β€‹βˆ’0.001=0

By simplification, we have:

VAβ‰…4.86β€…β€ŠVV_{A}\cong 4.86 \; VVA​≅4.86V

Python script

Here’s a Python script that calculates 𝑉𝐴 ​based on user input for V 1​. The script uses SymPy for solving the nodal equation.

def calculate_va():
    # Get V1 from the user
    V1 = float(input("Enter the value of V1 (in Volts): "))

    # Given circuit values
    R1 = 5000  # 5kΞ©
    R2 = 2000  # 2kΞ©
    I1 = 0.001  # 1mA

    # Calculate Va
    Va = ((V1 / R1) + I1) / ((1 / R1) + (1 / R2))

    print(f"Va (Voltage at node A) = {Va:.2f} V")

# Run the function
calculate_va()

Output

Va (Voltage at node A) = 4.86 V

Keywords

nodal analysis, kirchhoff's current law, KCL, circuit analysis, node voltage method, electrical engineering, electronic circuits, DC circuits, AC circuits, linear circuits, circuit solving techniques, voltage nodes, current sources, resistive circuits, mesh analysis, supernode, circuit theory, circuit equations, Ohm's law, engineering education, nerd cafe