Solve double integral using 'integral2'

조회 수: 31 (최근 30일)
John Armitage
John Armitage 2018년 5월 17일
편집: Torsten 2018년 5월 17일
Suppose I have this surface integral:
I use integral2 to solve the double integral but the result has complex number in it
My codes are:
syms x y z
format rat
x=sqrt(1-y.^2-z.^2)
xy=diff(x,y)
xz=diff(x,z)
dS = sqrt(100 + xy.^2 + xz.^2)
fun1 = subs((x+y+z).*dS)
f = matlabFunction(fun1)
Myz = integral2(f,0,10,0,@(y)sqrt(100-y.^2))
And the answer
f =
@(y,z)(y+z+sqrt(-y.^2-z.^2+1.0)).*sqrt(-y.^2./(y.^2+z.^2-1.0)-z.^2./(y.^2+z.^2-1.0)+1.0e2)
Warning: Reached the maximum number of function evaluations (10000). The result fails the global error test.
> In integral2Calc>integral2t (line 129)
In integral2Calc (line 9)
In integral2 (line 106)
In Untitled3 (line 18)
Myz =
139388/21 +97492/19i
What's the problem guys ? Thank you

채택된 답변

Torsten
Torsten 2018년 5월 17일
편집: Torsten 2018년 5월 17일
y = sqrt(100-x^2-z^2) or y = -sqrt(100-x^2-z^2)
->
I = integral_{x=0}^{x=10} integral_{z=0}^{z=sqrt(1-x^2)} (x+sqrt(100-x^2-z^2)+z)*sqrt(1+x^2/(100-x^2-z^2)+z^2/(100-x^2-z^2)) dz dx +
integral_{x=0}^{x=10} integral_{z=0}^{z=sqrt(1-x^2)} (x-sqrt(100-x^2-z^2)+z)*sqrt(1+x^2/(100-x^2-z^2)+z^2/(100-x^2-z^2)) dz dx =
integral_{x=0}^{x=10} integral_{z=0}^{z=sqrt(1-x^2)} 2*(x+z)*10/sqrt(100-x^2-z^2) dz dx
In MATLAB:
I = integral2(@(x,z)2*(x+z)*10./sqrt(100-x.^2-z.^2),0,10,0,@(x)sqrt(100-x.^2))
Best wishes
Torsten.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 MATLAB에 대해 자세히 알아보기

태그

제품


릴리스

R2016a

Community Treasure Hunt

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

Start Hunting!

Translated by