How do I compute a line integral of a function over a helix?
조회 수: 3 (최근 30일)
이전 댓글 표시
So I need to find line the integral of
F=<(e^z)*(y^2), 2(e^z)xy, (e^z)x(y^2)> over a helix parametized as
x=2cost
y=2sint
z=t/5
for 0<= t <= 5pi.
I've no clue how to do this. I don't think I quite conceptually understand the requirement either.
Here's an attempt, however:
t=0:0.1:5*pi;
x=2.*cos(t);
y=2.*sin(t);
z=t./5;
myfunction =@(x,y,z) [(exp(z))*(y.^2); 2.*(exp(z)).*x.*y; (exp(z)).*x.*(y.^2)];
integral3(myfunction,-2,2,-2,2,0,pi);
Unfortunately, it did not work
댓글 수: 0
답변 (1개)
CARLOS RIASCOS
2018년 4월 3일
Hello brother, here is a code I did with symbolic mathematics using the mathematical definition of line integral with a vector field F. Postscript: The integral gives 0 LOL.
syms t
%Parametrization of the Curve:
x=2*cos(t); y=2*sin(t); z=t/5;
%Vector field:
F = [exp(z)*(y^2), 2*exp(z)*x*y, exp(z)*x*(y^2)];
%Dot product F*dr:
D = F*[diff(x,t); diff(y,t); diff(z,t)];
%Integral of line respect of t (dt):
I = int(D,t,0,5*pi);
i=double(I);
%disp:
disp('Value:')
disp(i)
댓글 수: 2
CARLOS RIASCOS
2018년 4월 3일
Yes, It must be because the vector field F, is conservative, therefore its line integral on a closed curve in this case an ellipse is zero. But the code is fine, I tested it with exercises and the results of the code matched the results of the exercises. I hope my code will help you.
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!