Closed Ian-Dolby closed 1 month ago
The phase space volume elements obtained using dist.phasespacevolume()
are identical, and the difference is coming from the histograms.
Interesting... What RECORD_MODE=1 does, is that it makes a guiding center transformation and then updates the distributions as usual (i.e. as they are updated in pure GC simulation). Maybe the weight is not copied? I'll have a look.
Nice catch!
This should be now fixed in branch feature/119-recording-go-as-gc-brokes-distributions
.
Can you confirm @Ian-Dolby ?
The discrepancy is now only ~5e3 instead of 1e4, but it is still there. I have done git switch
and git fetch
, and done make clean
and then make ascot5_main -j MPI=0 VERBOSE=1 FLAGS="-g" CC=gcc
and make libascot -j MPI=0 VERBOSE=1 FLAGS="-g" CC=gcc
, so I'm fairly confident that I am testing the new version.
The new plots are quite similar to the old ones.
The simulations from that tutorial are set up with a time limit of 10 ms, but the difference remains even with a longer time limit.
Update: I made a mistake in rerunning the simulations and I was accidentally still using a previous version.
The agreement is now extremely good, within 0.1% for even quick simulations with 1e-4 s sim times.
Great! This fix will be in the next release.
When I record gyro-orbit runs as GCs (
RECORD_MODE = 1
), the FI distribution contains orders of magnitude (1e4) more particles. I get this result even with the ASCOT5 distributions tutorial setup. I have not changed any distribution values between the two settings, and all of the GO particles are always within the distribution boundaries, so I am not accidentally reducing the number of particles by them going outside. The total number of particles is obtained by usingdist.integrate(r=np.s_[:], phi=np.s_[:], z=np.s_[:], ppar=np.s_[:], pperp=np.s_[:],charge=np.s_[:], time=np.s_[:], copy=True).distribution().v
The results for the tutorial are below: FI total: 0.09996 (GC), 0.10007 (GO), 939.321, (GO as GC).
I found equivalent issues when recording the COM distribution in previous simulations.