help with hypergeom() bug
显示 更早的评论
Hello. Matlab's hypergeom() function seems to have some problems. It has difficulty computing hypergeom(a1, [b1 b2], z) for some {a1, b1, b2, z}; for instance, hypergeom(67/2, [69/2 67], -(15^2)) and hypergeom(16.5, [17.5 1530], -12500). I've tried using a symbolic taylor expansion (which involves using the built-in pochhammer function), but this doesn't always solve the problem. If it ever does give a result, the result is not always accurate; for example a=6.5, b=[13 7.5 ], z=-10000. Please help. Thanks. Below is my code
function F_12 = hypergeom1F2(a,b1,b2,z)
syms k
F_12=symsum((z^k)/sym('k!')*(pochhammer(a,k)/pochhammer(b1,k)/pochhammer(b2,k)), k, 0, Inf);
2 个评论
Walter Roberson
2015-5-26
That is an appropriate symbolic formula for hypergeom([a],[b1,b2],z). Keep in mind though that symsum is going to recognize it as that and is going to convert it to a hypergeom() call, so if the hypergeom() call itself is getting the wrong answer, the symsum will get the wrong answer.
I do not have the MATLAB Symbolic Toolbox to test with. What results is it giving for the hypergeom calls?
Walter Roberson
2015-5-26
回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Code Performance 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!