Skip to content
Snippets Groups Projects
Commit 41ccda61 authored by Stephan Hilb's avatar Stephan Hilb
Browse files

add l1 integral symbolic calculation script

parent 34912048
Branches
Tags
No related merge requests found
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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment