Error with symbolic integral: Input arguments must be convertible to floating-point numbers
6 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Aaron J. Hendrickson
el 24 de En. de 2018
Respondida: Nicolas Schmit
el 25 de En. de 2018
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 comentarios
Respuesta aceptada
Nicolas Schmit
el 25 de En. de 2018
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 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Assumptions en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!