No subject
Philipp Bernhardt
bernhard at amos.krist.uni-erlangen.de
Tue Feb 2 17:16:15 CET 1999
Hello,
I have used McStas with following configuration:
DEFINE INSTRUMENT FE(WEL)
TRACE
COMPONENT a1 = Arm()
AT (0,0,0) ABSOLUTE
COMPONENT source = Source_rectangular(
xw=0.1, yw=0.1,
lambda=WEL,
gammax=0.002, gammay=0.002,
dtx=0.0004)
AT (0,0,0) RELATIVE a1 ROTATED (0,0,0) RELATIVE a1
COMPONENT fermi=Fermi_Chopper(
rad=0.05,
nu=400,
delta=0.000200,
ymin=-0.05,
ymax=0.05,
w=0.005,
n=100,
r_slit=-100)
AT (0,0,0.1) RELATIVE a1 ROTATED (0,0,0) RELATIVE a1
COMPONENT mon=TOF_monitor(
xmin=-1,xmax=1,ymin=-1,ymax=1,
nchan=1000, dt=0.1, filename="tim.mon")
AT (0,0,0.2) RELATIVE a1 ROTATED (0,0,0) RELATIVE a1
END
Source_rectangular is producing neutrons
with the wavelength of lambda at the positon (+-xw,+-yw,0) with a
maximal divergence of gamma_x and gamma_y and a time between 0
and dtx. (see attachment)
When I use the option --trace, I get, for example, following result:
ENTER:
STATE: 0, 0, 0, 0, 0, 1, 0, 0, 0, 1
COMP: "a1"
STATE: 0, 0, 0, 0, 0, 1, 0, 0, 0, 1
STATE: 0, 0, 0, 0, 0, 1, 0, 0, 0, 1
COMP: "source"
STATE: 0, 0, 0, 0, 0, 1, 0, 0, 0, 1
STATE: -0.00524055, -0.0428509, 0, -2.85016, -2.11707, 1977.96,
0.000270516, 0, 0, 1
COMP: "fermi"
STATE: -0.00825353, -0.0428509, -0.1, -4.48881, -2.11707, 1977.96,
0.000270516, 0, 0, 1
STATE: -0.00836861, -0.0429051, -0.0492947, -4.48881, -2.11707, 1977.96,
0.000296151, 0, 0, 1
ABSORB:
LEAVE:
STATE: -0.00836861, -0.0429051, -0.0492947, -4.48881, -2.11707, 1977.96,
0.000296151, 0, 0, 1
The x and vx value have changed between the component source and fermi
without any reason (there should only be a translation in the z
direction). What could be the reason for this change?
I have another question: Is it possible to use functions in a component
and how could that be realized?
Thanks for any help.
Philipp
---------------------------
Philipp Bernhardt
Lehrstuhl für Kristallographie und Strukturphysik
email: philipp.bernhardt at krist.uni-erlangen.de
-------------- next part --------------
DEFINE COMPONENT Source_rectangular
DEFINITION PARAMETERS (xw, yw, lambda, gammax, gammay, dtx)
SETTING PARAMETERS ()
OUTPUT PARAMETERS ()
STATE PARAMETERS (x, y, z, vx, vy, vz, t, s1, s2, p)
DECLARE
%{
%}
INITIALIZE
%{
%}
TRACE
%{
double gamma_x,gamma_y,vges;
x=rand01()*xw-xw/2;
y=rand01()*yw-yw/2;
z=0.0;
gamma_x=2.0*rand01()*gammax*lambda-gammax*lambda;
gamma_y=2.0*rand01()*gammay*lambda-gammay*lambda;
vges=3955.931/lambda;
vz=sqrt(vges*vges/(tan(gamma_x)*tan(gamma_x)+tan(gamma_y)*tan(gamma_y)+1.0));
vx=tan(gamma_x)*vz;
vy=tan(gamma_y)*vz;
p=1.0;
t=rand01()*dtx;
%}
FINALLY
%{
%}
END
More information about the mcstas-users
mailing list