Derivative of intergrated bessel function
显示 更早的评论
Hi,
I'm trying to plot a curve determined by the first and second derivatives of an expression defined using besselj. The definitions of my derivatives and my function are below :

I've succeeded in defining the function as follow, using defined scalar for the integral :
Fhertz=@(r) P*l^2/(2*pi*D)*integral(@(m) besselj(0,m.*r/l).*m./(1+m.^4),0,1000)
But now I'm trapped as I can't find a way to calculate the 2 M as defined above, Matlab seems not to accept my function when I try to use the diff function :
Mr1= @(r)-D*(1/r*diff(Fhertz)+nu/r*diff(Fhertz,2))
fplot(Mr1, [0 10*l]);
Undefined function 'diff' for input arguments of type 'function_handle'.
Error in @(r)-D*(1/r*diff(Fhertz)+nu/r*diff(Fhertz,2))
Error in fplot>splitFunctionHandle (line 255) fnAtZero = fn(0);
Error in fplot (line 119) fn{1} = splitFunctionHandle(fn{1});
Thanks in advance for your help
回答(1 个)
Steven Lord
2016-9-21
You can't do math on function handles. You can do math on the values returned by function handles.
s = @sin;
c = @cos;
tNO = @(x) s./c % will not work if you try to evaluate tNO
tYES = @(x) s(x)./c(x) % will work
v = -pi:0.1:pi;
tYES(v)-tan(v) % all elements should be small
See the example "Approximate Derivatives with diff" on the documentation page for diff for how to use it to approximate a function's derivative.
2 个评论
Romain Clouzeau
2016-9-21
Steven Lord
2016-9-21
If you call the diff function with a nonempty vector as input, the output vector has one fewer element than the input. You need to adjust for that.
Alternately, you may find the gradient function useful.
类别
在 帮助中心 和 File Exchange 中查找有关 Bessel functions 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!