You are an expert at summarizing long articles. Proceed to summarize the following text: 
the coronal magnetic field is a key parameter controlling most solar flaring activity , particle acceleration and transport . however , unlike photospheric ( e.g. , * ? ? ? * ) and chromospheric @xcite magnetography data , there is currently a clear lack of quantitative information on the coronal magnetic field in the dynamically flaring region , which complicates the detailed modeling of fundamental physical processes occurring in the corona . it has been recognized that the use of radio imaging spectroscopy data can provide valuable information on the steady - state magnetic fields in active regions from the analysis of the gyroresonant and free - free radiation @xcite . one more way to deduce the coronal magnetic field value integrated along the line of sight is the use of imaging spectropolarimetry utilizing some optically thin infrared forbidden lines ( e.g. , * ? ? ? however , the release of free magnetic energy in solar flares implies that the coronal magnetic field changes on relatively short time scales . from the optical measurements we know that magnetic field changes are seen _ after _ flares @xcite , but changes _ during _ flares can not be observed with available tools and methods . clearly the direct detection of these changes is of critical importance to understanding the energy release process . the measurement of magnetic fields in this dynamic region of the corona is a great challenge for solar physics . it has been understood , and often proposed ( e.g. , * ? ? ? * ) , that the coronal magnetic field can in principle be evaluated from the microwave gyrosynchrotron radiation , which is indeed sensitive to the instantaneous magnetic field strength and orientation relative to the line of sight . recently @xcite demonstrated that the mean magnetic field in a solar flare derived from the microwave spectrum yields results consistent with the mhd evaluation . nevertheless , it remains unclear how reliable such derived values can be , and with what accuracy the magnetic field can be determined .    in this letter we describe a practical forward fitting method to derive the magnetic field from microwave imaging spectroscopy data and test it using a simulated three - dimensional ( two spatial and one spectral ) model data cube . we show that the derived magnetic field distribution along the model loop is in very good agreement with the simulated magnetic field . we discuss further steps needed to convert this method to a routine diagnostic procedure that can be employed when imaging spectroscopy data are available from a new generation of solar radio instruments . we start from a simple model of a flaring loop , which includes the following distinct elements ( our model is basically similar to that proposed by * ? ? ? * ) : 1 ) forming a magnetic loop from a set of field lines , which eventually represents a 3d structure consisting of a grid of volume elements ( voxels ) each of which is characterized by the magnetic field components @xmath0 , @xmath1 , and @xmath2 ; all voxel sizes were taken to be about 1 `` ; this 3d structure is then ' ' observed " at an arbitrary viewing angle ; 2 ) populating the loop by thermal plasma , i.e. , prescribing the electron number density and temperature to each voxel ; in general , the density and temperature can evolve in time and have an arbitrary distribution in space , but we adopted a uniform distribution of the thermal plasma for our test modeling ; 3 ) populating the loop by fast accelerated electrons , we adopted an isotropic and spatially uniform distribution with a power - law energy spectrum ; 4 ) calculating the gyrosynchrotron ( gs ) radio emission from each voxel , using the computationally fast petrosian - klein approximation @xcite to compute the gyrosynchrotron spectrum ; 5 ) solving the radiation transfer equation along all selected lines of sight through the rotated structure , to form the data cube of spatially resolved radio spectra @xmath3 for the preselected viewing angle :    @xmath4    where @xmath5 is the emission frequency , @xmath6 and @xmath7 are the gs emission and absorption coefficients in the petrosian - klein approximation @xcite at position @xmath8 along the @xmath9-th line of sight , @xmath9 is the pixel number , @xmath10 is the optical depth of the length @xmath8 of the line of sight @xmath9 , @xmath11 , and @xmath12 is the total length of the source along the line of sight @xmath9 .    this data cube ( figure  [ image ] shows one image and one spectrum from it ) represents the input information ( observable in principle by an idealized radioheliograph ) from which the magnetic field and other relevant flare parameters are to be determined . true inversion of the observational data is difficult to perform in most cases of practical importance . however , forward fitting methods can provide a good approximation to the exact solution of the problem . in this letter we concentrate on the forward fitting of the observable , spatially resolved spectra with a model spectrum with an appropriate number of free parameters , and determine the values of those free parameters based on the minimization of residuals . we point out that unlike empirical fitting methods , which use some simplified function with free parameters based on observed spectral shape ( e.g. , * ? ? ? * ) , and lacking a direct physical meaning , we apply the physically motivated gs source function . although the gs source function is cumbersome in both the general case @xcite and even when simplifying approximations are used @xcite , this approach has the great advantage that the free parameters of this fitting function are directly meaningful physical parameters . although each spatially resolved spectrum is originally determined from the line of sight integration ( [ eq_transfer_inhom ] ) , and so takes into account the source non - uniformity along the line of sight , the model spectrum for the forward fit is taken to be the spectrum of a homogeneous source :    @xmath13    whose parameters are to be determined from the fit .    in fact , this choice ( [ eq_transfer_hom ] ) is necessary because we lack reliable _ a priori _ information to include such line of sight non - uniformity . however , we expect that for many lines of sight the approximation of a uniform source is appropriate for an isolated flaring loop , allowing reliable inversion of the flare parameters ( which can be checked by comparing the results with the model ) . since for this first step we restrict the model to an isotropic distribution of fast electrons , we can confidently use the simplified petrosian - klein approximation of the gyrosynchrotron source function @xcite . more complicated pitch - angle distributions can in principle be used at the cost of more time - consuming calculation of the radio emission using the full expressions . our forward fitting scheme utilizes the downhill simplex minimization algorithm @xcite and so is similar to those we applied earlier @xcite but it has a few important modifications . the necessity of these modifications is called by a more complete radio spectrum from each pixel for our idealized radioheliograph , which allows the use of a source function with a larger number of free parameters than were possible in the earlier studies . in fact , we use source functions with six to eight free parameters , allowing a complete treatment of the spectrum given the types of nonthermal electron energy distributions we assume , and apply the downhill simplex minimization algorithm , which finds a _ local _ minimum of the normalized residual ( or reduced chi - square ) . the ultimate goal of the fitting , however , is to identify the _ global _ minimum . typically , the number of the ( false ) local minima increases with the number of free parameters . as has been stated , the number of the free parameters is large in our case , so the issue of the false local minima can be severe . thus , additional measures must be taken to approach and find the true global minimum ( or , at least , a nearby local minimum ) . to do so , we shake the simplex solution ( d.g.yakovlev , private communication 1992 ) as follows ( see on - line animation of the fit ) . the original simplex algorithms uses an @xmath14-dimensional vector whose value decreases from step to step in the parametric @xmath14-space leading to a local minimum of the normalized residual . when the local minimum is achieved , we strongly perturb the value of the vector and repeat the simplex minimization scheme . as a result , the system can arrive either at the same or another minimum . if it arrives at the same minimum , we treat it as the global minimum and stop the fitting of the elementary spectrum . if it arrives at a different minimum , then we select the one with the smaller residual and repeat the shaking . the new result is compared with the best one achieved so far . the number of shakings , @xmath15 , is limited typically to the value @xmath16 + 6 , where @xmath16 is the number of the free parameters . to add more flexibility to the explored parameter space we apply stronger shaking at @xmath17 : in addition to the increase of the vector value , we strongly change one of the free parameters . eventually , we select the solution with the smallest normalized residual . to perform the fitting , we must specify the source function and corresponding free parameters . as has been explained , we fit each spatially resolved spectrum ( from each line of sight ) with the gs solution for the homogeneous source . since we specify the pixel size , we know the source area and the corresponding solid angle of each pixel . thus , the free parameters are the magnetic field value ( @xmath18 ) and the viewing angle ( @xmath19 ) relative to the line of sight , number density of the thermal electrons ( @xmath20 ) , and the parameters describing the fast electron distribution over energy . generally , we do not know the functional shape of this distribution from first principles , thus , we use several model functions to approximate the true one . here we start from a single power - law distribution over kinetic energy , which has three free parameters : @xmath21 , the number density of fast ( relativistic ) electrons at the kinetic energy above some threshold value ( we take 100 kev as the low - energy threshold , since electrons of lower energy do not contribute substantially to the radio emission ) , @xmath22 , the energy spectral index , and @xmath23 , the largest energy in the electron spectrum . in terms of fitting , we use the column density , @xmath24 , where @xmath25 is the source effective depth , in place of the density @xmath26 , because it is @xmath27 that enters the gs expressions .    since our model source is well resolved and consists of a few hundred line - of - sight pixels , the fitting yields corresponding 2d arrays of each of the involved free parameters . figure  [ pwl_res ] displays the collapsed arrays as a function of the @xmath28-coordinate along the loop . different points at each @xmath28 value correspond to the range of @xmath29 values of the individual pixels . let us analyze the fitting results for the assumed single power - law distribution over energy . first of all , the accuracy of the derived thermal electron number density is remarkably good : for most of the pixels the recovered values are consistent with the assumed uniform distribution with @xmath30 . likewise , the plot for the recovered magnetic field values consists of a smoothly varying track , where the model magnetic field is well measured ( we confirm this statement later by the direct comparison of the recovered and modeled values ) , although there are a number of outliers above ( circled region ) and below ( a few points ) the main track . the outliers are a consequence of finding false ( local ) minima of the minimized residual function . however , the outliers are a minor constituent that can easily be recognized against the true values . first , they appear at random positions in the source image and do not form a spatially coherent region , unlike the main track . second , these same outliers are also outliers in fitted viewing angle : the bottom circled region in panel @xmath31 implies quasilongitudinal viewing angles , although the loop image itself ( fig . [ image]a ) implies that the viewing angles should be quasitransverse along the loop top . another group of outliers in viewing angle ( the top circled region in panel @xmath31 ) has a less obvious effect on the recovered magnetic field values . recovery of the electron distribution parameters is also done remarkably well . the scatter in column density is related to the variation of the source depth along different pixels , while the scatter of the @xmath23 value is related to the fact that the gs spectrum ( in the 1 - 18  ghz range ) is almost independent of the exact @xmath23 value so long as it exceeds a few mev . in contrast to @xmath23 , the spectral index value is recovered almost precisely , @xmath32 , in remarkable agreement with the model - adopted value @xmath33 . a few outliers ( circled region ) correspond to the same magnetic field value outliers circled in panel @xmath34 . in fact , the lack of _ a priori _ knowledge on the electron distribution is one of the main potential sources of error in the recovered magnetic field . to investigate the possible range of the errors related to an incorrect choice of distribution function , we consider two plausible alternative electron distributions : ( 1 ) a double power - law ( dpl ) over kinetic energy , which requires two additional free parameters , the break energy and the high - energy spectral index , and ( 2 ) a single power - law distribution over the momentum modulus ( plp ) , which has the same number of free parameters , with the same meaning , as the single power - law distribution over energy ( ple ) . the overall goodness of these three fits can be evaluated based on comparison of the normalized residuals for them , figure  [ resid ] . one can see that the ple distribution produces much smaller residuals than the other two distributions , while the dpl distribution is generally better than or comparable to the plp distribution . we found that in our case the use of the dpl distribution , with its greater number of free parameters , is clearly excessive : the low - energy and high - energy spectral indices are close to each other and the break energy is not well defined by the fitting , which together means that the distribution is consistent with the ple distribution with a single spectral index . we note also , that even though the dpl distribution must in principle provide as good a fit as the single ple distribution does , the presence of two extra free parameters increases the number of local minima of the residual function so severely that the fitting frequently fails to find the true global minimum and stops at a nearby local minima . nevertheless , the use of the dpl distribution allows for reasonably accurate recovery of the magnetic field values along the loop , figure  [ other_res]b , comparable to the ple distribution , although the viewing angle and the thermal electron density are recovered less precisely . in contrast , the magnetic field recovery with the plp distribution , figure  [ other_res]e , is less accurate , especially along the loop top region . again , these errors can easily be recognized based on apparently incorrect determination of the viewing angle , figure  [ other_res]f . thus , the comparison of the normalized residuals for different electron distributions along with the use of the external knowledge ( e.g. , characteristic range of the viewing angle available from the high resolution source images ) allows the outliers to be unambiguously distinguished from the true values . in our model there are two values , the magnetic field and the viewing angle , which are varied through the loop and which we are going to compare with the model ones in more detail . we note that both the magnetic field and the viewing angle can vary along each line of sight , while we recover single values for these parameters corresponding to a particular pixel of the source image . this means that the recovered values must be treated as effective ( mean ) values along each line of sight . in addition , the viewing angle values have an ambiguity between @xmath19 and @xmath35 as we use the unpolarized radio spectrum only for our fit . this ambiguity can easily be addressed by taking into account the sense of polarization observed from each pixel , which works well as is seen from figure  [ fit_compar ] . figure  [ fit_compar ] displays the direct comparison of the derived values with the model ones for the magnetic field and the viewing angle . one can clearly see that the derived magnetic field values are indeed in very close agreement with the model mean values : the formal fitting errors of the derived values are noticeably smaller than the magnetic field variation along the line of sight . two groups of outliers seen in figure  [ pwl_res ] are also evident in figure  [ fit_compar ] . the viewing angles are also recovered remarkably well ( again , two groups of outliers are evident ) . however , the accuracy of the viewing angle recovery drops as the viewing angle approaches @xmath36 ; the reason for this behavior is the weak sensitivity of the gs spectrum to the exact viewing angle value when it is around @xmath36 . there is also a small systematic off - set of the derived values , around @xmath37 , compared with the mean @xmath19 values , whose origin is as yet unclear . in this letter we have demonstrated that recovering the coronal magnetic field strength and direction via radio imaging spectroscopy data of gs emission from a flaring loop can in principle be performed with high reliability and accuracy by the appropriate forward fitting method . the potential value and application field of this finding are far - reaching . indeed , to recover the flaring magnetic field we used a set of instantaneously measured spectra , i.e. , we do not need any time integration or scanning of the loop to obtain the magnetic field along the flaring loop . therefore , we can follow the magnetic field temporal variations , e.g. , due to release of the free magnetic energy via reconnection . this offers a direct way of observing the conversion of magnetic field energy into flare energy . in addition , the simultaneous evolution of the accelerated electrons can be tracked with unprecedented accuracy through variations in their energy distribution parameters . however , to convert the developed method to a routine , practical tool for use with future , high - resolution dynamic imaging spectroscopy data expected from the new generation of the solar radio instruments under development , we have to address a number of further issues including finite and frequency - dependent angular resolution of the instrument , statistical errors in the data , errors in the calibration , etc . in addition , we must allow at least one additional degree of freedom of the system  the possibility of anisotropic angular distributions of the fast electrons . in principle , it is easy to include the anisotropy in our method ( c.f . * ) , but this complication would greatly increase the computation time needed to obtain the solution , which calls for the development of new , computationally effective schemes of the gs calculations taking into account the anisotropy . it is worth noting that the stability of the fit can be significantly improved by using dual - polarization measurements of the spatially resolved gs spectra @xcite , which we have not considered here . this work was supported in part by nsf grants ast-0607544 and atm-0707319 and nasa grant nng06gj40 g to new jersey institute of technology , and by the russian foundation for basic research , grants no . 06 - 02 - 16295 , 06 - 02 - 16859 , 06 - 02 - 39029 . we have made use of nasa s astrophysics data system abstract service .
we develop a practical forward fitting method based on the _ simplex algorithm with shaking _ , which allows the derivation of the magnetic field and other parameters along a solar flaring loop using microwave imaging spectroscopy of gyrosynchrotron emission . 
 we illustrate the method using a model loop with spatially varying magnetic field , filled with uniform ambient density and an evenly distributed fast electron population with an isotropic , power - law energy distribution .