## 1. Introduction

[2] Magnetic helicity, *H*_{m} = ∫_{V} · **B***dV*, where magnetic field **B** = ∇ × , is generally not unique due to the arbitrary gauge transformation of the vector potential, → + ∇ϕ. It is only uniquely defined for a closed volume, *V*, with *B*_{n} = 0, i.e., the normal component of magnetic field vanishes on the volume surface, *S*, of normal . For an open-ended magnetic flux rope, a gauge-invariant relative helicity has to be defined in order to calculate a unique value of *H*_{m} [see, e.g., *Berger and Field*, 1984; *Berger*, 1999].

[3] Following the definition by *Finn and Antonsen* [1985], a gauge-invariant relative helicity can be written as

[4] Here a reference magnetic field, **B**′, is chosen such that *B*_{n} = *B*′_{n}, and **B**′ = ∇ × **A**′. Equation (1) can be proven to be invariant under the transformations, → + ∇ϕ and **A**′ → **A**′ + ∇ϕ′. The change in *K*_{r} due to the above transformations is Δ*K* = ∫_{V}[(**B** − **B**′) · ∇ϕ + (**B** − **B**′) · ∇ϕ′]*dV*. From the vector identity, ∇ · [(**B** − **B**′)ϕ] = ϕ∇ · [(**B** − **B**′)] + (**B** − **B**′) · ∇ϕ = (**B** − **B**′) · ∇ϕ, and *B*_{n} = *B*′_{n}, it follows that Δ*K* = 0.

[5] For a cylindrical magnetic flux rope, i.e., a flux rope of helical field lines lying on nested cylindrical surfaces with axis, *z*, and ∂/∂*z* ≈ 0, a convenient choice of **B**′ is **B**′ = *B*_{z}. The volume, *V*, has to be bounded by a cylindrical flux surface of length, *L*, with two ends perpendicular to . *Dasso et al.* [2003] used this reference field for deriving the relative helicity for axially symmetric flux ropes, such as the well-known force-free, constant α model. In our present study, we extend the calculation to a flux rope of an arbitrary cross section. In a Cartesian coordinate system, (*x*, *y*, *z*), the cross-sectional structure of a cylindrical flux rope in the (*x*, *y*) transverse plane is governed by the Grad-Shafranov (GS) equation [e.g., *Sturrock*, 1994; *Hu and Sonnerup*, 2002]

Here the variable *A*(*x*, *y*) is the *z* component of the vector potential, as **B** = ∇ × *A* + *B*_{z}(*A*). The right-hand side is a total derivative of the single-variable function, *P*_{t}(*A*), which is the sum of plasma pressure, *p*(*A*), and the axial magnetic pressure. By choosing the reference field **B**′ = *B*_{z} with ∇ × **A**′ = **B**′, equation (1) is reduced to

as = *A* + **A**′. For axisymmetric cases, equation (3) is equivalent to the definition obtained by *Dasso et al.* [2003].

[6] The GS reconstruction technique has been developed and utilized to derive the cross section of a cylindrical flux rope from spacecraft measurements [*Hu and Sonnerup*, 2001, 2002; *Hu et al.*, 2003, 2004]. The reconstruction begins from obtaining an explicit function *P*_{t}(*A*) through the direct curve fitting of spacecraft data, *P*_{t}(*x*, 0) vs. *A*(*x*, 0), as well as *B*_{z}(*A*) from *B*_{z}(*x*, 0) vs. *A*(*x*, 0). Then the GS equation is utilized to solve for *A*(*x*, *y*) in a rectangular domain from known values along *y* = 0 (for details, see *Hu and Sonnerup* [2002]). Thus the transverse magnetic field, **B**_{t} = (*B*_{x}, *B*_{y}) = (∂*A*/∂*y*, −∂*A*/∂*x*), is derived. So is *B*_{z}(*A*) over a 2D grid. The approaches to determining **A**′ will be presented in the next section. In Section 3, we present a case study and compare our results with previous ones. Lastly, we make conclusions and briefly discuss the relevance to Sun-Earth connection.