]> gitweb.michael.orlitzky.com - numerical-analysis.git/blobdiff - src/FEM/R1/Example1.hs
Add Mat6 and Mat7 synonyms.
[numerical-analysis.git] / src / FEM / R1 / Example1.hs
diff --git a/src/FEM/R1/Example1.hs b/src/FEM/R1/Example1.hs
new file mode 100644 (file)
index 0000000..ffdf639
--- /dev/null
@@ -0,0 +1,39 @@
+module FEM.R1.Example1
+where
+
+import FEM.R1
+import Linear.Matrix hiding ((*))
+import Naturals
+import Piecewise
+
+big_A' :: Double -> Double
+big_A' = const 1
+
+c' :: Double -> Double
+c' x = sin x
+
+f' :: Double -> Double
+f' x = x*(sin x)
+
+bdy' :: BoundaryConditions Double
+bdy' = Left (Dirichlet (0,1))
+
+
+pde' :: PDE Double
+pde' = PDE big_A' c' f' bdy'
+
+mesh' :: Col4 (Double,Double)
+mesh' = fromList [[(0.0,1/3)],
+                  [(1/3,2/3)],
+                  [(2/3,4/5)],
+                  [(4/5,1.0)]]
+
+pvec' :: Col4 Int
+pvec' = fromList [[2],[3],[2],[1]]
+
+params' :: Params N4 N3 N7 Double
+params' = Params mesh' pvec'
+
+
+soln :: Piecewise Double
+soln = solution pde' params'