test03.sh 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #!/bin/bash
  2. # This test explores the applicability limits of scattnlay
  3. # for Kai & Massoli's model:
  4. # L. Kai and P. Massoli, Applied Optics 33 (1994) 501-511.
  5. #
  6. # The model consists in a multilayered sphere with a radial
  7. # profile of the refractive index ml = nl + i*kl given by:
  8. # nl = n1 + 0.5(nL - n1)(1 - cos(t*Theta)) and kl = 0.0,
  9. # where t = (l - 1)/(L - 1), n1 = 1.01nL, and nL = 1.33.
  10. # The size parameter is xl = x1 + t(xL - x1), where
  11. # l = 1,2,...,L, x1 = 0.001xL and L is the total number of
  12. # layers.
  13. #
  14. # WARNING: This test can take a LOT of time to completely run.
  15. PROGRAM='../../../scattnlay -l'
  16. numL=200
  17. maxL=1000
  18. num_xL=800
  19. max_xL=4000
  20. nL=1.33
  21. n1=$(echo "scale=5; 1.01*$nL" | bc -l)
  22. pi=$(echo "scale=10; 4*a(1)" | bc -l)
  23. for i in `seq 1 $numL`; # Total number of layers
  24. do
  25. L=$(echo "scale=0; $i*$maxL/($numL)" | bc -l)
  26. for j in `seq 1 $num_xL`; # Total number of size factors
  27. do
  28. xL=$(echo "scale=2; $j*$max_xL/($num_xL)" | bc -l)
  29. x1=$(echo "scale=5; 0.001*$xL" | bc -l)
  30. FULL_PROGRAM="$PROGRAM $L"
  31. for l in `seq 1 $L`;
  32. do
  33. t=$(echo "scale=5; ($l-1)/($L-1)" | bc -l)
  34. n=$(echo "scale=2; $n1+0.5*($nL-$n1)*(1-c($t*$pi))" | bc -l)
  35. xl=$(echo "scale=2; $x1+$t*($xL-$x1)" | bc -l)
  36. FULL_PROGRAM="$FULL_PROGRAM $xl $n 0.0"
  37. done
  38. FULL_PROGRAM="$FULL_PROGRAM -c L=$L,xL=$xL"
  39. $FULL_PROGRAM
  40. done
  41. done