learn-physics-0.6.4: Haskell code for learning physics

Copyright(c) Scott N. Walck 2011-2014
LicenseBSD3 (see LICENSE)
MaintainerScott N. Walck <walck@lvc.edu>
Stabilityexperimental
Safe HaskellTrustworthy
LanguageHaskell98

Physics.Learn.Charge

Contents

Description

This module contains functions for working with charge, electric field, electric flux, and electric potential.

Synopsis

Charge

type Charge = Double Source #

Electric charge, in units of Coulombs (C)

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.

Constructors

PointCharge Charge Position

point charge

LineCharge ScalarField Curve

ScalarField is linear charge density (C/m)

SurfaceCharge ScalarField Surface

ScalarField is surface charge density (C/m^2)

VolumeCharge ScalarField Volume

ScalarField is volume charge density (C/m^3)

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 #

Arguments

:: 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.

eFieldFromLineCharge Source #

Arguments

:: 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 #

Arguments

:: 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 #

Arguments

:: 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 #

Arguments

:: 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.