-
-
Notifications
You must be signed in to change notification settings - Fork 46.6k
Added Coulomb_Law #8714
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added Coulomb_Law #8714
Changes from 4 commits
770e2f4
8466f25
07f24ca
112b1f9
fdd4eff
43bd954
2387620
d7d6517
64fceb5
c78a384
ce65ffb
1a32040
ed46580
a8bd7cc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,63 @@ | ||||||||||
""" | ||||||||||
Description : The law states that the magnitude of the electrostatic force of attraction or repulsion between two point charges is directly proportional | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. use |
||||||||||
to the product of the magnitudes of charges and inversely proportional to the square of the distance between them. | ||||||||||
Coulomb studied the repulsive force between bodies having electrical charges of the same sign. | ||||||||||
|
||||||||||
The unit of Electrostatic force is Newton. | ||||||||||
|
||||||||||
Coulomb’s Law gives an idea about the force between two point charges. | ||||||||||
By the word point charge, we mean that in physics, the size of linear charged bodies is very small as against the distance between them. | ||||||||||
Therefore, we consider them as point charges as it becomes easy for us to calculate the force of attraction/ repulsion between them. | ||||||||||
|
||||||||||
Charles-Augustin de Coulomb, a French physicist in 1784, measured the force between two point charges and he came up with | ||||||||||
the theory that the force is inversely proportional to the square of the distance between the charges. | ||||||||||
He also found that this force is directly proportional to the product of charges (magnitudes only). | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
The history of the formula isn't particularly important to understanding the formula itself, imo |
||||||||||
|
||||||||||
We can show it with the following explanation. Let’s say that there are two charges q1 and q2. | ||||||||||
The distance between the charges is ‘r’, and the force of attraction/repulsion between them is ‘F’. Then | ||||||||||
|
||||||||||
F ∝ q1q2 | ||||||||||
|
||||||||||
Or, F ∝ 1/r^2 | ||||||||||
|
||||||||||
F = k*q1*q2/ r^2 | ||||||||||
|
||||||||||
where k is proportionality constant and equals to 1/4πε0. | ||||||||||
|
||||||||||
Here, ε0 is the epsilon naught and it signifies permittivity of a vacuum. The value of k comes 9 × 10^9 Nm^2/ C^2 | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 9 x 10^9 N * m^2 / C^2 is only an approximation for Coulomb's constant. Wikipedia gives a much more precise value of 8.9875517923 x 10^9 N * m^2 / C^2 |
||||||||||
when we take the S.I unit of value of ε0 is 8.854 × 10^-12 C^2 N^-1 m^-2. | ||||||||||
|
||||||||||
The unit of Electrostatic force is newton.Mathematically it is written as: | ||||||||||
F = (k*q1*q2)/(r**2) | ||||||||||
|
||||||||||
Where, F is the Electrostatic force,q1 q2 are the intensity of two charges respecticvely , | ||||||||||
r is the radius and k is coulombs constant and its value is 9×10^9 N⋅m^2⋅C^−2 . | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||
|
||||||||||
https://www.toppr.com/guides/physics/electric-charges-and-fields/coulombs-law/ | ||||||||||
""" | ||||||||||
|
||||||||||
|
||||||||||
def coulombs_law(q1: float, q2: float, radius: float) -> float: | ||||||||||
""" | ||||||||||
The Electrostatic Force formula is given as: (k*q1*q2)/(r**2) | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Specifying the units of |
||||||||||
>>> round(coulombs_law(15.5,20,15),2) | ||||||||||
12400000000.0 | ||||||||||
>>> round(coulombs_law(1,15,5),2) | ||||||||||
5400000000.0 | ||||||||||
>>> round(coulombs_law(20,-50,15),2) | ||||||||||
-40000000000.0 | ||||||||||
>>> round(coulombs_law(-5,-8,10),2) | ||||||||||
3600000000.0 | ||||||||||
>>> round(coulombs_law(50,100,50),2) | ||||||||||
18000000000.0 | ||||||||||
""" | ||||||||||
|
||||||||||
if radius <= 0: | ||||||||||
raise ValueError("The radius is always a positive non zero integer") | ||||||||||
return ((9 * 10**9) * q1 * q2) / (radius**2) | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Updated code with more precise value of Coulomb's constant |
||||||||||
|
||||||||||
|
||||||||||
if __name__ == "__main__": | ||||||||||
import doctest | ||||||||||
|
||||||||||
doctest.testmod(verbose=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider changing the file name from
coulomb_law.py
tocoulombs_law.py
, since the name is "Coulomb's Law"