diff --git a/scripts/symbolic_calculations.jl b/scripts/symbolic_calculations.jl new file mode 100644 index 0000000000000000000000000000000000000000..2b98fc48c18145c24f8c96e16dad58aadc71cc1f --- /dev/null +++ b/scripts/symbolic_calculations.jl @@ -0,0 +1,19 @@ +using Reduce + +# explicitly calculate l1 integral over reference triangle with first order +# lagrange discretization +function l1triangle() + integrand_2 = :(abs(u0 * (1-x1-x2) + u1 * x1 + u2 * x2)) + + integral_2 = Reduce.Algebra.int(integrand_2, :x2) + integrand_1 = Reduce.Algebra.:-( + Reduce.Algebra.sub(:x2 => :(1 - x1), integral_2), + Reduce.Algebra.sub(:x2 => 0, integral_2)) + + integral_1 = Reduce.Algebra.int(integrand_1, :x1) + result = Reduce.Algebra.:-( + Reduce.Algebra.sub(:x1 => 1, integral_1), + Reduce.Algebra.sub(:x1 => 0, integral_1)) + + return result +end