Tangent field

### 18.9.1 Tangent field

The plotfield or fieldplot command draws the tangent field of a differential equation or a vector field.

- To draw the tangent field of a differential equation, plotfield takes two mandatory arguments and one optional argument:
  - expr, an expression depending on two variables, a time variable and a dependent variable.
  - vars, a list of the two variables [t,y], where t is the time variable and y is the dependent variable. The variables can optionally include their ranges; [t=a..b,y=c..d].
  - Optionally, ystep=n to specify the discretization.
- plotfield(expr,vars ⟨,ystep=n ⟩) draws the tangent field of the differential equation y′=f(t,y).
- To draw a vector field plotfield takes two mandatory arguments and two optional arguments:
  - V, a list of two expressions involving two variables.
  - vars, a list of the two variables. The variables can optionally include their ranges var=a..b.
  - Optionally, xstep=n to specify the discretization of the first variable.
  - Optionally, ystep=m to specify the discretization of the second variable.
- plotfield(V,vars ⟨,xstep=n,ystep=m ⟩) draws the vector field given by V.

#### Example

plotfield(4*sin(t*y),[t=0..2,y=-3..7])

plotfield(5*[-y,x],[x=-1..1,y=-1..1])