Copyright | (c) Scott N. Walck 2023 |
---|---|
License | BSD3 (see LICENSE) |
Maintainer | Scott N. Walck <walck@lvc.edu> |
Stability | stable |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Code from chapter 19 of the book Learn Physics with Functional Programming
Synopsis
- type TwoBodyForce = ParticleState -> ParticleState -> ForceVector
- type ForceVector = Vec
- oneFromTwo :: ParticleState -> TwoBodyForce -> OneBodyForce
- gravityMagnitude :: Mass -> Mass -> R -> R
- universalGravity :: TwoBodyForce
- constantRepulsiveForceWrong :: ForceVector -> TwoBodyForce
- constantRepulsiveForce :: R -> TwoBodyForce
- linearSpring :: R -> R -> TwoBodyForce
- fixedLinearSpring :: R -> R -> Vec -> OneBodyForce
- centralForce :: (R -> R) -> TwoBodyForce
- linearSpringCentral :: R -> R -> TwoBodyForce
- billiardForce :: R -> R -> TwoBodyForce
- data Force
- data MultiParticleState = MPS {}
- data DMultiParticleState = DMPS [DParticleState]
- newtonSecondMPS :: [Force] -> MultiParticleState -> DMultiParticleState
- forcesOn :: Int -> MultiParticleState -> [Force] -> [OneBodyForce]
- forceOn :: Int -> MultiParticleState -> Force -> OneBodyForce
- eulerCromerMPS :: TimeStep -> NumericalMethod MultiParticleState DMultiParticleState
- updateMPS :: NumericalMethod MultiParticleState DMultiParticleState -> [Force] -> MultiParticleState -> MultiParticleState
- statesMPS :: NumericalMethod MultiParticleState DMultiParticleState -> [Force] -> MultiParticleState -> [MultiParticleState]
- speed :: ParticleState -> R
- universalGravity' :: TwoBodyForce
- universalGravityCentral :: TwoBodyForce
- lennardJones :: R -> R -> TwoBodyForce
- systemKE :: MultiParticleState -> R
- forcesOn' :: Int -> MultiParticleState -> [Force] -> [OneBodyForce]
- externalForcesOn :: Int -> [Force] -> [OneBodyForce]
- internalForcesOn :: Int -> MultiParticleState -> [Force] -> [OneBodyForce]
Documentation
type TwoBodyForce = ParticleState -> ParticleState -> ForceVector Source #
type ForceVector = Vec Source #
oneFromTwo :: ParticleState -> TwoBodyForce -> OneBodyForce Source #
linearSpring :: R -> R -> TwoBodyForce Source #
fixedLinearSpring :: R -> R -> Vec -> OneBodyForce Source #
Force provided by a spring that is fixed at one end.
centralForce :: (R -> R) -> TwoBodyForce Source #
linearSpringCentral :: R -> R -> TwoBodyForce Source #
billiardForce :: R -> R -> TwoBodyForce Source #
data MultiParticleState Source #
Instances
HasTime MultiParticleState Source # | |
Defined in LPFPCore.MultipleObjects timeOf :: MultiParticleState -> Time Source # | |
Show MultiParticleState Source # | |
Defined in LPFPCore.MultipleObjects showsPrec :: Int -> MultiParticleState -> ShowS # show :: MultiParticleState -> String # showList :: [MultiParticleState] -> ShowS # | |
Diff MultiParticleState DMultiParticleState Source # | |
Defined in LPFPCore.MultipleObjects shift :: R -> DMultiParticleState -> MultiParticleState -> MultiParticleState Source # |
data DMultiParticleState Source #
Instances
RealVectorSpace DMultiParticleState Source # | |
Defined in LPFPCore.MultipleObjects | |
Show DMultiParticleState Source # | |
Defined in LPFPCore.MultipleObjects showsPrec :: Int -> DMultiParticleState -> ShowS # show :: DMultiParticleState -> String # showList :: [DMultiParticleState] -> ShowS # | |
Diff MultiParticleState DMultiParticleState Source # | |
Defined in LPFPCore.MultipleObjects shift :: R -> DMultiParticleState -> MultiParticleState -> MultiParticleState Source # |
newtonSecondMPS :: [Force] -> MultiParticleState -> DMultiParticleState Source #
forcesOn :: Int -> MultiParticleState -> [Force] -> [OneBodyForce] Source #
forceOn :: Int -> MultiParticleState -> Force -> OneBodyForce Source #
updateMPS :: NumericalMethod MultiParticleState DMultiParticleState -> [Force] -> MultiParticleState -> MultiParticleState Source #
statesMPS :: NumericalMethod MultiParticleState DMultiParticleState -> [Force] -> MultiParticleState -> [MultiParticleState] Source #
speed :: ParticleState -> R Source #
lennardJones :: R -> R -> TwoBodyForce Source #
systemKE :: MultiParticleState -> R Source #
forcesOn' :: Int -> MultiParticleState -> [Force] -> [OneBodyForce] Source #
externalForcesOn :: Int -> [Force] -> [OneBodyForce] Source #
internalForcesOn :: Int -> MultiParticleState -> [Force] -> [OneBodyForce] Source #