Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refinement around electrodes - fixes dipole analytical solution disrepancy? 3 spheres comparison #52

Open
mdovgialo opened this issue Dec 10, 2024 · 5 comments

Comments

@mdovgialo
Copy link

mdovgialo commented Dec 10, 2024

In electrode modelling and signal simulations we want to refine the mesh around electrodes for better accuracy of point sources

For now 2 steps of refinement in 1 cm radius spheres around point sources seem to be the best solution for human sized brains at 0.005 m mesh element sizes

@mdovgialo
Copy link
Author

Results for electrode solver:

Image
Image

@mdovgialo
Copy link
Author

mdovgialo commented Dec 10, 2024

Simulating point dipole with different refinement levels:

4 spheres:

brain, skull, skin, air
conductivities=[ 0.33, 0.0165, 0.33, 1e-10]
radii=[0.082, 0.086, 0.09, 100.0]

Refinement in a 1cm sphere around dipole position. Each step is one subdivision of elements.

Image
Image
Image
Image

With regrounding at 0.085 to compare decay easier:
Image

Seems like adding more elements around point sources is changing overall offsets and decay in ai!

seems to fix overall incompatability talked about in #50

@danek8317

@mdovgialo
Copy link
Author

Experiment with mesh refinement

We refine the mesh near the dipole (radius 1 cm). Each refinement step subdivides the mesh elements which centroids are close to the dipole. At refinement step 4 50% of the mesh elements are in the sphere around the dipole, steps 5 and more --- 90+% of the mesh elements are the elements at the dipole. 2 steps of refinement increase amount of mesh elements from 1641418 to 1668160 by 1.6%.

4 spheres:
brain, skull, skin, air
conductivities=[ 0.33, 0.0165, 0.33, 1e-10]
radii=[0.082, 0.086, 0.09, 100.0]

Comparing with analytical solution.

2 types of meshes: with grounding electrode in the "neck" and without. BC - Dirichlet, outer shell is set to 0 and the grounding electrode also is set to 0. Rest of BC are "Natural":

Image

Meshes in the spheres have element resolution of 5 mm and it decreases in the air when we get further away from the spheres.

No electrode

Image
Image
Image
Other side:
Image

Regrounded at 0.085:
Image

Seems like FEM solver needs to have increased resolution around point dipoles/sources. But increasing it too much can loose accuracy in other regions. In this case of 5 mm mesh, 2 steps of refinement in 1 cm sphere around dipole seems to have the best result...

Neck grounding electrode:

Image
Image
Image
Back side:
Image

Regrounded at 0.085:
Image

Introducing grounding in the neck predictably adds an offset in the potential, and similar to electrode-less solutions, having too high resolution around the dipole changes the rate of decay in the air. Closest to the analytical line in the air above the spheres is again 2 steps of refinement. Interestingly enough, having neck grounding makes the solution be closer to the dipole at low distances, at low refinement steps.

Due to enforced 0 at the neck electrode, the potential below the spheres is "on the wrong side" and decay in the air does not follow the analytical curve at all.

2 steps

Image
Image
Image

Regrounded at 0,085

Image
Image

Due to enforced 0 at the neck electrode, the potential below the spheres is "on the wrong side" and decay in the air does not follow the analytical curve at all.

@mdovgialo
Copy link
Author

Example of refinement for electrode leadfield solver:

No refinement:
Image

Refinement:
Image

Image
As we can see we get more accurate representation of a point and faster decay in air

@mdovgialo mdovgialo changed the title refinement around electrodes refinement around electrodes - fixes dipole analytical solution disrepancy? Dec 10, 2024
@mdovgialo
Copy link
Author

Experiment with disabling dirichet BC

Only Neuman, otherwise setup the same as #52 (comment), 2 steps of refinement.

image
image

As we can see without electrode adding or removing far boundary enforced 0 doesn't change the result, most likely because two symmetrical point sources integration constant cancels out. It does change the offset for the solution with electrode. Let's look at the electrode location:

image

At the electrode location, the solution might be still be disturbed by the enforcement of zero current.

After regrounding at 0.085:

image
image

@mdovgialo mdovgialo changed the title refinement around electrodes - fixes dipole analytical solution disrepancy? refinement around electrodes - fixes dipole analytical solution disrepancy? 3 spheres comparison Dec 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant