  The photospheric magnetic field vector is continuously derived from
measurements, while reconstruction of the three-dimensional (3D) coronal
magnetic field requires modelling with photospheric measurements as a boundary
condition. For decades the cycle variation of the magnetic field in the
photosphere has been investigated. To present, there is no study to show the
evolution of the coronal magnetic flux in the corona, nor the evolution of
solar cycle magnetic free energy. The paper aims to analyze the temporal
variation of the magnetic field and free magnetic energy in the solar corona
for the solar cycle 24 and how the magnetic field behaves in the two
hemispheres. We investigate if we can obtain better estimates of the magnetic
field at Earth using the nonlinear force-free field (NLFFF) extrapolation
method. To model the magnetic field over cycle 24 we apply the NLFFF
optimization method to the synoptic vector magnetic maps derived from the
observations of Heliospheric and Magnetic Imager (HMI) onboard Solar Dynamic
Observatory (SDO). We found that during the solar cycle 24, the maximum of the
Sun's dynamics is different from the sunspot number (SSN) maximum peak. The
major contribution to the total unsigned flux is provided by the flux coming
from the magnetic field structures other than sunspots (MSOS) within latitudes
between -30 and +30 degrees. The magnetic flux variation during the solar cycle
24 shows a different evolution in the corona than in the photosphere. We found
a correlation value of 0.8 between the derived magnetic energy from our model
and the flare energy index derived from observations. On average, cycle 24 had
a higher number of sunspots in the northern hemisphere (NH) but stronger flux
in the southern hemisphere (SH) which could more effectively reach the higher
layers of the atmosphere. The coupling between the hemispheres increases with
height.
