- #1
Rika
- 233
- 51
Homework Statement
I have a problem with differential scattering cross section. It says: "division by zero". My full work is in attachment.
q = 2; - charge of particle
Q = 79; - charge of nucleus
m = 4; - mass of particle
M = 197; - mass of nucleus
R = 2.72; - nucleus radius
N = 30; - number of particles
bmin = 1; - impact parameter
bmax = 3;
vp = 50; - incident speed
x_rutherford - coordinates
y_rutherford
fi - scattering angle (rutherford)
fith - scattering angle (thomson)
dbdfi - db/dfi (rutherford)
dbdfith - db/dfith (thomson)
rpc - differential scattering cross section (rutherford)
rpcth - differential scattering cross section (thomson)
Homework Equations
if ((x_rutherford($)-x_rutherford($-1)) >= 0 ) do
fi(j) = 180*atan(abs(y_rutherford($)-y_rutherford($-1))/abs(x_rutherford($)-x_rutherford($-1)))/%pi;
else
fi(j) = 180 - 180*atan(abs(y_rutherford($)-y_rutherford($-1))/abs(x_rutherford($)-x_rutherford($-1)))/%pi;
end
if ((x_thomson($)-x_thomson($-1)) >= 0 ) do
fith(j) = 180*atan(abs(y_thomson($)-y_thomson($-1))/abs(x_thomson($)-x_thomson($-1)))/%pi;
else
fith(j) = 180 - 180*atan(abs(y_thomson($)-y_thomson($-1))/abs(x_thomson($)-x_thomson($-1)))/%pi;
end
The Attempt at a Solution
dbbfi=zeros(b);
for i = 3 : length(b)-2 do
dbdfi(i) = (b(i-2) - 8*b(i-1) + 8*b(i+1) - b(i+2))/(3*( abs(fi(i-2)-fi(i-1))+abs(fi(i-1)-fi(i))+abs(fi(i)-fi(i+1))+abs(fi(i+1)-fi(i+2)) ));
end
dbdfi(i+1)=0;
dbdfi(i+2)=0;
dbbfith=zeros(b);
for i = 3 : length(b)-2 do
dbdfith(i) = (b(i-2) - 8*b(i-1) + 8*b(i+1) - b(i+2))/(3*( abs(fith(i-2)-fith(i-1))+abs(fith(i-1)-fith(i))+abs(fith(i)-fith(i+1))+abs(fith(i+1)-fith(i+2)) ));
end
dbdfith(i+1)=0;
dbdfith(i+2)=0;
rpc = 2*%pi*b'.*dbdfi;
rpcth = 2*%pi*b'.*dbdfith;