A quaternionic treatment of the inhomogeneous div--rot system