Animations

Réflexion d'une onde progressive plane

Animation flash


onde.mp
%@AUTEUR: Maxime Chupin
%@DATE: 11 mars 2008
 
verbatimtex
%&latex
\documentclass{article}
\usepackage[latin1]{inputenc}
\usepackage[garamond]{mathdesign}
\usepackage[frenchb]{babel}
\begin{document}
etex
 
u:=2cm;
w:=4;
k:=2;
Pi := 3.14159265;
%les cos et sin en radians
vardef sin(expr a) = sind(a/Pi*180) enddef;
vardef cos(expr a) = cosd(a/Pi*180) enddef;
% === Pointer les points avec une couleur cerclée de noir (Jean-Michel Sarlat)
def pointe(expr p,c) =
      fill fullcircle scaled 4 shifted p withcolor black;
      fill fullcircle scaled 3 shifted p withcolor c;
enddef;
 
%Macro pour hachurer (Christophe Poulain)
%===================================================================================
vardef hachurage(expr chemin, angle, ecart, trace)suffix couleur =
  save $;
  picture $;
  path support;
  support=(((-37cm,0))--((37cm,0))) rotated angle;
  if trace=1:
    drawoptions(dashed evenly);
  elseif trace=2:
    drawoptions(dashed dashpattern(on12bp off6bp on3bp off6bp));
  fi;
  $ = image(
    for j=-200 upto 200:
     if ((support shifted (ecart*j*(1,0))) intersectiontimes chemin)<>(-1,-1):
       draw support shifted (ecart*j*(1,0)) 
           withcolor if str couleur="":(0,0,0) else:couleur fi;
     fi
    endfor;
  );
  clip $ to chemin;
  drawoptions();
  $
enddef;
%===================================================================================
 
for t:=0 upto (12*22):
 beginfig(t);
  drawarrow (-0.5u,0)--(9u,0);
  drawarrow (0,-2u)--(0,2u);
  path ondei, onder, ondesta ,mur;
   for l:=0 upto 400:
    if l=0:
     ondei:=(l/50*u, cos(w*t/50-l/50*k)*u);
     onder:=(l/50*u, -cos(w*t/50+l/50*k)*u);
     ondesta:=(l/50*u,(cos(w*t/50-l/50*k)-cos(w*t/50+l/50*k))*u);
    else :
     ondei:=ondei--(l/50*u, cos(w*t/50-l/50*k)*u);
     onder:=onder--(l/50*u, -cos(w*t/50+l/50*k)*u);
     ondesta:=ondesta--(l/50*u,(cos(w*t/50-l/50*k)-cos(w*t/50+l/50*k))*u);
    fi;
   endfor;
  draw ondei withpen pencircle scaled 0.8pt withcolor blue;
  draw onder withpen pencircle scaled 0.8pt withcolor green;
  draw ondesta withpen pencircle scaled 1pt withcolor red;
  for i:=0 upto 5:
    pointe((2*i*Pi/4*u,0), white);
  endfor;
  mur:= (8u,2u)--(8.5u,2u)--(8.5u,-2u)--(8u,-2u)--cycle;
  draw hachurage(mur,45,2mm,0)red;
  draw mur;
  label.bot(btex $x$ etex, (8.8u,0));
  label.rt(btex $y$ etex, (0,1.7u));
  label.top(btex \fbox{Réflexion d'une onde progressive plane monochromatique sur un conducteur métallique} etex, (4u,2u)); 
  label.rt(btex Onde incidente : $\vec{E}_{i}=E_{0}\cos(\omega{}t-kx)\vec{u}_{y}$ etex, (3u, -2.2u));
  draw (2.7u,-2.2u)--(2.9u,-2.2u) withpen pencircle scaled 0.8pt withcolor blue;
  label.rt(btex Onde réfléchie : $\vec{E}_{r}=-E_{0}\cos(\omega{}t+kx)\vec{u}_{y}$ etex, (3u, -2.5u));
  draw (2.7u,-2.5u)--(2.9u,-2.5u) withpen pencircle scaled 0.8pt withcolor green;
  label.rt(btex Onde \emph{stationnaire} : $\vec{E}_{s}=\vec{E}_{i}+\vec{E}_{r}=2E_{0}\sin(kx)\sin(\omega{}t)$ etex, (3u, -2.8u));
  draw (2.7u,-2.8u)--(2.9u,-2.8u) withpen pencircle scaled 1pt withcolor red;
  label.rt(btex \og{}N\oe{}ux\fg{} de vibration etex, (3u,-3.1u));
  pointe((2.8u,-3.1u),white);
 endfig;
endfor;
end.