physics.magnetic_flux

on the angle formed between the magnetic field and the normal line (N) in area A. Check out the formula used to calculate this flux:

Φ = B.A.cos(θ) |

Φ = magnetic flux (weber (Wb) or tesla square meter (T.m²)) B = magnetic field (tesla (T)) A = area (square meter (m²)) θ = angle between magnetic field and normal line (degrees (°))

(Description adapted from https://en.wikipedia.org/wiki/Magnetic_flux )

Functions

__check_args(→ None)

Check that the arguments are valid

magnetic_flux(→ float)

Module Contents

physics.magnetic_flux.__check_args(magnetic_field: float, area: float, angle: float) None

Check that the arguments are valid >>> __check_args(10, 10, -10) Traceback (most recent call last):

ValueError: Invalid angle. Range is 0-180 degrees. >>> __check_args(10, -10, 10) Traceback (most recent call last):

ValueError: Invalid area. Should be a positive number. >>> __check_args(-10, 10, 10) Traceback (most recent call last):

ValueError: Invalid magnetic field. Should be a positive number.

physics.magnetic_flux.magnetic_flux(magnetic_field: float, area: float, angle: float) float
>>> magnetic_flux(50.0, 2, 0.0)
100.0
>>> magnetic_flux(50, 2, 60.0)
50.0
>>> magnetic_flux(0.5, 4.0, 90.0)
0.0
>>> magnetic_flux(1, 2.0, 180.0)
-2.0
>>> magnetic_flux(-1.0, 2.0, 30.0)
Traceback (most recent call last):
    ...
ValueError: Invalid magnetic field. Should be a positive number.
>>> magnetic_flux(1.0, 'a', 30.0)
Traceback (most recent call last):
    ...
TypeError: Invalid area. Should be an integer or float.
>>> magnetic_flux(1.0, -2.0, 30.0)
Traceback (most recent call last):
    ...
ValueError: Invalid area. Should be a positive number.