Open eschnett opened 4 months ago
What about sum(u)
?
sum(u)
works.
Is this how the definite integral should be calculated?
Yes, I believe this comes from Chebfun
It's in some sense just a synonym for DefiniteIntegral
, but in this case the overrides for the autodiff live here https://github.com/JuliaApproximation/ApproxFun.jl/blob/master/src/Extras/autodifferentiation.jl, and this shows that sum
, cumsum
and integrate
are more probably convenient.
I agree it's a confusing pun. An other confusing pun is conflating operators (which should be linear functions of functions) and multiplication.
The idea behind ContinuumArrays.jl/ClassicalOrthogonalPolynomials.jl was to separate the idea of "functions as vectors" and "functions as functions". The long term plan is to make ApproxFun.jl sit on top of these other projects and make a concrete distinction between these two languages. Unfortunately ApproxFun has a lot of features so it is taking a lot of time to realise this.
I want to solve a nonlinear PDE where I impose, instead of a boundary condition, that the integral over the domain is zero. I don't know how to express this – the way I tried leads to an error (see below).
Things work if I impose that the solution is zero at a particular point (that's the second term
u(0)
). When I replace this bysum(Integral()*u)
, I receive an error about an unimplemented function.I'd be happy to implement something, but as I'm new to the code I would need some pointers. For example, which function with what signature should be implemented?