Copyright | (c) Scott N. Walck 2011-2019 |
---|---|
License | BSD3 (see LICENSE) |
Maintainer | Scott N. Walck <walck@lvc.edu> |
Stability | experimental |
Safe Haskell | Safe |
Language | Haskell98 |
This module contains functions for working with charge, electric field, electric flux, and electric potential.
Synopsis
- type Charge = Double
- data ChargeDistribution
- totalCharge :: ChargeDistribution -> Charge
- eField :: ChargeDistribution -> VectorField
- eFieldFromPointCharge :: Charge -> Position -> VectorField
- eFieldFromLineCharge :: ScalarField -> Curve -> VectorField
- eFieldFromSurfaceCharge :: ScalarField -> Surface -> VectorField
- eFieldFromVolumeCharge :: ScalarField -> Volume -> VectorField
- electricFlux :: Surface -> ChargeDistribution -> Double
- electricPotentialFromField :: Position -> VectorField -> ScalarField
- electricPotentialFromCharge :: ChargeDistribution -> ScalarField
Charge
data ChargeDistribution Source #
A charge distribution is a point charge, a line charge, a surface charge,
a volume charge, or a combination of these.
The ScalarField
describes a linear charge density, a surface charge density,
or a volume charge density.
PointCharge Charge Position | point charge |
LineCharge ScalarField Curve |
|
SurfaceCharge ScalarField Surface |
|
VolumeCharge ScalarField Volume |
|
MultipleCharges [ChargeDistribution] | combination of charge distributions |
totalCharge :: ChargeDistribution -> Charge Source #
Total charge (in C) of a charge distribution.
Electric Field
eField :: ChargeDistribution -> VectorField Source #
The electric field produced by a charge distribution. This is the simplest way to find the electric field, because it works for any charge distribution (point, line, surface, volume, or combination).
eFieldFromPointCharge Source #
:: Charge | charge (in Coulombs) |
-> Position | of point charge |
-> VectorField | electric field (in V/m) |
Electric field produced by a point charge.
The function eField
calls this function
to evaluate the electric field produced by a point charge.
:: ScalarField | linear charge density lambda |
-> Curve | geometry of the line charge |
-> VectorField | electric field (in V/m) |
Electric field produced by a line charge.
The function eField
calls this function
to evaluate the electric field produced by a line charge.
eFieldFromSurfaceCharge Source #
:: ScalarField | surface charge density sigma |
-> Surface | geometry of the surface charge |
-> VectorField | electric field (in V/m) |
Electric field produced by a surface charge.
The function eField
calls this function
to evaluate the electric field produced by a surface charge.
eFieldFromVolumeCharge Source #
:: ScalarField | volume charge density rho |
-> Volume | geometry of the volume charge |
-> VectorField | electric field (in V/m) |
Electric field produced by a volume charge.
The function eField
calls this function
to evaluate the electric field produced by a volume charge.
Electric Flux
electricFlux :: Surface -> ChargeDistribution -> Double Source #
The electric flux through a surface produced by a charge distribution.
Electric Potential
electricPotentialFromField Source #
:: Position | position where electric potential is zero |
-> VectorField | electric field |
-> ScalarField | electric potential |
Electric potential from electric field, given a position to be the zero of electric potential.
electricPotentialFromCharge :: ChargeDistribution -> ScalarField Source #
Electric potential produced by a charge distribution. The position where the electric potential is zero is taken to be infinity.