Project 4b: Wave propagation in magnetized plasmas along B -- Faraday Rotation
Before anything else, we need to change to the stored notebook's directory, which contains input files for the PIC simulator.
cd /notebooks/faraday-rotation
In this project you will study the propagation of an EM wave into a magnetized plasma while moving along the magnetic field. In such a plasma R and L waves exist. As was discussed in class the R and L waves are circularly polarized. So if you launch a linearly polarized wave in to the plasma you have to first decompose it into right and left handed circularly polarized waves to see what happens when it enters the magnetized plasma. If the frequency of the wave is larger than the (which is larger than for the highest density then both R and L waves will exit and it will propagate through. We will consider this case for this project (this situation could also arise if the frequency of the EM wave was below but below and above ).
However, if the frequency of the EM wave is lower then at the highest density but higher than and then the R wave will be reflected and the L wave will propage through. And if the plasma then ends a circularly polarized wave will exit the plasma. It will be right handed circularly polarized.
If the frequency of the EM wave is lower than at the highest density but lower than then the L wave will be reflected and the R wave will propagate through. And if the plasma then ends a circularly polarized wave will exit the plasma. It will be left handed circularly polarized.
All of these cases can be studied in this project if ones changes the input files. However, for this project we will examine Faraday rotation so the EM wave will have a frequency above both and .
1. Simulations with a Particle-in-Cell Code
In this project you simulate plasmas that have a uniform applied magnetic field in the (or ) direction. The value of B corresponds to =.5 where the incident EM wave has a frequency of . Note that this is different normalization than before. You can think of this as where we are sending the same EM wave into plasmas with different plasma densities but with the same magnetic field.
Each plasma electron is initialized with positions (only in or what we call ) such that the density is non-uniform. The ions are initialized at the same positions but they have an infinite mass. Each electron is also initialized with velocities ( , , )=(.05c,.05c,.05c) or momentum ( , , ) from a Maxwellian in each direction. The particles then begin to move in the self-consistent fields that their current and charge density produce. The density will start at 0, rise rapidly to a value of or (make sure you understand the units) at =300 and then fall back to 0 at =480.
- The length of the simulation box is 1000
- The simulation will run for a time 1100 .
- The simulation uses 50,000 particles.
An EM wave that is linearly polarized in the direction is launched from the vacuum. You will be looking at plots of the electric field in the two transverse directions, .
# Here is the density profile, # you can change the length of the plasma or the external magnetic field # to achieve the perfect change of polarization: # Here we plot the density profile: from scipy.optimize import fsolve import numpy as np import matplotlib.pyplot as plt %matplotlib inline npeak=0.14 xstart = 300 xend = 480.0 xmax =1000.0 xarray=np.arange(0,xmax,10.0) nx=xarray.shape[0] den_array=np.zeros(xarray.shape[0]) for ik in range(1,nx): if (xarray[ik] < xstart): den_array[ik]=0 elif (xarray[ik] < xend): den_array[ik]=npeak else: den_array[ik] = 0.0 plt.plot(xarray, den_array,'b',label='Plasma Density Profile') plt.xlabel('Z $[c/\omega_{pe}]$'); plt.ylabel('Density $[n_c]$') plt.title('Plasma Density Profile'); plt.legend() plt.xlim([0,xarray[nx-1]]); plt.ylim([0,1.25*npeak]) plt.legend(loc=0) plt.grid(b=True, which='major', axis='both') plt.show()
import osiris %matplotlib inline
2. Case 1: 90 degree rotation
# case 1: 90 degree rotation: dirname = 'faraday-rotation' osiris.runosiris(rundir=dirname,inputfile='faraday-rotation.txt')
dirname = 'faraday-rotation' osiris.plot_tx(rundir=dirname, b0_mag= 0.3, plot_or=2, show_theory=False,cmap='RdBu') osiris.plot_tx(rundir=dirname, b0_mag= 0.3, plot_or=3, show_theory=False,cmap='RdBu')
For this case, . Here we plot and .
- Can you explain the information shown in these two plots?
Next we make plots of and at positions in the vacuum both before ( ) and after ( ) the plasma.
from h5_utilities import * e2=read_hdf(dirname+'/e2.h5') e3=read_hdf(dirname+'/e3.h5') nt = e2.data.shape[0] tmax=e2.axes[1].axis_max dt=tmax/(nt) time_axis=np.arange(0,tmax,dt) f,(ax1,ax2,ax3,ax4)=plt.subplots(4,sharex=True,sharey=True) ax1.plot(time_axis,e2.data[:,200],label='e2, incident') ax1.legend() ax2.plot(time_axis,e2.data[:,2500],label='e2, transmitted') ax2.legend() ax3.plot(time_axis,e3.data[:,200],label='e3, incident') ax3.legend() ax4.plot(time_axis,e3.data[:,2500],label='e3, transmitted') ax4.legend() plt.show
- Can you explain what you see in these plots?
3. Below we look at the polarization of the EM wave as it moves across the plasma
Next we make a graph where we plot dots for the values of the electric field in the vs. plane. Each dot corresponds to a different time. The colors correspond to different values of . Blue is for an in the vacuum before the EM wave enters the plasma, red is for an in the plasma, and green is for an in the vacuum after the wave exits the plasma.
- the blue line is the polarization as a function of time at
- the red line is the polarization as a function of time at
- the green line is the polarization as a function of time at
dirname = 'faraday-rotation' from h5_utilities import * e2=read_hdf(dirname+'/e2.h5') e3=read_hdf(dirname+'/e3.h5') plt.scatter(e2.data[:,200],e3.data[:,200],c='b',label='in vacuum',s=2) plt.scatter(e2.data[:,2100],e3.data[:,2100],c='r',label='in plasma',s=2) plt.scatter(e2.data[:,2800],e3.data[:,2800],c='g',label='in vacuum (out)',s=2) plt.legend() plt.xlabel('$e_2$',fontsize=18) plt.ylabel('$e_3$',fontsize=18) plt.show()
- Can you explain this graph?
4. Case 2: 270 degree rotation --> this is achieved by changing the plasma density here
We next do a simulation in which everything is the same except the plasma density is increased to .
# case 1: 90 degree rotation: dirname = 'faraday-rotation-270' osiris.runosiris(rundir=dirname,inputfile='faraday-rotation-270.txt')
dirname = 'faraday-rotation-270' osiris.plot_tx(rundir=dirname, b0_mag= 0.3, plot_or=2, show_theory=False,cmap='RdBu') osiris.plot_tx(rundir=dirname, b0_mag= 0.3, plot_or=3, show_theory=False,cmap='RdBu')
Here we plot and .
- Can you explain the differences in these plots as compared to the lower density case?
Next we make plots of and at positions in the vacuum both before ( ) and after ( ) the plasma.
from h5_utilities import * e2=read_hdf(dirname+'/e2.h5') e3=read_hdf(dirname+'/e3.h5') nt = e2.data.shape[0] tmax=e2.axes[1].axis_max dt=tmax/(nt) time_axis=np.arange(0,tmax,dt) f,(ax1,ax2,ax3,ax4)=plt.subplots(4,sharex=True,sharey=True) ax1.plot(time_axis,e2.data[:,200],label='e2, incident') ax1.legend() ax2.plot(time_axis,e2.data[:,2500],label='e2, transmitted') ax2.legend() ax3.plot(time_axis,e3.data[:,200],label='e3, incident') ax3.legend() ax4.plot(time_axis,e3.data[:,2500],label='e3, transmitted') ax4.legend() plt.show
- Can you explain the differences in these plots from the low density case?
5. Below we look at the polarization of the EM wave as it moves across the plasma
Next we make a graph where we plot dots for the values of the electric field in the vs. plane. Each dot corresponds to a different time. The colors correspond to different values of . Blue is for an in the vacuum before the EM wave enters the plasma, red is for an in the plasma, and green is for an in the vacuum after the wave exits the plasma.
- the blue line is the polarization as a function of time at
- the red line is the polarization as a function of time at
- the green line is the polarization as a function of time at
dirname = 'faraday-rotation-270' from h5_utilities import * e2=read_hdf(dirname+'/e2.h5') e3=read_hdf(dirname+'/e3.h5') plt.scatter(e2.data[:,200],e3.data[:,200],c='b',label='in vacuum',s=2) plt.scatter(e2.data[:,2100],e3.data[:,2100],c='r',label='in plasma',s=2) plt.scatter(e2.data[:,2800],e3.data[:,2800],c='g',label='in vacuum (out)',s=2) plt.legend() plt.xlabel('$e_2$',fontsize=18) plt.ylabel('$e_3$',fontsize=18) plt.show()
- Can you explain the differences in these plots as compared to the lower density case?