#!/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");