d4t_formulas/assets/formulas/electromagnetism.d4rt

60 lines
1.6 KiB
Text
Raw Normal View History

[
2026-02-24 09:21:07 +00:00
// Coulomb's Law
{
"name": "Coulomb's Law",
"description": r"""
Calculates the magnitude of the electrostatic force between two point charges.
Formula: $F = k \dfrac{q_1 q_2}{r^2}$ where $k = 8.9875517923\times10^9\ \mathrm{N\,m^2/C^2}$.
2026-03-04 21:24:37 +00:00
Inputs: $q_1$, $q_2$ in coulombs; $r$ in meters.
2026-02-24 09:21:07 +00:00
Output: Force `F` in newtons (N).""",
"input": [
{"name": "q1", "unit": "coulomb"},
{"name": "q2", "unit": "coulomb"},
{"name": "r", "unit": "meter"}
],
"output": {"name": "F", "unit": "newton"},
"d4rtCode": "F = (8.9875517923e9 * q1 * q2) / pow(r, 2);",
"tags": ["physics", "electricity", "electrostatics"]
},
// Ohm's Law
{
"name": "Ohm's Law",
"description": r"""
Relates voltage, current and resistance for a linear resistor.
Formula: $V = I\,R$.
Inputs: current `I` in amperes (A), resistance `R` in ohms (Ω).
Output: voltage `V` in volts (V).""",
"input": [
{"name": "I", "unit": "ampere"},
{"name": "R", "unit": "ohm"}
],
"output": {"name": "V", "unit": "volt"},
"d4rtCode": "V = I * R;",
"tags": ["physics", "electricity", "electronics"]
},
// Electric Power
{
"name": "Electric Power",
"description": r"""
Calculates electrical power delivered to a load.
Formula: $P = V\,I$ (also $P = I^2 R$ or $P = V^2 / R$ when substituting Ohm's law).
Inputs: voltage `V` in volts (V), current `I` in amperes (A).
Output: power `P` in watts (W).""",
"input": [
{"name": "V", "unit": "volt"},
{"name": "I", "unit": "ampere"}
],
"output": {"name": "P", "unit": "watt"},
"d4rtCode": "P = V * I;",
"tags": ["physics", "electricity", "electronics"]
}
]