File Exchange

image thumbnail

Resistance Calculator

version 2.0 (6.36 KB) by Ligong Han
An equivalent resistance calculator for an arbitrary resistor network

5 Downloads

Updated 10 Jun 2015

View License

The calculation is based on KVL and KCL equations. Set currents on each branch to unknowns. Denote the number of nodes as N, and the number of edges as M. (M-(N-1)) independent loops can be obtained by a breadth-first search, from which (M-(N-1)) KVL equations can be wrote. Together with (N-1) KCL equations, the equivalent resistance can be computed by solving linear equations.

Cite As

Ligong Han (2020). Resistance Calculator (https://www.mathworks.com/matlabcentral/fileexchange/42521-resistance-calculator), MATLAB Central File Exchange. Retrieved .

Comments and Ratings (1)

Does this code work?
Im having trouble getting it to calculate

Updates

2.0

two improvements regarding time efficiency:
- uses a different approach to find independent loops;
- uses the built-in function graphtraverse to perform BFS.

1.4.0.0

- fixes bugs when parallel resistance exists in the initial net-matrix, such as resistance_calculator([1 2 1;1 2 1],[1 2])

1.3.0.0

- Simplify the network before building equations by Y-Delta transform.

1.3.0.0

- updates vTree
- fixes errors of building KVL equations

1.3.0.0

- vTree class updated: fixed an error of the 'delChild' method

1.2.0.0

- Updated vTree

1.1.0.0

rewrote and optimised the whole structure, added two classes

MATLAB Release Compatibility
Created with R2012a
Compatible with any release
Platform Compatibility
Windows macOS Linux
Tags Add Tags
Acknowledgements

Inspired: Round to Electronic Component Values