Lesson 7 of 15

Vector Fields

Vector Fields

A vector field assigns a tangent vector to every point of a manifold. In coordinates, a vector field VV has components Vi(p)V^i(p) that vary smoothly from point to point.

A vector field acts as a differential operator on scalar functions:

V[f](p)=iVi(p)fxi(p)V[f](p) = \sum_i V^i(p) \frac{\partial f}{\partial x^i}(p)

This produces a new scalar function — the directional derivative of ff along VV.

Important Vector Fields on R2\mathbb{R}^2

Radial field: X=x/x+y/yX = x\partial/\partial x + y\partial/\partial y

This field points radially outward. Acting on f=x2+y2f = x^2 + y^2: X[f](1,2)=x2x+y2y=2+8=10X[f](1,2) = x \cdot 2x + y \cdot 2y = 2 + 8 = 10

Rotation field: Y=y/x+x/yY = -y\partial/\partial x + x\partial/\partial y

This field rotates counterclockwise. Acting on f=x2+y2f = x^2 + y^2 (which is rotationally symmetric): Y[f](1,2)=y2x+x2y=4+4=0Y[f](1,2) = -y \cdot 2x + x \cdot 2y = -4 + 4 = 0

The rotation field kills radially-symmetric functions — it detects angular variation.

Your Task

Implement vector_field(comps_fn) where comps_fn(point) returns the component list [V0(p),V1(p)][V^0(p), V^1(p)]. The result should be a function VV such that V(f)(point)V(f)(*point) gives the directional derivative.

Python runtime loading...
Loading...
Click "Run" to execute your code.