From 8b90e816ac003b8c65d09b82ff1df3b1df660933 Mon Sep 17 00:00:00 2001 From: Eugeniy Mikhailov Date: Thu, 17 Nov 2011 17:25:29 -0500 Subject: file renamed --- faraday_and_psr/builder_tasks.m | 39 +++++++++++++++++++++++++ faraday_and_psr/pp_tasks.m | 65 +++++++++++++++++++++++++++++++++++++++++ faraday_and_psr/solver_task.m | 20 +++++++++++++ faraday_and_psr/task_solver.m | 20 ------------- faraday_and_psr/tasks_builder.m | 39 ------------------------- faraday_and_psr/tasks_pp.m | 65 ----------------------------------------- 6 files changed, 124 insertions(+), 124 deletions(-) create mode 100755 faraday_and_psr/builder_tasks.m create mode 100644 faraday_and_psr/pp_tasks.m create mode 100755 faraday_and_psr/solver_task.m delete mode 100755 faraday_and_psr/task_solver.m delete mode 100755 faraday_and_psr/tasks_builder.m delete mode 100644 faraday_and_psr/tasks_pp.m diff --git a/faraday_and_psr/builder_tasks.m b/faraday_and_psr/builder_tasks.m new file mode 100755 index 0000000..78eea9e --- /dev/null +++ b/faraday_and_psr/builder_tasks.m @@ -0,0 +1,39 @@ +#!/usr/bin/octave -qf + +task_dir='tasks/'; +task_base_name='task_'; +task_ext='.mat'; +data_dir='results/'; +output_dir='results/'; +detuning_freq=0; + + +% assign some defaults +gmg=.7; % gyro magnetic ration for ground level + +%[psr_rad]=psr_vs_detuning(Ep, psi_el, B_field, theta, phi) + +% phi is angle between linear polarization and axis x +%phi=pi/4; +phi=0; +% theta is angle between lab z axis (light propagation direction) and magnetic field axis (z') +theta=0; +% psi_el is the ellipticity parameter (phase difference between left and right polarization) +psi_el=0*3/180*pi; + +Ep=sqrt(10.1); + +% we are going to sweep B so parts related to sweep paramer(s) +zeeman_splitting=+0.5; +Nsteps=101; +B_fields=linspace(-zeeman_splitting/gmg, zeeman_splitting/gmg, Nsteps); + +for i=1:Nsteps + filename_task=strcat(task_dir, task_base_name); + i_str=num2str(i, "%04d"); + filename_task=strcat(filename_task,i_str, task_ext); + B_field = B_fields(i); + save(filename_task, 'detuning_freq', 'Ep', 'psi_el', 'B_field', 'theta', 'phi'); +endfor + +disp("Tasks creation done"); diff --git a/faraday_and_psr/pp_tasks.m b/faraday_and_psr/pp_tasks.m new file mode 100644 index 0000000..82bcdac --- /dev/null +++ b/faraday_and_psr/pp_tasks.m @@ -0,0 +1,65 @@ +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.linear=(1-xi_linear).*Ep.linear; +Ep_out.left=(1-xi_left).*Ep.left; +Ep_out.right=(1-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.y).^2 ); +legend('y'); +title('Signal out'); diff --git a/faraday_and_psr/solver_task.m b/faraday_and_psr/solver_task.m new file mode 100755 index 0000000..c044cf6 --- /dev/null +++ b/faraday_and_psr/solver_task.m @@ -0,0 +1,20 @@ +#!/usr/bin/octave -qf +% reads parameters file (argv1) and output results of the calculations into output file (argv(2) + +arg_list = argv (); + +if (nargin < 2) + error("need at least two parameters"); +end +params_file=arg_list{1}; +output_fname=arg_list{2}; + +load(params_file); + +[xi_linear, xi_left, xi_right, E_field_pos_freq, light_positive_freq]=susceptibility_problem(detuning_freq, Ep, psi_el, B_field, theta, phi); + +save(output_fname, 'detuning_freq', 'Ep', 'psi_el', 'B_field', 'theta', 'phi' ... + , 'xi_linear', 'xi_left', 'xi_right' ... + , 'E_field_pos_freq', 'light_positive_freq' ... + ); + diff --git a/faraday_and_psr/task_solver.m b/faraday_and_psr/task_solver.m deleted file mode 100755 index c044cf6..0000000 --- a/faraday_and_psr/task_solver.m +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/octave -qf -% reads parameters file (argv1) and output results of the calculations into output file (argv(2) - -arg_list = argv (); - -if (nargin < 2) - error("need at least two parameters"); -end -params_file=arg_list{1}; -output_fname=arg_list{2}; - -load(params_file); - -[xi_linear, xi_left, xi_right, E_field_pos_freq, light_positive_freq]=susceptibility_problem(detuning_freq, Ep, psi_el, B_field, theta, phi); - -save(output_fname, 'detuning_freq', 'Ep', 'psi_el', 'B_field', 'theta', 'phi' ... - , 'xi_linear', 'xi_left', 'xi_right' ... - , 'E_field_pos_freq', 'light_positive_freq' ... - ); - diff --git a/faraday_and_psr/tasks_builder.m b/faraday_and_psr/tasks_builder.m deleted file mode 100755 index 78eea9e..0000000 --- a/faraday_and_psr/tasks_builder.m +++ /dev/null @@ -1,39 +0,0 @@ -#!/usr/bin/octave -qf - -task_dir='tasks/'; -task_base_name='task_'; -task_ext='.mat'; -data_dir='results/'; -output_dir='results/'; -detuning_freq=0; - - -% assign some defaults -gmg=.7; % gyro magnetic ration for ground level - -%[psr_rad]=psr_vs_detuning(Ep, psi_el, B_field, theta, phi) - -% phi is angle between linear polarization and axis x -%phi=pi/4; -phi=0; -% theta is angle between lab z axis (light propagation direction) and magnetic field axis (z') -theta=0; -% psi_el is the ellipticity parameter (phase difference between left and right polarization) -psi_el=0*3/180*pi; - -Ep=sqrt(10.1); - -% we are going to sweep B so parts related to sweep paramer(s) -zeeman_splitting=+0.5; -Nsteps=101; -B_fields=linspace(-zeeman_splitting/gmg, zeeman_splitting/gmg, Nsteps); - -for i=1:Nsteps - filename_task=strcat(task_dir, task_base_name); - i_str=num2str(i, "%04d"); - filename_task=strcat(filename_task,i_str, task_ext); - B_field = B_fields(i); - save(filename_task, 'detuning_freq', 'Ep', 'psi_el', 'B_field', 'theta', 'phi'); -endfor - -disp("Tasks creation done"); diff --git a/faraday_and_psr/tasks_pp.m b/faraday_and_psr/tasks_pp.m deleted file mode 100644 index 82bcdac..0000000 --- a/faraday_and_psr/tasks_pp.m +++ /dev/null @@ -1,65 +0,0 @@ -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.linear=(1-xi_linear).*Ep.linear; -Ep_out.left=(1-xi_left).*Ep.left; -Ep_out.right=(1-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.y).^2 ); -legend('y'); -title('Signal out'); -- cgit v1.2.3