Home / Circuits with Matlab / Node Voltages Calculation in Resistive Circuit using Matlab

Node Voltages Calculation in Resistive Circuit using Matlab

Want create site? Find Free WordPress Themes and plugins.

Determine the voltage at each node of the circuit:

FROM ABOVE CIRCUIT, we can write the following set of equations:

$\begin{matrix}   \begin{align}  & {{I}_{{{R}_{4}}}}={{I}_{{{R}_{1}}}}+{{I}_{{{R}_{3}}}} \\ & {{I}_{{{R}_{2}}}}={{I}_{{{R}_{3}}}} \\ & {{V}_{1}}={{V}_{A}} \\\end{align} & \cdots  & (1)  \\\end{matrix}$


\[\begin{matrix}   \begin{align}  & \frac{{{V}_{C}}}{{{R}_{4}}}=\frac{{{V}_{1}}-{{V}_{C}}}{{{R}_{1}}}+\frac{{{V}_{B}}-{{V}_{C}}}{{{R}_{3}}} \\ & \frac{{{V}_{1}}-{{V}_{B}}}{{{R}_{2}}}=\frac{{{V}_{B}}-{{V}_{C}}}{{{R}_{3}}} \\\end{align} & \cdots  & (2)  \\\end{matrix}\]

We can rewrite it as:

\[\begin{matrix}   \begin{align}  & \frac{{{V}_{1}}}{{{R}_{1}}}=\left( \frac{1}{{{R}_{1}}}+\frac{1}{{{R}_{3}}}+\frac{1}{{{R}_{4}}} \right){{V}_{C}}-\frac{{{V}_{B}}}{{{R}_{3}}} \\ & \frac{{{V}_{1}}}{{{R}_{2}}}=-\frac{{{V}_{C}}}{{{R}_{3}}}+\left( \frac{1}{{{R}_{3}}}+\frac{1}{{{R}_{2}}} \right){{V}_{B}} \\\end{align} & \cdots  & (3)  \\\end{matrix}\]

The above equations can be written in terms of matrix:



$[A]=\left[ \begin{matrix}   \frac{{{V}_{1}}}{{{R}_{1}}}  \\   \frac{{{V}_{1}}}{{{R}_{2}}}  \\\end{matrix} \right]$

$[B]=\left[ \begin{matrix}   \frac{1}{{{R}_{1}}}+\frac{1}{{{R}_{3}}}+\frac{1}{{{R}_{4}}} & -\frac{1}{{{R}_{3}}}  \\   -\frac{1}{{{R}_{3}}} & \frac{1}{{{R}_{3}}}+\frac{1}{{{R}_{2}}}  \\\end{matrix} \right]$

$[C]=\left[ \begin{matrix}   {{V}_{C}}  \\   {{V}_{B}}  \\\end{matrix} \right]$

By using following equation, we can obtain unknown variables:


Let’s calculate unknown elements using Matlab:

Matlab Code for Node Voltages Calculation

%Simple Resistive Network
clear all;close all;clc
%%Circuit Elements 
V1= 2; % Source Voltage
R1= 330;
R2= 70; % Resistances in Ohm from Circuit 
R3= 160;
R4= 270;
B=[1/R1+1/R3+1/R4 -1/R3 ; ...
-1/R3 1/R3+1/R2]; % Elements of V1, VB, and VC in equation (3)
A=[V1/R1; V1/R2]; % Inputs Vector
C=inv(B)*A; % Output Matrix
% Node Voltages


V_C =


V_B =


Did you find apk for android? You can find new Free Android Games and apps.

About Ahmad Faizan

Mr. Ahmed Faizan Sheikh, M.Sc. (USA), Research Fellow (USA), a member of IEEE & CIGRE, is a Fulbright Alumnus and earned his Master’s Degree in Electrical and Power Engineering from Kansas State University, USA.

Leave a Reply