Optimizing McStas
Kristian Nielsen
kristian.nielsen at risoe.dk
Thu Sep 23 11:45:58 CEST 1999
> Date: Wed, 22 Sep 1999 17:32:36 +0200
> From: Farhi <farhi at ill.fr>
> I'm really looking forward to see how you did implement your optimisation.
Good! The technique is actually quite complex, and I think that the code
is useless without documentation. So this is a very good oppertunity to
write this documentation that I have already put off for too long. I
will write something up on the plane-trip home to Copenhagen tonight.
> Can you put your adaptator in front of any component (in case user wants to
> optimize flux on sample or final detector for instance).
Yes (except that you put if after the component, and that it optimizes
for all non-absorbed neutrons, but that can easily be extended).
> What kind of source is it (rectangular, flat... ?).
Yes.
> I guess you included a minimum and maximum
> weight, in order not to completely delete bad neutrons (who knows, they can
> perhaps reach detector sometimes...).
Yes, in fact there are several issues like this, and a lot of care is
needed (the source component actually changes the adapted distribution
for every neutron emitted). The user can specify a minimum fraction for
neutrons.
> You choosed to use a 3D matrix for sampling neutron characteristics. This is
> ok, and enables to take correlated parameters into account.
Right. The main application for the correllation is that of a source
aiming at a monochromator; for given energy and position, only a single
divergence will allow Bragg reflection. I choose not to correlate with
the vertical because of a hunch that the resulting 5-D distribution
would end up too large. The problem is not so much one of memory, but
rather that the adaptive algorithm must have many samples in each bin in
order to learn correctly, so the number of bins should be much smaller
than the neutron history count.
> I was rather thinking about :
> 1- optimize x,y,vx,vy,vz and adapt p as required
> 2- use separate 1D arrays for each state parameter (limits would be
> determined in a 1st phase (say 5% of ncounts). This means that parameters are
> considered completely independent. It's a choice, but it enables fast
> sampling, and low memory cost for any parameter number to be optimized. I
> think it's ok if the minimum weight for bad neutrons is not 0 (say 10 % of
> bad neutrons are kept)
> 3- a separate component from source and monitor. This would enable user to
> select any kind of source, and optimize flux anywhere.
> 4- bad neutrons would be ABSORBed, this would lead to a new source shot.
I think this sounds quite interesting, and would nicely complement what
I have. A special advantage is the fact that it is independent of the
particular source component modelled. I would encourage you to go on
with your idea, and I hope we can continue to discuss it! I am very open
to extending the McStas core in case this is useful for your work.
- Kristian.
More information about the mcstas-users
mailing list