-
Notifications
You must be signed in to change notification settings - Fork 1
/
columb_scattering.m
98 lines (69 loc) · 2.02 KB
/
columb_scattering.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
% Program to find the total scattering cross section
clc;
clear all;
%m =1.6e-27; %mass
m=1;
velocity = 1;
E = 0.5*m*velocity^2; %Energy
% e= 1.6e-19;
% k= -(9e9)*e^2;
% alpha = -k/(2*E);
alpha =1;
k=-1;
count =1;
for s = 0:0.01:1
l = sqrt(2*m*E)*s;
r_m = alpha + sqrt( alpha^2 + s^2);
u_m = r_m^-1;
%
f = @(x) s/( 1 + x.*(k/E) -x.^2.*s^2 ).^0.5;
%syms y;
%mysol = @(y) E*(1 - s^2.*y.^-2) -alpha*exp(-k.*y);
% choose only real elements...
% r = fsolve(@(y)E*(1 - s^2.*y.^-2) -alpha*exp(-k.*y),5);
% sel = r == real(r);
% r_reals =r( sel );
%
% %Choosing non-negative no..
%
% sol = max(r);
%
% u_m = 1/sol;
% f = @(x) s/( 1 - (alpha/E)*exp(-k./x) -x.^2.*s^2 ).^0.5;
n=100;
[point,W] = lgwt(n,0,u_m); %Finding the weights and points for quadrature
sum = 0;
for i=1:length(W)
sum = sum + W(i)*f(point(i)); %Gauss Quadrature integration
end
theta(count) = pi- 2*sum;
count = count+1;
end
s= 0:0.01:1;
a = length(s);
p = polyfit(theta,s,2);
inverse_fun = polyfit(theta,s,15);
fun_der = polyder(inverse_fun);
sigma_new = abs(polyval(fun_der,theta)).*s./sin(theta);
plot(s,theta);
grid on;
xlabel('s ','FontWeight','bold');
ylabel('theta ','FontWeight','bold');
title('Theta Vs. s ','FontWeight','bold');
figure;
plot(polyval(inverse_fun,theta),theta);
grid on;
figure;
% plot(s,sigma_new);
% grid on;
% xlabel('s','FontWeight','bold');
% ylabel('sigma ','FontWeight','bold');
% title('Scattering cross sectionl Vs. s ','FontWeight','bold');
% hold on;
sigma_th = (k/(4*E))^2*sin(theta./2).^-4;
plot(s,sigma_th,'r',s,sigma_new,'b');
grid on;
legend('Theoretical','Numerical');
xlabel('s','FontWeight','bold');
ylabel('sigma ','FontWeight','bold');
title('Scattering cross sectionl Vs. s ','FontWeight','bold');