I'm trying to solve equation f for r, as below:
syms rho
C0 = 0.5;
a_bar = sqrt(-log((1-C0)/(1+C0)));
l = 0.77;
f = @(r) exp(-r^2)*int(rho*exp(-rho^2)*besseli(0,2*r*rho),rho,0,a_bar)-(l-1)*int(rho*exp(-rho^2),rho,0,a_bar);
r1 = fzero(f,1);
However the symbolic output from the first integral (containing besseli) is giving errors in fzero. The problem seems to be that besseli contains rho (when I remove this instance of rho I don't get any errors).
I've tried playing with subs and eval, and solving the entire thing as symbolic, but it's really been trial and error to be honest. I'm sure there's something simple that I'm missing - any help would be amazing!
Cheers,
Alan
fzeroworks with symbolic input. You can define f` asf=@(r) double( exp(-r^2)...);, thenfzerowill work. I'm not surefhas any roots though... (unless l is greater than or equal to 1?) - Davidexpis positive,besseliis positive, so since both terms are positive, the coefficient of the second term,1-lmust be negative, which meanslmust be larger than one. (Whenl=0, the solutions are at r=infinity,-infinity) - David