Home / Circuits with Matlab / How to Find Equivalent Resistance in a Complex Circuit | Matlab

# How to Find Equivalent Resistance in a Complex Circuit | Matlab

Want create site? Find Free WordPress Themes and plugins.

Normally, complex circuits are not organized in a nice and clean way for us to follow. They’re oftentimes represented in a way that makes it impossible to recognize which components are connected in parallel and which are in series. The core intent of this tutorial is to show that how to compute equivalent resistance of a complex circuit using Matlab.

Determine the equivalent resistance of the circuit between points A and B:

From above circuit, we can set up the following equations:

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

We can further expand the above mentioned set of equations as:

\begin{matrix} \begin{align} & {{I}_{t}}=\frac{{{V}_{t}}-{{V}_{Y}}}{{{R}_{1}}}+\frac{{{V}_{t}}-{{V}_{Z}}}{{{R}_{4}}} \\ & {{I}_{t}}=\frac{{{V}_{Y}}}{{{R}_{5}}}+\frac{{{V}_{Z}}}{{{R}_{3}}} \\ & \frac{{{V}_{t}}-{{V}_{Y}}}{{{R}_{1}}}=\frac{{{V}_{Y}}}{{{R}_{5}}}+\frac{{{V}_{Y}}-{{V}_{Z}}}{{{R}_{2}}} \\\end{align} & \cdots & (2) \\\end{matrix}

Further, we can rewrite equation (2) in matrix form as:

$[A]=[B]*[C]$

While

$[A]=\left[ \begin{matrix} {{I}_{t}} \\ {{I}_{t}} \\ 0 \\\end{matrix} \right]$

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

$[C]=\left[ \begin{matrix} {{V}_{t}} \\ {{V}_{Y}} \\ {{V}_{Z}} \\\end{matrix} \right]$

For computing unknown variables, we have:

$[C]={{[B]}^{-1}}[A]$

Whereas the equivalent resistance can be calculated from the following expression:

${{R}_{eq}}=\frac{{{V}_{t}}}{{{I}_{t}}}$

Let’s write up some code in Matlab to compute unknowns:

%Equivalent Resistance Calculation
clear all;close all;clc
%%Resistance Values from the Circuit
It= 1; % Source Current (1A)
R1= 100;R2= 40;R3= 170;R4= 70;R5= 50;
%%Matrix A and B obtained from equation (2)

A=[It; It; 0] ; % Input Matrix

B=[1/R1+1/R4 -1/R1 -1/R4; ...
0 1/R5 1/R3 ; ... % Elements of Vt, VX, VY and VZ from equation (2)
-1/R1 1/R1+1/R2+1/R5 -1/R2 ];

C=inv(B)*A ; % Calculating Unknown Variables

Req=C(1) % Equivalent Resistance which can be computed as Req=Vt/It
%==============================================

Results:

Req =

83.4906