Solve double integral using 'integral2'

31 次查看(过去 30 天)
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