From d057093a7681a0ea448f8ae98e241eeafd5ad050 Mon Sep 17 00:00:00 2001 From: Dominic Steinitz Date: Wed, 21 Mar 2018 13:12:57 +0000 Subject: Return the entire results matrix (as a vector) --- packages/sundials/src/Main.hs | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'packages/sundials/src/Main.hs') 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 v = x V.! 1 w = x V.! 2 +stiffish t v = V.fromList [ lamda * u + 1.0 / (1.0 + t * t) - lamda * atan t ] + where + lamda = -100.0 + u = v V.! 0 + main :: IO () main = do let res = solveOde brusselator (V.fromList [1.2, 3.1, 3.0]) (V.fromList [0.0, 1.0 .. 10.0]) putStrLn $ show res + let res = solveOde stiffish (V.fromList [1.0]) (V.fromList [0.0, 0.1 .. 10.0]) + putStrLn $ show res -- cgit v1.2.3