Symbolic integration and integration of function handle
이전 댓글 표시
I am trying to accomplish one of the two codes. The second one can be executed, but it has errors. The other, he can't solve my problem. Could you help me solve my problem?
% Datas
B = 1.31;
a = 0.005;
L = 0.010;
sig = 5.97*(10^7);
vv = 0.01;
Boo = B.*a./(4*pi);
syms sup(z1,y,zz) deno(r,z1,y,zz) Bd(r,z1,y,zz)
sup(z1,y,zz) = (z1 - zz).*cos(y);
deno(r,z1,y,zz) = (r.^2 + a.^2 + (z1 - zz).^2 - 2.*a.*r.*cos(y)).^(3/2);
Bd(r,z1,y,zz) = sup(z1,y,zz)./deno(r,z1,y,zz);
syms int1(r,z1,zz) int2(r,z1) Br(r,z1) J(r,z1)
int1(r,z1) = int(int(Bd(r,z1,y,zz),y,[0 2*pi]),zz,[-L/2 L/2]);
Brr(r,z1) = Boo.*int1(r,z1);
J(r,z1) = sig.*vv.*Brr(r,z1);
fcontour(J,[0.006 0.0225 0 0.007])
B = 1.31;
a = 0.005;
L = 0.010;
sig = 5.97*(10^7);
vv = 0.01;
Boo = B.*a./(4*pi);
sup = @(z1,y,zz) (z1 - zz).*cos(y);
deno = @(r,z1,y,zz)(r.^2 + a.^2 + (z1 - zz).^2 - 2.*a.*r.*cos(y)).^(3/2);
Bd = @(r,z1,y,zz) sup(z1,y,zz)./deno(r,z1,y,zz);
int1 = @(r,z1) integral2(@(y,zz) Bd(r,z1,y,zz),0,2*pi,-L/2,L/2);
Brr = @(r,z1) Boo.*int1(r,z1);
J = @(r,z1) sig.*vv.*Brr(r,z1);
fcontour(J,[0.006 0.0225 0 0.007])
Warning: Function behaves unexpectedly on array inputs. To improve performance, properly
vectorize your function to return an output with the same size and shape as the input
arguments.
> In matlab.graphics.function.FunctionContour>getImplicitFunction
In matlab.graphics.function.FunctionContour/updateFunction
In matlab.graphics.function.FunctionContour/set.Function
In matlab.graphics.function.FunctionContour
In fcontour>singleFContour (line 154)
In fcontour>@(f)singleFContour(cax,f,extraOpts,args) (line 134)
In fcontour>vectorizeFContour (line 134)
In fcontour (line 113)
In CurrentDensisty (line 22)
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Data Import and Analysis에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!