Code in branch 17 cannot handle the self-interaction term or when particles are within 1 dt of each other because M(now) is not known when solving for these contributions. Step one of this issue is to reorganize the solution method. Instead of solving for H(now), solving for dM(now)/dt, then integrating to find M(future) I will do the following: Solve for H(past), solve for dM(past)/dt, solve for M(now). All M(past) values are known so there should be no issues with self and near field terms.
Note that I will start by only accounting for the self term, not interactions between particles within 1 dt. I will only consider one particle for the time being.
Code in branch 17 cannot handle the self-interaction term or when particles are within 1 dt of each other because M(now) is not known when solving for these contributions. Step one of this issue is to reorganize the solution method. Instead of solving for H(now), solving for dM(now)/dt, then integrating to find M(future) I will do the following: Solve for H(past), solve for dM(past)/dt, solve for M(now). All M(past) values are known so there should be no issues with self and near field terms.
Note that I will start by only accounting for the self term, not interactions between particles within 1 dt. I will only consider one particle for the time being.