使用mupadmex时出错,符号/符号错误(求定积分) [英] Error using mupadmex, Error in sym/symsum (Evaluate a definite integral)
本文介绍了使用mupadmex时出错,符号/符号错误(求定积分)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试使用以下代码评估定积分:
I am trying to evaluate a definite integral using the following code :
m=4;
t=4;
n=5;
P=10;
reset(symengine)
syms x;
syms k;
mean=int(log(1+P*x/t)*symsum( factorial(k)*x^(n-m)*exp(-x)/factorial(k+n-m)*feval(symengine,'laguerreL',n-m,k,x)*feval(symengine,'laguerreL',n-m,k,x),k,[0,m-1]) ,x,0,inf)
但是它给出了以下错误:
But it gives the following error:
Error using mupadmex
Error in MuPAD command: The number of arguments is incorrect. [has]
Evaluating: sum
Error in sym/symsum (line 114)
rSym = mupadmex('symobj::map',fsym.s,'symobj::symsum',x.s,a.s,b.s);
Error in Untitled2 (line 32)
mean=int(log(1+P*x/t)*symsum( factorial(k)*x^(n-m)*exp(-x)/factorial(k+n-m)*feval(symengine,'laguerreL',n-m,k,x)*feval(symengine,'laguerreL',n-m,k,x),k,[0,m-1]) ,x,0,inf)
但是,当我评估不带某些功能的积分时:
However, when I evaluate the integral without some functions:
mean=int(log(1+P*x/t)*symsum( feval(symengine,'laguerreL',n-m,k,x)*feval(symengine,'laguerreL',n-m,k,x),k,[0,m-1]) ,x,0,inf)
我得到的答案是Inf
.有什么主意吗?
I get an answer which is Inf
. Any idea?
推荐答案
我找到了解决方案.它包括使用gamma(k + n-m + 1)来计算(k + n-m)!,因为执行符号变量的阶乘时会出现错误.
I found the solution. it consists in using gamma(k+n-m+1) to compute (k+n-m)!, since there is a bug when performing the factorial of a symbolic variables.
这篇关于使用mupadmex时出错,符号/符号错误(求定积分)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文