Hi,
First, thanks for all the great work on this toolbox, it's been immensely helpful! I had a question about the treatment of initial pressure vs. pressure sources.
In kspaceFirstOrder2D, at least, when source.p0 is specified, the velocity at time step -1/2 is updated so that the (linearly interpolated) velocity at time step 0 is zero. However, an instantaneous source specified in source.p at time step i, say, won't update the velocity at time step i - 1/2.
The effect, if I'm not mistaken, is that a zero initial pressure combined with an instantaneous pressure source in source.p (an approximate delta function in time multiplied by some spatial function g(x)), is not equivalent to specifying g(x) as an initial pressure. However, theoretically, they should be equivalent. Is this the intended behavior?
I noticed this when trying to do a Born approximation. The approximation appeared to suffer from phase errors, and was much more accurate after modifying the algorithm to include an analogous correction term to the velocity for pressure sources. The downside is that the correction term adds three extra FFTs to each iteration.
Thank you for your time!
Peter