필터 지우기
필터 지우기

symbolic integration with undefined variable

조회 수: 2 (최근 30일)
james hopper
james hopper 2014년 9월 17일
댓글: james hopper 2014년 9월 17일
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)])

채택된 답변

David Sanchez
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 CenterFile Exchange에서 Number Theory에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by