%%%%%% Velocidades de onda y grupo, grafico en funcion del tiempo %% Relación de dispersión lineal clear all %defino variables % Relación de dispersión: w = v * k v = 0.1; k1 = 10; %número de onda k2 = 11; %número de onda %km = ((k1+k2)/2); %número de onda medio Dk = ((-k1+k2)/2); %delta número de onda w1 = v*k1; %frecuencia angular w2 = v*k2; %frecuencia angular vf = (w2+w1)/(k2+k1); %velocidad de fase vg = (w2-w1)/(k2-k1); %velocidad de grupo %defino las funciones de onda 1, onda 2 y total fi1=@(x,t) cos(k1.*x-w1.*t); fi2=@(x,t) cos(k2.*x-w2.*t); fi=@(x,t) fi1(x,t)+fi2(x,t); X=0:.01:10; figure(1);clf %grafico para cada tiempo for t=0:.1:50 plot(X,fi(X,t)) ylim([-2 2]) hold on plot(vf*t,fi(vf*t,t),'r.','MarkerSize',20) plot(vg*t+pi/2/Dk,fi(vg*t+pi/2/Dk,t),'b.','MarkerSize',20) hold off title('Relación de dispersión lineal') text(min(xlim)+.1*range(xlim),1,sprintf('k1=%0.2f, w1=%0.2f\nk2=%0.2f, w2=%0.2f',k1,w1,k2,w2)) text(max(xlim)-.2*range(xlim),1,sprintf('vf=%0.2f\nvg=%0.2f',vf,vg)) line([0 0],xlim,'linestyle',':','color','k') drawnow % pause(0.01) end %% Relación de dispersión no lineal Klein Gordon clear all %defino variables %w = sqrt(v^2*k^2+w0^2) v = 0.5; w0 = 2; k1 = 5; %número de onda k2 = 5.5; %número de onda Dk = ((-k1+k2)/2); %delta número de onda w1 = sqrt(v^2*k1^2+w0^2); %frecuencia angular w2 = sqrt(v^2*k2^2+w0^2); %frecuencia angular vf = (w2+w1)/(k2+k1); %velocidad de fase vg = (w2-w1)/(k2-k1); %velocidad de grupo %defino las funciones de onda 1, onda 2 y total fi1=@(x,t) cos(k1.*x-w1.*t); fi2=@(x,t) cos(k2.*x-w2.*t); fi=@(x,t) fi1(x,t)+fi2(x,t); X=0:.1:40; figure(1);clf %grafico para cada tiempo for t=0:.1:50 plot(X,fi(X,t)) ylim([-2 2]) hold on plot(vf*t,fi(vf*t,t),'r.','MarkerSize',20) plot(vg*t+pi/2/Dk,fi(vg*t+pi/2/Dk,t),'b.','MarkerSize',20) hold off title('Relación de dispersión no lineal') text(min(xlim)+.1*range(xlim),1,sprintf('k1=%0.2f, w1=%0.2f\nk2=%0.2f, w2=%0.2f',k1,w1,k2,w2)) text(max(xlim)-.2*range(xlim),1,sprintf('vf=%0.2f\nvg=%0.2f',vf,vg)) line([0 0],xlim,'linestyle',':','color','k') drawnow % pause(0.01) end %% Relación de dispersión no lineal Schroedinger clear all %defino variables %w = const*k^2 const=1; w0 = 2; k1 = 5; %número de onda k2 = 5.5; %número de onda Dk = ((-k1+k2)/2); %delta número de onda w1 = const*k1^2; %frecuencia angular w2 = const*k2^2; %frecuencia angular vf = (w2+w1)/(k2+k1); %velocidad de fase vg = (w2-w1)/(k2-k1); %velocidad de grupo %defino las funciones de onda 1, onda 2 y total fi1=@(x,t) cos(k1.*x-w1.*t); fi2=@(x,t) cos(k2.*x-w2.*t); fi=@(x,t) fi1(x,t)+fi2(x,t); X=0:.1:40; figure(1);clf %grafico para cada tiempo for t=0:.01:3 plot(X,fi(X,t)) ylim([-2 2]) hold on plot(vf*t+pi/Dk,fi(vf*t+pi/Dk,t),'r.','MarkerSize',20) plot(vg*t+pi/2/Dk,fi(vg*t+pi/2/Dk,t),'b.','MarkerSize',20) hold off title('Relación de dispersión no lineal') text(min(xlim)+.1*range(xlim),1,sprintf('k1=%0.2f, w1=%0.2f\nk2=%0.2f, w2=%0.2f',k1,w1,k2,w2)) text(max(xlim)-.2*range(xlim),1,sprintf('vf=%0.2f\nvg=%0.2f',vf,vg)) line([0 0],xlim,'linestyle',':','color','k') drawnow % pause(0.01) end