diff options
author | Dominic Steinitz <dominic@steinitz.org> | 2018-04-08 10:38:59 +0100 |
---|---|---|
committer | Dominic Steinitz <dominic@steinitz.org> | 2018-04-08 10:38:59 +0100 |
commit | 56c51c7476beeab5f1b701da8339f9bc1422cd52 (patch) | |
tree | 709c2f103097fbe0e35b45ccbf9f73cca34a24b1 /packages/sundials/src/Numeric/Sundials/ARKode | |
parent | c15409b09cb5133bf7f226aa8c8de06c9dbfdbd2 (diff) |
Tidy and add picture
Diffstat (limited to 'packages/sundials/src/Numeric/Sundials/ARKode')
-rw-r--r-- | packages/sundials/src/Numeric/Sundials/ARKode/ODE.hs | 18 |
1 files changed, 2 insertions, 16 deletions
diff --git a/packages/sundials/src/Numeric/Sundials/ARKode/ODE.hs b/packages/sundials/src/Numeric/Sundials/ARKode/ODE.hs index 8f83fe7..2577b8e 100644 --- a/packages/sundials/src/Numeric/Sundials/ARKode/ODE.hs +++ b/packages/sundials/src/Numeric/Sundials/ARKode/ODE.hs | |||
@@ -35,6 +35,8 @@ | |||
35 | -- main = mplot (ts : toColumns sol) | 35 | -- main = mplot (ts : toColumns sol) |
36 | -- @ | 36 | -- @ |
37 | -- | 37 | -- |
38 | -- <<diagrams/brusselator.png#diagram=brusselator&height=400&width=500>> | ||
39 | -- | ||
38 | -- KVAERNO_4_2_3 | 40 | -- KVAERNO_4_2_3 |
39 | -- | 41 | -- |
40 | -- \[ | 42 | -- \[ |
@@ -70,7 +72,6 @@ | |||
70 | module Numeric.Sundials.ARKode.ODE ( odeSolve | 72 | module Numeric.Sundials.ARKode.ODE ( odeSolve |
71 | , odeSolveV | 73 | , odeSolveV |
72 | , odeSolveVWith | 74 | , odeSolveVWith |
73 | , odeSolve' | ||
74 | , getButcherTable | 75 | , getButcherTable |
75 | , getBT | 76 | , getBT |
76 | , btGet | 77 | , btGet |
@@ -244,21 +245,6 @@ odeSolve f y0 ts = | |||
244 | nC = length y0 | 245 | nC = length y0 |
245 | g t x0 = V.fromList $ f t (V.toList x0) | 246 | g t x0 = V.fromList $ f t (V.toList x0) |
246 | 247 | ||
247 | odeSolve' :: ODEMethod | ||
248 | -> (Double -> [Double] -> [Double]) -- ^ The RHS of the system \(\dot{y} = f(t,y)\) | ||
249 | -> [Double] -- ^ initial conditions | ||
250 | -> Vector Double -- ^ desired solution times | ||
251 | -> Matrix Double -- ^ solution | ||
252 | odeSolve' method f y0 ts = | ||
253 | case odeSolveVWith method (XX' 1.0e-6 1.0e-10 1 1) g (V.fromList y0) (V.fromList $ toList ts) of | ||
254 | Left c -> error $ show c -- FIXME | ||
255 | Right (v, d) -> trace (show d) $ (nR >< nC) (V.toList v) | ||
256 | where | ||
257 | us = toList ts | ||
258 | nR = length us | ||
259 | nC = length y0 | ||
260 | g t x0 = V.fromList $ f t (V.toList x0) | ||
261 | |||
262 | odeSolveVWith :: | 248 | odeSolveVWith :: |
263 | ODEMethod | 249 | ODEMethod |
264 | -> StepControl | 250 | -> StepControl |