Error while integrating bessel functions
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Alwar Samy Ramasamy
el 14 de Sept. de 2021
Comentada: Star Strider
el 14 de Sept. de 2021
Hi,
I am trying to solve the integral equation with Bessel functions as shown in the attached image.
I get a error "Operator '+' is not supported for operands of type 'function_handle'".
Can anyone specify how to rectify the error.
The code is as follows,
gammalv = 72e-3;
gammasv = 0.06;
h = 50e-6;
nu = 0.5;
E = 3000;
R = 0.2e-3;
r = 0.0002;
a = @(s) (5 - 12*nu + 8*nu.^2 + 2*s.^2*h.^2 + (3 - 4*nu)*cosh(2*s.*h))./((3 - 4*nu)*sinh(2*s.*h) - 2*s.*h);
b = @(s) (2*(1 - nu.^2).*s.*gammasv)./E;
Q = @(s) 2*(1 - (nu.^2))./(s.*E).*(1./(a + b));
f = @(s) s.*(R.*besselj(0,s.*R) - ((2*besselj(1,s.*R))./s)).*Q(s).*besselj(0,s.*r);
ans = integral(f,0,inf);
Thanks,
Alwar
0 comentarios
Respuesta aceptada
Star Strider
el 14 de Sept. de 2021
The problem is:
Q = @(s) 2*(1 - (nu.^2))./(s.*E).*(1./(a(s) + b(s)));
↑ ↑ ← HERE
These both need to be evaluated with their arguments (that I supplied here).
gammalv = 72e-3;
gammasv = 0.06;
h = 50e-6;
nu = 0.5;
E = 3000;
R = 0.2e-3;
r = 0.0002;
a = @(s) (5 - 12*nu + 8*nu.^2 + 2*s.^2*h.^2 + (3 - 4*nu)*cosh(2*s.*h))./((3 - 4*nu)*sinh(2*s.*h) - 2*s.*h);
b = @(s) (2*(1 - nu.^2).*s.*gammasv)./E;
Q = @(s) 2*(1 - (nu.^2))./(s.*E).*(1./(a(s) + b(s)));
f = @(s) s.*(R.*besselj(0,s.*R) - ((2*besselj(1,s.*R))./s)).*Q(s).*besselj(0,s.*r);
ans = integral(f,0,inf);
There are still problems with infinite results. The second term of ‘f’ (with ‘s’ in the numerator and denominator) is likely the cause. I leave that for you to resolve.
.
2 comentarios
Star Strider
el 14 de Sept. de 2021
My pleasure!
The result returned is NaN not Inf since the result will be of the 0/0 calculation, while an Inf result would be the result of a x/0 calculation with ‘x’ being any non-zero value.
If my Answer helped you solve your problem, please Accept it!
.
Más respuestas (0)
Ver también
Categorías
Más información sobre Bessel functions 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!