Integrating over piecewise approxfun

nilsbecker
Mon, 24 Mar 2025 13:40:37 +0000
Numerics

Following up on my earlier post, I now have an ApproxFun.jl Fun defined over a piecewise domain:

using ApproxFun
f_pw = Fun(x -> (x < 1.0 ? exp(x) : 1.), union(Segment(0.,1.), Segment(1.,2.)))
f_pw_i = integrate(f_pw)

The integrated f_pw_i does not quite behave like the integral, as each piece is separately centered to yield a zero constant term.
Is there a way to define an operator that integrates from the leftmost boundary onwards, and over the discontinuity to yield a continuous function on the joint domain of f_pw?

9 posts - 3 participants