Safe Haskell | None |
---|---|

Language | Haskell98 |

Lazy evaluation allows for the solution of differential equations in terms of power series. Whenever you can express the highest derivative of the solution as explicit expression of the lower derivatives where each coefficient of the solution series depends only on lower coefficients, the recursive algorithm will work.

- solveDiffEq0 :: C a => [a]
- verifyDiffEq0 :: C a => [a]
- propDiffEq0 :: Bool
- solveDiffEq1 :: (C a, C a) => [a]
- verifyDiffEq1 :: (C a, C a) => [a]
- propDiffEq1 :: Bool

# Documentation

solveDiffEq0 :: C a => [a] Source

Example for a linear equation:
Setup a differential equation for `y`

with

y t = (exp (-t)) * (sin t) y' t = -(exp (-t)) * (sin t) + (exp (-t)) * (cos t) y'' t = -2 * (exp (-t)) * (cos t)

Thus the differential equation

y'' = -2 * (y' + y)

holds.

The following function generates
a power series for `exp (-t) * sin t`

by solving the differential equation.

verifyDiffEq0 :: C a => [a] Source

solveDiffEq1 :: (C a, C a) => [a] Source

We are not restricted to linear equations! Let the solution be y with y t = (1-t)^-1 y' t = (1-t)^-2 y'' t = 2*(1-t)^-3 then it holds y'' = 2 * y' * y

verifyDiffEq1 :: (C a, C a) => [a] Source