Error with symbolic integral: Input arguments must be convertible to floating-point numbers
6 次查看(过去 30 天)
显示 更早的评论
I am trying to code the following symbolic integral:
FY(y) = beta_2^alpha_2/(gamma(alpha_1)*gamma(alpha_2))*int(t^(alpha_2-1)*exp(-beta_2*t)*(gamma(alpha_1)-igamma(alpha_1,beta_1*(t+y))),t,max(0,-y),Inf)
I get an error saying:
Error using symengine
Input arguments must be convertible to floating-point numbers.
Error in sym/privBinaryOp (line 1013)
Csym = mupadmex(op,args{1}.s, args{2}.s, varargin{:});
Error in sym/max (line 73)
C = privBinaryOp(X, Y, 'symobj::zipWithImplicitExpansion', 'symobj::maxComplex');
I have narrowed the issue down to the lower limit of integration i.e.
max(0,-y)
How do I fix this?
0 个评论
采纳的回答
Nicolas Schmit
2018-1-25
All arguments of the max() function must be convertible to floating point (numeric) numbers. You cannot use max() with purely symbolic variables. Instead, you can use the piecewise() function.
This will not work
syms x a b;
int(x*log(1 + x), max(0, -a), b)
But this will work
syms x a b;
int(x*log(1 + x), piecewise(-a > 0, -a, 0), b)
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Assumptions 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!