Error with symbolic integral: Input arguments must be convertible to floating-point numbers

조회 수: 18 (최근 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?

채택된 답변

Nicolas Schmit
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개)

카테고리

Help CenterFile Exchange에서 Assumptions에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by