integration of (1/x-x)^alpha
Mostrar comentarios más antiguos
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
Respuesta aceptada
Más respuestas (1)
Sean de Wolski
el 11 de Jun. de 2014
0 votos
1./1-1 yields a 0 and then 0 raised to any negative power is inf. What do you expect at 1?
1 comentario
Camille
el 11 de Jun. de 2014
Categorías
Más información sobre Calculus en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!