integration of (1/x-x)^alpha
Ältere Kommentare anzeigen
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
Akzeptierte Antwort
Weitere Antworten (1)
Sean de Wolski
am 11 Jun. 2014
0 Stimmen
1./1-1 yields a 0 and then 0 raised to any negative power is inf. What do you expect at 1?
1 Kommentar
Camille
am 11 Jun. 2014
Kategorien
Mehr zu Calculus finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!