The source of the magnetic field is created by magnetic energy.There are three sources for creating a magnetic field:
Permanent magnet: the magnet atom has electrons that rotate around the nucleus creating a magnetic field.
Current-carrying conductor: in this case there is a wire in which the current circulates, thus creating a magnetic field.
Electromagnet:this source creates the magnetic field when the current flows through the wire.
There are two types of magnetic fields:
A static magnetic field = generates fixed electric charges in space. The static magnetic field uses direct current.
A time-varying magnetic field = uses alternating current and is linked to time variations in the flow of a magnetic field.
The source of the magnetic field is obtained using the laws of the Biot-Savart law in the case that it is created by a current element. The Biot-Savart law establishes the connection between magnetic fields and the currents that create them. On the other hand, in the case of the presence of a solenoid, Ampere's law is used. Ampere's law allows us to know the magnetic fields thanks to the electric currents.
When the electric charge is in motion, it creates two types of fields: the electric field and the magnetic field. Although these two fields have common characteristics such as the intensity decreases as you move away from the electric source; we could find several differences such as:
From the point of view of the electromagnetic field, we can find: