test04.sh 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #!/bin/bash
  2. # This test case calculates the differential scattering
  3. # cross section from a Luneburg lens, as described in:
  4. # B. R. Johnson, Applied Optics 35 (1996) 3286-3296.
  5. #
  6. # The Luneburg lens is a sphere of radius a, with a
  7. # radially-varying index of refraction, given by:
  8. # m(r) = [2 - (r/a)**1]**(1/2)
  9. #
  10. # For the calculations, the Luneburg lens was approximated
  11. # as a multilayered sphere with 500 equally spaced layers.
  12. # The refractive index of each layer is defined to be equal to
  13. # m(r) at the midpoint of the layer: ml = [2 - (xm/xL)**1]**(1/2),
  14. # with xm = (xl-1 + xl)/2, for l = 1,2,...,L. The size
  15. # parameter in the lth layer is xl = l*xL/500. According to
  16. # geometrical optics theory, the differential cross section
  17. # can be expressed as:
  18. # d(Csca)/d(a**2*Omega) = cos(Theta)
  19. #
  20. # The differential cross section from wave optics is:
  21. # d(Csca)/d(a**2*Omega) = S11(Theta)/x**2
  22. PROGRAM='../../../scattnlay -l'
  23. L=500
  24. xL=60
  25. FULL_PROGRAM="$PROGRAM $L"
  26. for l in `seq 1 $L`; # Total number of layers
  27. do
  28. xlM1=$(echo "scale=2; ($l-1)*$xL/$L" | bc -l)
  29. xl=$(echo "scale=2; $l*$xL/$L" | bc -l)
  30. xm=$(echo "scale=2; ($xlM1+$xl)/2" | bc -l)
  31. ml=$(echo "scale=5; e(0.5*l(2-($xm/$xL)*($xm/$xL)))" | bc -l)
  32. FULL_PROGRAM="$FULL_PROGRAM $xl $ml 0.0"
  33. done
  34. FULL_PROGRAM="$FULL_PROGRAM -t 0.0 180.0 721"
  35. $FULL_PROGRAM