Guest User

Untitled

a guest
Jul 17th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.86 KB | None | 0 0
  1. %% Mahdiar Sadeghi
  2. %% Northeastern University
  3. %% December 6th 2017
  4. %
  5. % Inputs : dielectric permittivity (eps), dielectric thickness(d) and
  6. % array distance from metal plate (H)
  7. %
  8. % notes:
  9. % -all distance values should be in cm
  10. % -to have lossless dielectric, use loss=0
  11. % -for bare metal case, use eps=1 and d=0
  12. %
  13. % Outputs : E response singal as a function z (distance from the detector)
  14.  
  15. function [E, z] = VSModel(loss, eps, d, H)
  16.  
  17. %% Global Variables
  18. c = 3e10; f=24.16e9;
  19. n = sqrt(eps);
  20. k = 2*pi*f/c;
  21. gam = (1-n)/(1+n);
  22. n1 = -1.1*n;
  23.  
  24. loss1 = exp(-k*2*d*n*loss);
  25. loss2 = exp(-k*4*d*n*loss);
  26. loss3 = exp(-k*6*d*n*loss);
  27. loss4 = exp(-k*8*d*n*loss);
  28.  
  29. %% half width of the panel
  30. hwidth = 50;
  31.  
  32. x = -hwidth:.25:hwidth;
  33. [~,xsize] = size(x);
  34.  
  35. %% depth axis resolution per cm
  36. res = 20;
  37. Lowerbound = res*(-20);
  38. Upperbound = res*(+20);
  39.  
  40. z = (Lowerbound:Upperbound)/res;
  41. E = zeros(size(z));
  42.  
  43. for count=Lowerbound:Upperbound
  44. del = count/20;
  45.  
  46. comp1 = gam* sum(exp(-1i*k*(-sqrt(x.^2 + (H-del)^2 * ones(1,xsize))+ sqrt(x.^2 + (-2*d+H+del)^2 * ones(1,xsize)) )));
  47. comp2 = loss1*(-1+gam^2)*sum(exp(-1i*k*(2*d*(n+1/n1)*ones(1,xsize) -sqrt(x.^2 + (H-del)^2 * ones(1,xsize))+ sqrt(x.^2 + (-2*d*(1+1/n1)+H+del)^2 * ones(1,xsize)) )));
  48. comp3 = loss2* gam * (-1+gam^2)*sum(exp(-1i*k*(4*d*(n+(1/n1))*ones(1,xsize) -sqrt(x.^2 + (H-del)^2 * ones(1,xsize))+ sqrt(x.^2 + (-2*d*(1+2/n1)+H+del)^2 * ones(1,xsize)) )));
  49. comp4 = loss3* gam^2 * (-1+gam^2)*sum(exp(-1i*k*(6*d*(n+(1/n1))*ones(1,xsize) -sqrt(x.^2 + (H-del)^2 * ones(1,xsize))+ sqrt(x.^2 + (-2*d*(1+3/n1)+H+del)^2 * ones(1,xsize)) )));
  50. comp5 = loss4* gam^3 * (-1+gam^2)*sum(exp(-1i*k*(8*d*(n+(1/n1))*ones(1,xsize) -sqrt(x.^2 + (H-del)^2 * ones(1,xsize))+ sqrt(x.^2 + (-2*d*(1+4/n1)+H+del)^2 * ones(1,xsize)) )));
  51.  
  52. E (count-Lowerbound+1) = comp1+comp2+comp3+comp4+comp5;
  53. end
  54.  
  55. %% normalize the results
  56. z = H-z;
  57. E = (100/401)*E;
  58. end
Add Comment
Please, Sign In to add comment