Why Can't int Find a Simple Integral?
조회 수: 8 (최근 30일)
이전 댓글 표시
syms x real
E(x) = 99/50*dirac(x) + rectangularPulse(0, 300, x)/30000
int on first term yields expected result
int(99/50*dirac(x),x,-inf,inf)
int on second term yields expected result
int(rectangularPulse(0, 300, x)/30000,x,-inf,inf)
int on sum fails
int(E(x),x,-inf,inf)
Shouldn't that work?
댓글 수: 0
채택된 답변
Pranav
2023년 6월 27일
I am very glad to let you know that this bug has been fixed in MATLAB R2023b.
Now, this code produces
syms x real
E(x) = 99/50*dirac(x) + rectangularPulse(0, 300, x)/30000
int(99/50*dirac(x),x,-inf,inf)
int(rectangularPulse(0, 300, x)/30000,x,-inf,inf)
int(E(x),x,-inf,inf)
this output
E(x) =
(99*dirac(x))/50 + rectangularPulse(0, 300, x)/30000
ans =
99/50
ans =
1/100
ans =
int((99*dirac(x))/50 + rectangularPulse(0, 300, x)/30000, x, -Inf, Inf)
Cheers
댓글 수: 5
추가 답변 (1개)
VBBV
2023년 2월 26일
Tips
- In contrast to differentiation, symbolic integration is a more complicated task. If int cannot compute an integral of an expression, check for these reasons:
- The antiderivative does not exist in a closed form.
- The antiderivative exists, but int cannot find it.
If int cannot compute a closed form of an integral, it returns an unresolved integral.
Try approximating such integrals by using one of these methods:
- For indefinite integrals, use series expansions. Use this method to approximate an integral around a particular value of the variable.
- For definite integrals, use numeric approximations.
Look into Tips section of page for that reason, Going by tips section, if you consider the numeric approximations
syms x real
E(x) = 99/50*dirac(x) + rectangularPulse(0, 300, x)/30000
int(E(x),x,-4,4) % with a numeric approximation it works
참고 항목
카테고리
Help Center 및 File Exchange에서 Assumptions에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!