Você está na página 1de 2

ANIMACIN CUERDA VIBRANTE.

MATLAB:
%animacin de la solucin de la ecuacion de transporte %U_t+U_X=0 x=-10:0.1:10; t=0:0.05:10000; set(gca,'nextplot','replacechildren'); axis([-10 10 -2 2]); for i=1:length(t) u=(sin((pi*x)/2)*cos((pi*t(i))/2))+(1/2)*((sin((3*pi*x)/2))*cos((3*pi*t(i ))/2))+(1/4)*((sin((5*pi*x)/2))*cos((5*pi*t(i))/2)); plot(x,u); M(i)=getframe; end

GRAFICO:

2 1.5 1 0.5 0 -0.5 -1 -1.5 -2 -10

-8

-6

-4

-2

10

PARA CUALQUIER EJERCICIO clc syms x t m ; %Ingrese la funcion f(x) texto='***** MODELADO CUERDA *****: ';

disp(texto); texto='FUNCION INGRESADA: '; disp(texto); F=input('INGRESE LA FUNCION= ') %F = sin(x) %Ingrese la dimension de la cuerda texto='VALORES CARACTERISTICOS DE LA CUERDA: '; disp(texto); L=input('ingrese el valor de L= ') c=input('ingrese el valor de C= ') n=input('ingrese el valor de n= ')

%Coeficiente para la serie de fourier texto='COEFICIENTE DE LA SERIE DE FOURIER: '; disp(texto); Bn=(2/L)*int(F*sin(n*pi*x/L),x,0,L) pretty(Bn) %Constante arbitraria k=((c*n*pi)/L) %serie de fourier texto='TERMINOS DE LA SERIE DE FOURIER : '; disp(texto); for x = 1:n u=Bn*cos(k*t)*sin(n*pi*x/L) end

Você também pode gostar