integration of (1/x-x)^alpha
Show older comments
Hi,
here is my code
function y = f(r, alpha)
F = @(x) (1./x-x).^alpha;
y = integral(F,0,r);
end
Then if i type
f(1/2,0.2)
i get
ans =
0.707008459146274
but the problems start when alpha gets closer to 1, for example:
f(1/2, 0.8)
Warning: Infinite or Not-a-Number value
encountered.
> In funfun\private\integralCalc>iterateScalarValued at 349
In funfun\private\integralCalc>vadapt at 132
In funfun\private\integralCalc at 75
In integral at 88
In f at 3
ans =
Inf
How can I compute this integral? Thank you for reading
Accepted Answer
More Answers (1)
Sean de Wolski
on 11 Jun 2014
0 votes
1./1-1 yields a 0 and then 0 raised to any negative power is inf. What do you expect at 1?
Categories
Find more on Programming in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!