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 14 of the book Learn Physics with Functional Programming
Synopsis
- velocityCF :: Mass -> Velocity -> [Force] -> Time -> Velocity
- type R = Double
- type Mass = R
- type Time = R
- type Position = R
- type Velocity = R
- type Force = R
- positionCF :: Mass -> Position -> Velocity -> [Force] -> Time -> Position
- velocityFt :: R -> Mass -> Velocity -> [Time -> Force] -> Time -> Velocity
- antiDerivative :: R -> R -> (R -> R) -> R -> R
- integral :: R -> (R -> R) -> R -> R -> R
- positionFt :: R -> Mass -> Position -> Velocity -> [Time -> Force] -> Time -> Position
- pedalCoast :: Time -> Force
- fAir :: R -> R -> R -> Velocity -> Force
- newtonSecondV :: Mass -> [Velocity -> Force] -> Velocity -> R
- updateVelocity :: R -> Mass -> [Velocity -> Force] -> Velocity -> Velocity
- velocityFv :: R -> Mass -> Velocity -> [Velocity -> Force] -> Time -> Velocity
- bikeVelocity :: Time -> Velocity
- newtonSecondTV :: Mass -> [(Time, Velocity) -> Force] -> (Time, Velocity) -> (R, R)
- updateTV :: R -> Mass -> [(Time, Velocity) -> Force] -> (Time, Velocity) -> (Time, Velocity)
- statesTV :: R -> Mass -> (Time, Velocity) -> [(Time, Velocity) -> Force] -> [(Time, Velocity)]
- velocityFtv :: R -> Mass -> (Time, Velocity) -> [(Time, Velocity) -> Force] -> Time -> Velocity
- pedalCoastAir :: [(Time, Velocity)]
- pedalCoastAir2 :: Time -> Velocity
- velocityCF' :: Mass -> Velocity -> [Force] -> Time -> Velocity
- sumF :: [R -> R] -> R -> R
- positionFv :: R -> Mass -> Position -> Velocity -> [Velocity -> Force] -> Time -> Position
- positionFtv :: R -> Mass -> Position -> Velocity -> [(Time, Velocity) -> Force] -> Time -> Position
- updateExample :: (Time, Velocity) -> (Time, Velocity)
Documentation
antiDerivative :: R -> R -> (R -> R) -> R -> R Source #
Given a step size, a y-intercept, and a function, return a function with the given y-intercept whose derivative is the given function.
integral :: R -> (R -> R) -> R -> R -> R Source #
Given a step size, a function, a lower limit, and an upper limit, return the definite integral of the function.
pedalCoast :: Time -> Force Source #
bikeVelocity :: Time -> Velocity Source #
updateTV :: R -> Mass -> [(Time, Velocity) -> Force] -> (Time, Velocity) -> (Time, Velocity) Source #
statesTV :: R -> Mass -> (Time, Velocity) -> [(Time, Velocity) -> Force] -> [(Time, Velocity)] Source #
velocityFtv :: R -> Mass -> (Time, Velocity) -> [(Time, Velocity) -> Force] -> Time -> Velocity Source #
pedalCoastAir :: [(Time, Velocity)] Source #
pedalCoastAir2 :: Time -> Velocity Source #