symbolic integration with undefined variable
조회 수: 2 (최근 30일)
이전 댓글 표시
i created the following script code
syms r,x,r,z; a=int((r^2*x*z)/(r^2+z^2)^(3/2),0,2*pi) b=int(a, r, 0, r)
because i can't do definite integrals of multidimensional problems. But the answer for b is not making sense to me as i keep getting this piecewise answer that does not make sense. It appears that its trying to evaluate the value of z over which answer is valid. how can i force it to know that z is always a positive value > 0 so i can avoid this?
here is what i get out, note a is correct, but b is confused.
a = (2*pi^2*r^2*z)/(r^2 + z^2)^(3/2)
b = piecewise([z in {-1, 1}, (2*pi^2*r^3*z*hypergeom([3/2, 3/2], [5/2], -r^2))/3], [not z in {-1, 1}, int((2*pi^2*r^2*z)/(r^2 + z^2)^(3/2), r, 0, r)])
댓글 수: 0
채택된 답변
David Sanchez
2014년 9월 17일
Point out that z>0 like this:
>> assume(z>0);
>> b=int(a, r, 0, r)
b =
-2*pi^2*z*(log(z) - log(r + (r^2 + z^2)^(1/2)) + r/(r^2 + z^2)^(1/2))
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Number Theory에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!