How to solve an integral with symbolic values as borders in another integral?

4 ビュー (過去 30 日間)
Jeroen Vlak
Jeroen Vlak 2018 年 6 月 14 日
コメント済み: Jeroen Vlak 2018 年 6 月 14 日
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?

採用された回答

Torsten
Torsten 2018 年 6 月 14 日
編集済み: Torsten 2018 年 6 月 14 日
Use integral2:
scale = 0.00095;
shape = 8.907;
lambda = 0.00174;
func1 = @(x) (wblpdf(k_1t-tr+x,1/scale,shape))/(1-wblcdf(k_1t-tr,1/scale,shape));
func2 = @(x) expcdf(56-x,1/lambda);
func3 = @(x,y) 1-wblcdf(56-x-y,1/scale,shape);
fun = @(x,y)func1(x).*func2(x).*func3(x,y);
ymax = @(x) 56 - x;
q = integral2(fun,0,28,0,ymax)
Best wishes
Torsten.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeAssumptions についてさらに検索

製品


リリース

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by