MATH 251: Calculus 3, SET8

16: Vector Calculus

16.1: Vector Fields

These problems are done with the CAS. See Hand Solutions for details.

1. [1073/6]

[x,y] = meshgrid(-3:3, -3:3);
u = y ./ sqrt(x.^2 + y.^2);
v = -x ./ sqrt(x.^2 + y.^2);
figure
quiver(x,y,u,v); grid on; hold on
plot([-3 3], [0 0], 'k')
plot([0 0], [-3 3], 'k')
axis equal; axis([-3 3 -3 3])
xlabel('x'); ylabel('y')
title('SET8, 1073/6')

2. [1073/10]

x = -2:2:2; y = x; z = x; s2 = sqrt(2);
[X Y Z] = meshgrid(x,y,z);
U = zeros(size(X));
V = s2*ones(size(Y));
W = s2*ones(size(Z));
figure
quiver3(X,Y,Z,U,V,W); grid on; hold on
view(12,18)
axis equal; axis([-2 3 -2 3 -2 3])
xlabel('x'); ylabel('y'); zlabel('z')
title('SET8, 1073/10')

3. [1073/14]

[x,y] = meshgrid(-3:0.5:3, -3:0.5:3);
u = cos(x+y); v = x;
figure
quiver(x,y,u,v); grid on; hold on
plot([-3 3], [0 0], 'k')
plot([0 0], [-3 3], 'k')
axis equal; axis([-3.5 3.5 -3.5 3.5])
xlabel('x'); ylabel('y')
title('SET8, 1073/14')

4. [1074/16]

x = -1:1; y = x; z = x;
[X Y Z] = meshgrid(x,y,z);
U = ones(size(X));
V = 2*ones(size(Y));
W = Z;
figure
quiver3(X,Y,Z,U,V,W); grid on; hold on
view(117.4, 8.6)
axis equal; axis([-1.5 1.5 -1.5 1.5 -1.5 1.5])
xlabel('x'); ylabel('y'); zlabel('z')
title('SET8, 1073/16')

5. [1074/18]

x = -1:0.5:1; y = x; z = x;
[X Y Z] = meshgrid(x,y,z);
U = X; V = Y; W = Z;
figure
quiver3(X,Y,Z,U,V,W); grid on; hold on
view(-234.6, 13.5)
axis equal; axis([-1.5 1.5 -1.5 1.5 -1.5 1.5])
xlabel('x'); ylabel('y'); zlabel('z')
title('SET8, 1073/18')

6. [1074/22]

syms s t
f = sqrt(2*s + 3*t)
f = 
grad_f = gradient(f, [s t])
grad_f = 
% MATLAB displays the gradient vector vertically instead of horizontally.

7. [1074/24]

syms x y z
f = x^2 * y * exp(y/z)
f = 
grad_f = gradient(f, [x y z])
grad_f = 

8. [1074/26]

syms x y
f = (x^2 - y^2) / 2
f = 
grad_f = gradient(f, [x y])
grad_f = 
%
[x,y] = meshgrid(-2:0.5:2, -2:0.5:2);
u = x; v = -y;
figure
quiver(x,y,u,v); grid on; hold on
plot([-3 3], [0 0], 'k')
plot([0 0], [-3 3], 'k')
axis equal; axis([-2.5 2.5 -2 2])
xlabel('x'); ylabel('y')
title('SET8, 1074/26')

9. [1074/34]

syms x y
P = [1 3]
P = 1×2
1 3
F(x,y) = [x*y-2 y^2-10]
F(x, y) = 
appx_chg_in_pos = 0.05*F(1,3)
appx_chg_in_pos = 
Q = P + appx_chg_in_pos
Q = 
Q_appx = double(Q)
Q_appx = 1×2
1.0500 2.9500

10. [1074/36]

% (a)
[x,y] = meshgrid(-2:0.5:2, -2:0.5:2);
u = ones(size(x)); v = x;
figure
quiver(x,y,u,v); grid on; hold on
plot([-3 3], [0 0], 'k')
plot([0 0], [-3 3], 'k')
axis equal; axis([-2.5 2.5 -2.5 2.5])
xlabel('x'); ylabel('y')
title('SET8, 1074/36')
% (b)
% Now dx/dt = 1 and dy/dt = x. Thus dy/dx = (dy/dt) / (dx/dt) = x.
% (c)
% Hence y = 1/2 * x^2 + C. Since particle starts at origin (x,y) = (0,0),
% we have C = 0 and thus y = 1/2 * x^2.
% (g) Flow lines superimposed on velocity vector field.
syms x
fplot(1/2 * x^2 + 1, [-2.5 2.5])
fplot(1/2 * x^2 + 0, [-2.5 2.5])
fplot(1/2 * x^2 - 1, [-2.5 2.5])
fplot(1/2 * x^2 - 2, [-2.5 2.5])