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 Center および File ExchangeAssumptions についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by