How can i find solution for un integral of bessel functions

Dear every one, i would like to find a solution for my problem in the following. Please give me some advise to do this work. Thank you in advance.
format long
% define input values
t0 = 13;
q = 700;
lamda = 1;
rp = 0.2;
l = 12;
alpha = 0.6E-6;
t = 0;
t = t+600;
r = 0.5;
rho1 = 2.7;
rho2 = 1.7;
rho = rho1/rho2;
c1 = 0.8E-6;
c2 = 0.6E-6;
c = c1/c2;
% Define of functions
phi = rho*c*u*besselj(0,u*0.2)+2*besselj(1,u*0.2);
psi = rho*c*u*bessely(0,u*0.2)+2*bessely(1,u*0.2);
func = (exp(-alpha*u^2*t)-1)*(bessely(0,u*r)*phi - besselj(0,u*r)*psi)/(phi^2+psi^2)/u^2;
A = 2*q/lamda/pi^2/rp/l;
t2 = t0 + A*int(func,0,100)
plot(t,t2);
And the answer of matlab:
??? Undefined function or method 'int' for input arguments of type
'double'.
Error in ==> modelcalculation at 37
t2 = t0 + A*int(func,0,100)

 Accepted Answer

Make "func" a function handle of the variable u, not a numerical value.
And use "integral" instead of "int".
See the documentation on how to use "integral".
Best wishes
Torsten.

1 Comment

Many thanks to Torsten, i have been re-define variables and functions as you said, it running good now.

Sign in to comment.

More Answers (1)

int() is for symbolic expressions. You would use it in combination with a symbolic variable declared using "syms" or "sym". In particular, before you use "u" you would declare
syms u
and not assign a numeric value to u. (You must be have given u a numeric value somewhere along the line or your code would not have reached that point.)

Asked:

on 18 Nov 2015

Commented:

on 19 Nov 2015

Community Treasure Hunt

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

Start Hunting!