222 - Topic 21 - Computing Line Integrals of 2D Vector Fields

239 days ago by Professor222

# Some interesting choices to use for curves. Plug in the appropriate formulas below. #xx(t)=t+1/2 #yy(t)=t^2-1/4 #a=-1/2 #b=3/2 #xx(t)=2*t #yy(t)=4*t^2-2*t #a=0 #b=1 #xx(t)=2*sin(t) #yy(t)=4*sin(t)^2-2*sin(t) #a=0 #b=pi/2 #xx(t)=t #yy(t)=t^2 #a=0 #b=1 #xx(t)=sin(t) #yy(t)=sin(t)^2 #a=0 #b=pi/2 
       
var('x,y,t') @interact def _(M=input_box(default=x+2*y,label='$M(x,y) = $'), N=input_box(default=2*x-y,label='$M(x,y) = $'), a=input_box(default=0,label='$t_{start} = $'), b=input_box(default=pi/2,label='$t_{end} = $'), xx=input_box(default=sin(t),label='$x(t) = $'), yy=input_box(default=1-cos(t),label='$y(t) = $')): A = M(x=xx,y=yy)*diff(xx,t)+N(x=xx,y=yy)*diff(yy,t) B=integrate(A,t,a,b) delt = b-a G = parametric_plot((xx,yy),(t,a,b)) G += points((xx(t=a+delt*k/10),yy(t=a+delt*k/10)) for k in range(10+1)) pretty_print('Line Integral over the given curve is '+str(B)) show(G) 
       

Click to the left again to hide and once more to show the dynamic interactive window