quinnreynolds / minplascalc

minplascalc - LTE plasma calculations
GNU General Public License v3.0
6 stars 0 forks source link

Term cancellation in recalcGfeArrays #18

Closed quinnreynolds closed 7 years ago

quinnreynolds commented 7 years ago

Original report by Carl Sandrock (Bitbucket: alchemyst, GitHub: alchemyst).


Since

offDiagonal = -constants.boltzmann * T / niSum

and

onDiagonal = constants.boltzmann * T / ni

Why do we have

self.gfeVector[j] = (-mu  + onDiagonal[j] * ni[j] + offDiagonal * niSum)

if it appears that onDiagonal[j] * ni[j] + offDiagonal * niSum == constants.boltzmann * T -constants.boltzmann * T == 0?

quinnreynolds commented 7 years ago

Original comment by Quinn Reynolds (Bitbucket: kittychunk, GitHub: kittychunk).


Fixes #17

Calculation of gfeVector simplified, redundant terms removed

quinnreynolds commented 7 years ago

Original comment by Quinn Reynolds (Bitbucket: kittychunk, GitHub: kittychunk).


Well spotted; I wrote down the terms resulting from the Jacobian without following the algebra through. Too much coffee, not enough sleep ;)

Code can indeed be simplified neatly to self.gfeVector[j] = -mu (with each mu specific to index j) at each iteration of the solver.