From: Majzoub, E. <eri...@um...> - 2024-03-15 19:20:01
|
Hi Barton: Thanks for the reply. I will submit a bug report. I've tried to address some of your questions below. > One quick observation is that with or without abs_integrate, the > result is the same. Right? > Without loading abs_integrate, both the fourie.mac and pdefourier.mac packages will return integrals unevaluated if they contain unit_step(x). For example: (%i2) load(pdefourier)$ (%i3) f(x) := 2*unit_step(x) -1; (%o3) f(x) := 2 unit_step(x) - 1 (%i4) fouriercoeff(f(x),x,1); 1 ⌠ ⎮ (%o4) [[0, 2 ⎮ unit_step(x) cos(%pi n x) dx, ⎮ ⌡ - 1 1 ⌠ ⎮ 2 ⎮ unit_step(x) sin(%pi n x) dx], []] ⎮ ⌡ - 1 (%i5) load(abs_integrate)$ (%i6) fouriercoeff(f(x),x,1); n 2 (- 1 + (- 1) ) (%o6) [[0, 0, - ────────────────], []] %pi n > Glancing at the source code, I see a deeply nested function adefint. > My guess is that its functionality (if any) should be blended in > with the generic definite integration code? > I don't understand the code base well enough to make a judgment here. > > Plus, the functions remfun2 andremfunn2 seem like they shouldn't be > needed—they do things that the general simplifier should be doing? > Looking at the progression of functions in fourie.mac: remfun1 -> remfun2 -> remfunn2, and the delfunxx functions, it seems like someone was making improvements to catch some corner cases. But I don't fully understand what these functions do. In any event, my example failed because oddfunp returned false. Do you agree that modifying oddfunp and evenfunp in fourie.mac to work with functions constructed with unit_step(x) is a reasonable way to proceed? If so I can try to fix this. -Eric > > |