Fixed python calculations, added gitignore
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
% Bessel beam
|
||||
function b = bessel(r, w0, r_max)
|
||||
ring_radius = 2.405; % radisu of the first ring of the besselj_0
|
||||
ring_radius = 2.405; % radius of the first ring of the besselj_0
|
||||
A = 2 * ring_radius / (w0 * r_max * exp(0.5)) * 2 * pi * integral(@(r) r.*besselj(0, ring_radius/w0 * r).^2, 0, r_max);
|
||||
b = A * besselj(0, 2.405/w0 * r).^2;
|
||||
b = A * besselj(0, ring_radius/w0 * r).^2;
|
||||
end
|
||||
16
Matlab/test.m
Normal file
16
Matlab/test.m
Normal file
@@ -0,0 +1,16 @@
|
||||
load_constants
|
||||
|
||||
fprintf('q_s = %e\n', qs_factor(pi / 4, pi / 4, n1, n2))
|
||||
fprintf('q_g = %e\n', qg_factor(pi / 4, pi / 4, n1, n2))
|
||||
fprintf('q_mag = %e\n', qmag_factor(pi / 4, pi / 4, n1, n2))
|
||||
fprintf('qs_avg = %e\n', qs_avg_factor(pi / 4, n1, n2))
|
||||
fprintf('qg_avg = %e\n', qg_avg_factor(pi / 4, n1, n2))
|
||||
fprintf('q_mag_avg = %e\n', qmag_avg_factor(pi / 4, n1, n2))
|
||||
fprintf('phi_i = %e\n', phi_i(Rsp, f))
|
||||
fprintf('gamma = %e\n', gamma_angle(pi / 4, Rsp, f))
|
||||
fprintf('th_i_z = %e\n', th_i_z(Rsp, Rsp, Rsp, f))
|
||||
fprintf('th_i_y = %e\n', th_i_y(pi / 4, Rsp, Rsp, Rsp, f))
|
||||
fprintf('qg_z = %e\n', qg_z_factor(Rsp, Rsp, n1, n2, Rsp, f))
|
||||
fprintf('qs_z = %e\n', qs_z_factor(Rsp, Rsp, n1, n2, Rsp, f))
|
||||
fprintf('qg_y = %e\n', qg_y_factor(pi / 4, Rsp, Rsp, n1, n2, Rsp, f))
|
||||
fprintf('qs_y = %e\n', qs_y_factor(pi / 4, Rsp, Rsp, n1, n2, Rsp, f))
|
||||
@@ -20,13 +20,13 @@ xlabel('r, м')
|
||||
ylabel('I(r)')
|
||||
|
||||
% Integration
|
||||
Qres_g = @(z) 1 / (pi * w0 ^ 2) * integral2(@(beta, r) r .* gauss(r, w0, r_max) .* ...
|
||||
iscomplex(qg_z_factor(r, z, n1, n2, Rsp, f)), 0, 2*pi, 0, r_max, ...
|
||||
'Method', 'iterated', 'AbsTol', 1e-12, 'RelTol', 1e-6);
|
||||
Qres_g = @(z) 2*pi / (pi * w0 ^ 2) * integral(@(r) r .* gauss(r, w0, r_max) .* ...
|
||||
iscomplex(qg_z_factor(r, z, n1, n2, Rsp, f)), 0, r_max, ...
|
||||
'AbsTol', 1e-12, 'RelTol', 1e-6);
|
||||
|
||||
Qres_s = @(z) 1 / (pi * w0 ^ 2) * integral2(@(beta, r) r .* gauss(r, w0, r_max) .* ...
|
||||
iscomplex(qs_z_factor(r, z, n1, n2, Rsp, f)), 0, 2*pi, 0, r_max, ...
|
||||
'Method', 'iterated', 'AbsTol', 1e-12, 'RelTol', 1e-6);
|
||||
Qres_s = @(z) 2*pi / (pi * w0 ^ 2) * integral(@(r) r .* gauss(r, w0, r_max) .* ...
|
||||
iscomplex(qs_z_factor(r, z, n1, n2, Rsp, f)), 0, r_max, ...
|
||||
'AbsTol', 1e-12, 'RelTol', 1e-6);
|
||||
|
||||
% Calulation
|
||||
N = 200;
|
||||
@@ -1,4 +1,4 @@
|
||||
% Beam with uniform distribution
|
||||
function u = uniform(r, w0, r_max, P)
|
||||
u = P / (pi*r_max^2);
|
||||
function u = uniform(r, w0, r_max)
|
||||
u = ones(size(r));
|
||||
end
|
||||
Reference in New Issue
Block a user