bessel.m hold on, for n=0; f=@(x) besselj(n,x); fplot(f,[0,20]); end
raices.m function r=raices(f,x) y=f(x); indices=find(y(1:end-1).*y(2:end)<0); r=zeros(1,length(indices)); for k=1:length(indices) r(k)=fzero(f,[x(indices(k)),x(indices(k)+1)]); end end
ejercicio_mem_circular.m %titulo clear,clc R=1; c=1; x=[0:0.1:1000]; f=@(x)besselj(0,x); alfa=raices(f,x); a=zeros(1,length(alfa)); r=[0:0.05:R]; for i=1:length(alfa); f=@(r)r.^(1-r.^2).*besselj(o,alfa(i)*r/R); a(i)=2*integral(f,0,R)/(R^2*besselj(1,alfa(i)))^2; end for t=0:0.1:1; u=0; for i=1:length(alfa); lambda=c*alfa(i)/R; u=u+a(i)*cos(lambda*t)*besselj(0,alfa(i)*r/R); end hold on; plot(r,u); end