You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi Mike, thank you for the great code! I met two problems when calculating conductivity.
The first is in calcCond.py, it seems that the function: clacJ(self, jx, jy, jz, dt, tsjump, firstpoint,ver) will never use the variable 'firstpoint', which is the GKC_Skip.
The second one is in calcDiffusivity.py. I got a extreme low conductivity because of one negative diffusivity of component. It seems that the maximum possible value of firststep is the len(lnMSD) -1 ( = len( MSD ) -2 since lnMSD = np.log(MSD[1:]) ). Considering len(Time ) = len(MSD), the number of possible i in line 77( for i in range(int(firststep), len(Time)):) is at least 2, which will make the if statement in line 81( if len(calctime)==1:) never be true. Will it be better if change the for loop to be " for i in range(int(firststep)+1, len(Time)): "?
The text was updated successfully, but these errors were encountered:
I think both of these points are artifacts of how the code has evolved. For the first point, the correlation calculation used to be performed manually, which was significantly more expensive than the current method using fft, so skipping data isn't as important. I suppose if you needed to skip to account for equilibration or something like that, I believe if you add '[firstpoint:]' to all of the jx[l] and similar calls that should handle that. (It's been a while since I've looked at this code so I'm not certain).
For the second case, the len(calctime)==1 test is purely a test to confirm that the msd is long enough to calculate the diffusivity. Again, its been a while since have looked at the code, so I'm not exactly sure what the max value of firststep would be. While PyLAT does attempt to determine the linear region of the MSD for you, it is not perfect so I would always recommend plotting your MSD, especially if you are seeing unexpected values for your diffusivity
Hi Mike, thank you for the great code! I met two problems when calculating conductivity.
The first is in calcCond.py, it seems that the function: clacJ(self, jx, jy, jz, dt, tsjump, firstpoint,ver) will never use the variable 'firstpoint', which is the GKC_Skip.
The second one is in calcDiffusivity.py. I got a extreme low conductivity because of one negative diffusivity of component. It seems that the maximum possible value of firststep is the len(lnMSD) -1 ( = len( MSD ) -2 since lnMSD = np.log(MSD[1:]) ). Considering len(Time ) = len(MSD), the number of possible i in line 77( for i in range(int(firststep), len(Time)):) is at least 2, which will make the if statement in line 81( if len(calctime)==1:) never be true. Will it be better if change the for loop to be " for i in range(int(firststep)+1, len(Time)): "?
The text was updated successfully, but these errors were encountered: