diff options
author | Dominic Steinitz <dominic@steinitz.org> | 2018-03-21 13:12:57 +0000 |
---|---|---|
committer | Dominic Steinitz <dominic@steinitz.org> | 2018-03-21 13:12:57 +0000 |
commit | d057093a7681a0ea448f8ae98e241eeafd5ad050 (patch) | |
tree | e3f91821ebed46631cdd0293aa3c8cacec1ddec4 /packages/sundials/src/Main.hs | |
parent | 1b64b28dfccf2cb9539cdb4344cd7ecb1c1d0a1d (diff) |
Return the entire results matrix (as a vector)
Diffstat (limited to 'packages/sundials/src/Main.hs')
-rw-r--r-- | packages/sundials/src/Main.hs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/packages/sundials/src/Main.hs b/packages/sundials/src/Main.hs index 978088b..2a561c4 100644 --- a/packages/sundials/src/Main.hs +++ b/packages/sundials/src/Main.hs | |||
@@ -16,7 +16,14 @@ brusselator _t x = V.fromList [ a - (w + 1) * u + v * u^2 | |||
16 | v = x V.! 1 | 16 | v = x V.! 1 |
17 | w = x V.! 2 | 17 | w = x V.! 2 |
18 | 18 | ||
19 | stiffish t v = V.fromList [ lamda * u + 1.0 / (1.0 + t * t) - lamda * atan t ] | ||
20 | where | ||
21 | lamda = -100.0 | ||
22 | u = v V.! 0 | ||
23 | |||
19 | main :: IO () | 24 | main :: IO () |
20 | main = do | 25 | main = do |
21 | let res = solveOde brusselator (V.fromList [1.2, 3.1, 3.0]) (V.fromList [0.0, 1.0 .. 10.0]) | 26 | let res = solveOde brusselator (V.fromList [1.2, 3.1, 3.0]) (V.fromList [0.0, 1.0 .. 10.0]) |
22 | putStrLn $ show res | 27 | putStrLn $ show res |
28 | let res = solveOde stiffish (V.fromList [1.0]) (V.fromList [0.0, 0.1 .. 10.0]) | ||
29 | putStrLn $ show res | ||