Domains of electromagnets I know that magnetism is due to the alignment of domains of a magnetic substance. Due to this reason, an iron bar may be magnetized by stroking it with a permanent magnet such that its domains are aligned.
Similarly, when a wire is coiled around a soft iron core and current flows through it, the iron core starts behaving as a magnet as it's domains are aligned.
My question is that why does the iron core lose its magnetic properties once the current flowing through the coil is stopped. Shouldn't the domains that were aligned remain aligned?
There might be a flaw in my reasoning too, so please tell me where I'm going wrong with this concept.
 A: The reason the domains don't remain aligned is the same reason the material splits into domains to start with: to minimize the magneto-static energy.
One of the differences between the "soft" magnetic materials (like this described in the question) and the "hard" materials (these that remain magnetized after the external field is removed consists in how easy is for the domain walls to move.
In soft materials the walls can move easily (low energy required) and the minimization of the magneto-static energy is the main factor.
If the motion of the walls requires too much energy the material maintain a considerable magnetization even though this state is not a minimum of magneto-static energy. Things that can impede the motion of the domain walls may be impurities, defects in the crystal lattice, the boundaries between grains.  
A: There is a residual magnetic field that remains after you removed your magnet or currents : see the remanence.
The remanence is only partial though : it is always a matter of minimising energy. I think this image is really good. If the energy state of moving back the magnetic domains is low enough, it is worth for the domains to re-arrange themselves into a lower energetic condition.
A: An electromagnet uses current to power it, the current makes it act as a magnet, however it is better than a permanent magnet because a permanent magnet only has one magnetic field whilst an electromagnet's coils each possess a magnetic field. A permanent magnet only can be on, until the domains separate, whilst an electromagnet can be turned on and off, by stopping the current from passing o not. Also an electromagnet can become stronger depending on the resistance, or amount of the current in a circuit, also by how many coils there are. 
