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

 채택된 답변

Star Strider
Star Strider 2021년 9월 14일
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);
Warning: Inf or NaN value encountered.
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

Alwar Samy Ramasamy
Alwar Samy Ramasamy 2021년 9월 14일
편집: Alwar Samy Ramasamy 2021년 9월 14일
Thanks Star Strider. I will try to figure out the infinite result part.
Star Strider
Star Strider 2021년 9월 14일
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!
.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Bessel functions에 대해 자세히 알아보기

제품

릴리스

R2021a

질문:

2021년 9월 14일

댓글:

2021년 9월 14일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by