Neuroinflab / kESI

GNU General Public License v3.0
2 stars 5 forks source link

testing boundary conditions #36

Open mdovgialo opened 1 month ago

mdovgialo commented 1 month ago

Mesh boundary conditions (grounding placement) can have interesting effects on the resulting potential and correction fields. Need to test.

Seems like far boundary creates results in the biggest agreement with analytical solutions for monopoles. Dipoles are fine with local grounding electrode, because they decay faster. Also far boundary only breaks dipoles in MFEM forward solver due to calculating differences of in a very big number...

mdovgialo commented 1 month ago

Conditions

Tested Dirichlet BC, which just enforces given potential (zero) at some surfaces Air cube for boundaries was increased to 0.5 meter in size, with the 4 spheres (0.09 meter radius) being in the middle of it Meshes are coarse: 5 mm max element size

4 spheres in air, realistic radii and conductivities

Tested positions:

  1. Electrode in the skin
  2. Electrode in the skin + air cube having enforced 0 on all boundaries
  3. Electrode in the brain (deep) + air cube having enforced 0 on all 6 sufaces
  4. air cube having enforced 0 on all 6 surfaces

Dirichlet BC Monopoles

Monopole at the center

All curves are re-grounded at z=-0.05

Image

boundary without electrode explodes into 1e9 range inside of the spheres, and quickly decays to 0 towards the boundaries of the domain

Image

Image

Top of the sphere:

Image

Image

re-grounded at 0.08

Image

Image

Boundary only BC, without ground electrode has potential of gigavolts inside the sphere, and has a different decay, symmetrical, unlike others, due to no 0 enforement inside of the spheres, but also shape is slightly different from other MFEM solutions. More than that MFEM solution with only far boundary BC follows free space kCSD curve EXACTLY until the boundary of the materials!!!

Grounding electrode on the sphere introduces artifacts. Let's look at them:

1 Amper point source, location: just below the skull in the brain: 0,0,0.0785

Grounding electrode in the skin

Image (domain spans from -0.1 to 0.2)

Image

far boundary and electrode in the skin

Image

Image

far boundary and electrode in the brain tissue

Image

Image

only far boundary on the cube

Image

Image

free space potential (sigma=0.33)

Just to compare:

Image

Image

Dirichlet BC Dipoles

Dipole at 0,0,0.3

All curves are re-grounded at z=-0.04

Image

Most likely due to having GIANT monopole potentials inside the 4 spheres the boundary only BC potential for dipoles has floating point quantization issues (dipole is simulated using 2 point sources)

Image

Image

Image

Image

Re-grounding at z=-0.06 Image

Thoughts

Maybe, despite the giant potential jump on skin-air boundary, the far boundary only BC is the most correct?