Regularized hypergeometric function 1F2 within matlab?
8 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Wojciech Kalinowski
el 25 de Jul. de 2020
Editada: David Goodmanson
el 26 de Jul. de 2020
Hi, I'm trying to find the special function to use within my code:
function [result] = sin_derivatve(x,n)
if (rem(n,1) == 0) && (n ~= 0)
result = sin(x+n*pi()/2);
else
part1 = 2.^(n-1).*sqrt(pi()).*x.^(1-n);
part2 = hypergeom(1,[(1-n./2),(3/2-n./2)],-x.^2./4);
part3 = gamma([(1-n/2),(3/2 - n/2)]);
result = part1.*(part2./part3);
end
end
However, the hypergeom function above (part2) is 2F1 which is regulized by the gamma function (part3). Which means the matrix dimentions do not aline.
Is there a method to create a 1F2 Regularized hypergeometric function within matlab? Or another way to calculate the fractional derivative of sin(x)?
Thanks in advanced.
Respuesta aceptada
David Goodmanson
el 26 de Jul. de 2020
Editada: David Goodmanson
el 26 de Jul. de 2020
Hi Wozciech,
if you add a prod function,
part3 = prod(gamma([(1-n/2),(3/2 - n/2)]))
then you're good to go. Or, you could use the gamma duplication formula to replace your current part1/part3
part1/part3 = x.^(1-n) * 2.^(n-1).*sqrt(pi) / (gamma(1-n/2)*gamma(3/2 - n/2))
with
part1/part3 = x.^(1-n) / gamma(2-n)
0 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Calculus en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!