1 Introduction. 2 Vector fields. 2.1 Basic operators and equations. 2.2 Electrostatic field. 2.3 Magnetostatic field. 2.4 Steady conduction field. 3 Analytical methods for solving boundary-value problems. 3.1 Method of Green's functions. 3.2 Method of images. 3.3 Method of separation of variables. 4 Numerical methods for solving boundary-value problems. 4.1 Variational formulation in magnetostatics. 4.2 Finite elements for two-dimensional magnetostatics. 4.3 Finite elements for three-dimensional magnetostatics. 5 Time-varying electromagnetic field. 5.1 Maxwell's equations in differential form. 5.2 Poynting's vector. 5.3 Maxwell's equations in frequency domain. 5.4 Plane waves in an infinite domain. 5.5 Wave and diffusion equations in terms of vectors E and H. 5.6 Wave and diffusion equations in terms of scalar and vector potentials. 5.7 Electromagnetic field radiated by an oscillating dipole. 5.8 Diffusion equations in terms of dual potentials. 5.9 Weak eddy current in a conducting plane under a.c. conditions. 5.10 Strong eddy current in a conducting plane under a.c. conditions. 5.11 Eddy current in a cylindrical conductor under step excitation current. 5.12 Electromagnetic field equations in different reference frames. 6 Inverse problems. 6.1 Direct and inverse problems. 6.2 Well-posed and ill-posed problems. 6.3 Fredholm's integral equation of the first kind. 6.4 Case study: synthesis of magnetic field sources. 6.5 Under- and over-determined systems of equations. 6.6 Least-squares solution. 6.7 Classification of inverse problems. 7 Optimization. 7.1 Solution of inverse problems by the minimization of a functional. 7.2 Constrained optimization. 7.3 Multiobjective optimization. 7.4 Gradient-free and gradient-based methods. 7.5 Deterministic vs non-deterministic search. 7.6 A deterministic algorithm of lowest order: simplex method. 7.7 A non-deterministic algorithm of lowest order: evolution strategy. 7.8 Numerical case studies. 8 Conclusion. References. Acknowledgements. APPENDIX.