Refine Wheatstone Bridge explanation (#14031)

* Refine Wheatstone Bridge explanation

Updated docstring to provide a clearer explanation of the Wheatstone Bridge, its balance condition, and applications.

* Update wheatstone_bridge.py

* Correct docstring formatting in wheatstone_bridge.py

Fix formatting in docstring for clarity.

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Fix docstring capitalization and simplify return statement

Corrected capitalization of 'Wheatstone' in the docstring and improved code structure by removing unnecessary else statement.

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
This commit is contained in:
Kashvi Bhatia
2026-09-16 22:50:30 +02:00
committed by GitHub
co-authored by pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Christian Clauss
parent 681929de5d
commit 5fccff81bf
+15 -6
View File
@@ -6,13 +6,22 @@ def wheatstone_solver(
resistance_1: float, resistance_2: float, resistance_3: float
) -> float:
"""
This function can calculate the unknown resistance in an wheatstone network,
given that the three other resistances in the network are known.
The formula to calculate the same is:
Wheatstone Bridge is an electrical circuit used to accurately measure
an unknown resistance by balancing two legs of a bridge circuit.
---------------
|Rx=(R2/R1)*R3|
---------------
The bridge is said to be balanced when no current flows
through the galvanometer connected between the midpoints
of the two voltage dividers.
Balance condition:
R1 / R2 = R3 / R4
Applications:
- Measurement of unknown resistance
- Strain gauge circuits
- Sensor calibration
This function can calculate the unknown resistance in a Wheatstone
network, given that the three other resistances
in the network are known.
Usage examples:
>>> wheatstone_solver(resistance_1=2, resistance_2=4, resistance_3=5)