Advertisement
SubhamRath

EMwaveProp

Nov 4th, 2020
266
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 0.83 KB | None | 0 0
  1. clear all
  2. clc;
  3. close all
  4. k=2*pi; %spatial propgation constant
  5. w=10; %angular frqency
  6. Eym=20*sqrt(2); %electric field amplitude
  7. Hzm=15*sqrt(2); %magnetic field amplitude
  8. t=0:0.001:10;
  9. x=0:0.0005:5;
  10. Zo1=zeros(size(x));
  11.  
  12. Ey=Eym*cos(w*t-k*x);
  13. Hz=Hzm*cos(w*t-k*x);
  14.  
  15. Eyw=Eym*cos(w*t-k*x).*exp(-0.5*x);
  16. Hzw=Hzm*cos(w*t-k*x).*exp(-0.5*x);
  17.  
  18. subplot(1,2,1)
  19. figure(1)
  20. plot3(x,Ey,Zo1,'b');
  21. hold on;
  22. plot3(x,Zo1,Hz,'r');
  23. grid on;
  24. axis([0,5,min(Ey(:)),max(Ey(:)),min(Hz(:)),max(Hz(:))])
  25. xlabel('x axis');ylabel('electric field');zlabel('magnetic filed');
  26. set(gcf,'color','w');
  27.  
  28. subplot(1,2,2)
  29. figure(1)
  30. plot3(x,Eyw,Zo1,'b');
  31. hold on;
  32. plot3(x,Zo1,Hzw,'r');
  33. grid on;
  34. axis([0,5,min(Eyw(:)),max(Eyw(:)),min(Hzw(:)),max(Hzw(:))])
  35. xlabel('x axis');ylabel('electric field');zlabel('magnetic filed');
  36. set(gcf,'color','w');
  37.        
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement