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
|
basis_transformation;
fnames=glob('results/*.mat');
Nsteps=length(fnames)
B_field=zeros(1,Nsteps);
xi_linear=zeros(1,Nsteps);
xi_left=zeros(1,Nsteps);
xi_right=zeros(1,Nsteps);
% read the information from resulting files
for i=1:Nsteps
d=load(fnames{i});
B_field(i)=d.B_field;
xi_linear(i)=d.xi_linear;
xi_left(i)=d.xi_left;
xi_right(i)=d.xi_right;
Ep.linear(i)=d.E_field_pos_freq.linear;
Ep.left(i)=d.E_field_pos_freq.left;
Ep.right(i)=d.E_field_pos_freq.right;
endfor
Ep_out.left = exp(sqrt(1+1i*xi_left)) .*Ep.left;
Ep_out.right = exp(sqrt(1+1i*xi_right)) .*Ep.right;
Ep_out.x= (Ep_out.left + Ep_out.right)/sqrt(2);
Ep_out.y= 1i*(Ep_out.left - Ep_out.right)/sqrt(2);
xi_x=(xi_right+xi_left)/sqrt(2);
xi_y=(1i*xi_right-1i*xi_left)/sqrt(2);
%figure(1);
%plot(B_field, real(xi_x), B_field, real(xi_y));
%legend('x','y');
%title('xi-real');
%figure(2);
%plot(B_field, imag(xi_x), B_field, imag(xi_y));
%legend('x','y');
%title('xi-imag');
%figure(3);
%plot(B_field, real(xi_left), B_field, real(xi_right));
%legend('left','right');
%title('xi-real');
%figure(4);
%plot(B_field, imag(xi_left), B_field, imag(xi_right));
%legend('left','right');
%title('xi-imag');
%figure(5);
%plot(B_field, abs(Ep_out.x).^2, B_field, abs(Ep_out.y).^2 );
%legend('x','y');
%title('Signal out');
%figure(6);
%plot(B_field, abs(Ep_out.left).^2, B_field, abs(Ep_out.right).^2 );
%legend('left','right');
%title('Signal out');
figure(7);
plot(B_field, abs(Ep_out.x).^2 );
legend('x');
title('Signal out');
figure(8);
plot(B_field, abs(Ep_out.y).^2 );
legend('y');
title('Signal out');
figure(9);
plot(B_field, abs(Ep_out.x).^2-abs(Ep_out.y).^2 );
legend('x-y');
title('Differential x-y out');
|