Hi! I am new to FEniCS and I have solved a variational problem using finite elements and a time-discretisation. Some of the code is below:

```
mesh = IntervalMesh(num_x_steps, 0.0, x_max)
V = FunctionSpace(mesh, "Lagrange", 1)
u = Function(V)
u_prevs = Function(V)
x_expression = Expression('x[0]', degree=1)
F = (inner(u, v) * dx
- inner(u_prevs, v) * dx
+ dt * inner(x_expression * x_expression * u.dx(0), v.dx(0)) * dx
+ dt * inner(x_expression * u.dx(0), v) * dx)
solve(F == 0, u, bc)
```

This is working well and now I am trying to compute the error (L2 norm). I am trying to find the error between the vectors

and

So far I am thinkingβ¦

```
errornorm((u-u_prevs)/dt, 0.5*...
```

but am unsure how to proceed. Any help would be appreciated, thanks