order of moving and rotating

Kristian Nielsen kristian.nielsen at risoe.dk
Mon Mar 22 14:59:16 CET 1999


> Hello Kristian,
> 
> I am working together with Georg Artus on the program MCSTAS and I am very
> satisfied how it works. Congratulation to you and your colleague.
> 
> I am responsible for the powder diffractometer in munich. Up to now I
> finished simulations from source over neutron guide, monochromator second
> neutron guide, soller collimator and  to the sample.
> 
> Now I would like to include the sample of you (Al2O3) , another soller
> collimator and finally the detector.
> 
> Two questions:
> 
> 1.) Is it possible to save the result at the sample and for scanning the
> Bragg peak only to simulate the part sample to detector with an input file
> =66rom the sample (to save a lot of computing time), because all calculations
> up to the sample are equal if I would like to see a Bragg scan ?
> 
> 2.) Or do you have another idea how to simulate the last part of the
> diffractometer efficiently to see how Bragg peaks look like ?
> 
> greetings, Ralph

We have so far not had the need to simulate only part of an
instrument. All simulations have run sufficiently fast for our purposes,
even when doing the whole instrument.

It would certainly be possible to do what you suggest. A simple way
would be to write a new detector that simply dumps the complete neutron
state to a file (x,y,z,vx,vy,vz,p,t). Essentially just one line:

  fprintf(outfile, "%g %g %g %g %g %g %g %g\n", x,y,z,vx,vy,vz,p,t);

(plus some code to open and close the file). A new source component
would then be written that simply reads this file:

  fscanf(outfile, "%lf %lf %lf %lf %lf %lf %lf %lf\n",
         &x,&y,&z,&vx,&vy,&vz,&p,&t);

(again plus some extra open()/close() code). One must be careful about
the statistics though, since the same random number sequence is now used
for all runs. One could also try to fit the beam profile at the sample
or built a histogram and use that in another source component, but
handling such a multi-dimentional data set could be difficult.

But my advice would be to initially just try and see if the complete
simulation is not fast enough. McStas will generate hundreds of neutron
histories in the time it takes to read a single neutron state from disk.

 - Kristian.







More information about the mcstas-users mailing list