LPFP-core-1.1.1: Code for the book Learn Physics with Functional Programming
Copyright(c) Scott N. Walck 2023
LicenseBSD3 (see LICENSE)
MaintainerScott N. Walck <walck@lvc.edu>
Stabilitystable
Safe HaskellSafe-Inferred
LanguageHaskell2010

LPFPCore.Newton2

Description

Code from chapter 14 of the book Learn Physics with Functional Programming

Synopsis

Documentation

type R = Double Source #

type Mass = R Source #

type Time = R Source #

type Force = R Source #

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.

fAir :: R -> R -> R -> Velocity -> Force Source #

statesTV :: R -> Mass -> (Time, Velocity) -> [(Time, Velocity) -> Force] -> [(Time, Velocity)] Source #

sumF :: [R -> R] -> R -> R Source #