Open levi2234 opened 12 months ago
@levi2234 Can you share the code so that I can take a closer look at the issue? Thanks!
@levi2234 Can you share the code so that I can take a closer look at the issue? Thanks!
Yes Definitely,
Here is the exact code used to create the above images
@levi2234 Ok, I see what the problem is. You treat the two separated Gaussian lumps as a one combined distribution, which means that the region between the lumps is actually inside the combined charge distribution. But the multipole expansion you are doing is an exterior expansion, so the solution between the lumps must be far off from the true solution. What you could do is calculate the multipole expansion for each of the lumps separately and then add the solutions. However, convergence would be quite bad because the two lumps are rather close together. Remember that the actual use case for the multipole expansion (at least numerically) is to get a good approximation for the far field solutions. In your case, your domain is a mixture of interior region and near-field exterior region, so here I would probably try solve the Poisson equation by some iterative grid method instead of using multipoles...
Discussed in https://github.com/maroba/multipoles/discussions/15