How to calculate double integral?
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Hexe
el 16 de Dic. de 2022
Comentada: Hexe
el 16 de Dic. de 2022
Hi! I have a problem with solution of double integral. The syms solves too long and it cannot be used.But in another way I have problem.
I have an integral fun2 on z and it has x which is a variable in the integral fun0. How can I set a variable x to first calculate the integral f2 over z, and then integral f3 over x? (Of course, when I set x=some number I obtain a curve or a set of curves if x=0:0.1:1 and make for j = 1:length(x), but I doubt about this result, because the behavior of curves is not correct).
clear all, close all
n=1;
t=1;
r=1;
s=0:0.2:10;
for i = 1:length(s)
k=s(i);
fun2=@(z)(z.*exp(2.*n.*t.*z.^2).*(besselj(0,(k.*z.*x)))./sqrt(1-z.^2));
f2(i,:)=integral(fun2,0,1);
fun0=@(x)(((((x.^2.*exp(-2.*t.*x.^2)./(x.^2+1/(r.^2)).^2)))).*f2(i));
f3(i,:)=integral(fun0,0,inf);
end
Cor=8/(r*(pi)^(3/2))*sqrt(2*n*t)*exp(-2*n*t)/(erf(sqrt(2*n*t))*((1+4*t/r^2)*exp(2*t/r^2)*erfc(sqrt(2*t/r^2))-2*sqrt(2*t)/(r*sqrt(pi)))).*f3;
plot(s,Cor,'b-');
0 comentarios
Respuesta aceptada
Torsten
el 16 de Dic. de 2022
Editada: Torsten
el 16 de Dic. de 2022
n = 1 ;
t = 1;
r = 1;
s = 0:0.2:10;
fun = @(x,z,k) x.^2.*exp(-2.*t.*x.^2)./(x.^2+1/r^2).^2 .* z.*exp(2*n*t.*z.^2).*besselj(0,k.*z.*x)./sqrt(1-z.^2);
f3 = arrayfun(@(k)integral2(@(x,z)fun(x,z,k),0,Inf,0,1),s)
Cor = 8/(r*(pi)^(3/2))*sqrt(2*n*t)*exp(-2*n*t)/(erf(sqrt(2*n*t))*((1+4*t/r^2)*exp(2*t/r^2)*erfc(sqrt(2*t/r^2))-2*sqrt(2*t)/(r*sqrt(pi))))*f3
plot(s,Cor,'b-')
grid on
Más respuestas (0)
Ver también
Categorías
Más información sobre Thermodynamics & Statistical Physics en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!