# is it possible to shape electromagnetic field?

Is it possible to produce a magnetic field of specific shape? For example a magnetic field that will be confined in a cylindrical shape of specific dimensions.

• It's a yes...but. While you haven't sufficiently specified what kind of field you want, I have a hunch that what you are asking for will be impossible. One can constrain a field to a cylindrical region, but it won't be a cylindrical homogeneous field. That is impossible. – CuriousOne Apr 22 '16 at 20:59

Maxwell's equations constrain what fields you can produce. Write down the field you are thinking of and check it for yourself! Suppose you want to create the field $\vec{B}(t,x,y,z)$. It must satisfy Gauss's law ($\nabla\cdot\vec{B}=0$ for every point in space and every time). This is a big constraint on the types of fields you can create. If the $\vec{B}$ you have in mind does satisfy Gauss's law then the other Maxwell's equations tell you what kind of $\vec{E}$, $\vec{J}$ and $\rho$ you need to produce the desired $\vec{B}$. If you want $\vec{E}=0$ then you have more constraints, for instance $\vec{B}$ cannot be a function of time. Then you just need a steady current $\vec{J}=\nabla\times\vec{B}$ and you can get your desired $\vec{B}$ field.