In my problem I have to evaluate the integral of a function with respect to x. However within that function is an integral with respect to variable h with borders from 0 to 56-x. To model this I used the following code.
if true % code
end scale = 0.00095 shape = 8.907 lambda = 0.00174 syms x h func1 = @(x) (wblpdf(x,1/scale,shape))/(1-wblcdf(0,1/scale,shape)); func2 = @(x) expcdf(56-x,1/lambda); f3 = int((1-wblcdf(56-x-h,1/scale,shape)),h,0,56-x); func3 = matlabFunction(f3); func4 = @(x) func1(x).*func2(x).*func3(x); forecast = forecast + integral(func4,0,28);end
If I try this I get the error message: Error using symengine. Unable to prove '56 – x – h < 0' literally. Use 'isAlways' to test the statement mathematically. I know that this has something to do with the variable of the weibullcdf having to be bigger than 0. How do I use isAlways to solve my error?
Best Answer