.Alternate to using for loop or symsum for the summation ∑(const)^n/(n*n!) ?
조회 수: 2 (최근 30일)
이전 댓글 표시
Dear all,
Is there a more computationally efficient way compared to using for loop or symsum (from Symbolic math toolbox) to compute:
∑(const)^n/(n*n!)
const is some constant value, n is the range of limit varying from 1 to infinity (or some high value like 200 for approximating the sum).
-- Thanks, Ram.
댓글 수: 2
Sean de Wolski
2013년 6월 26일
편집: Sean de Wolski
2013년 6월 26일
Why not symsum? You're going to need it for factorial greater than 170 anyway:
factorial(171)
채택된 답변
Roger Stafford
2013년 6월 26일
Your sum is equal to the integral
int('(exp(x)-1)/x','x',0,const)
so you could do numerical integration of this rather than summing the infinite series. That integrand is actually well-behaved in the vicinity of x = 0, but computing it might give you some problems, so you could substitute a Taylor series approximation very near x = 0.
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Calculus에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!