format: text

text:
# THE KINEMATICS AND PHYSICAL CONDITIONS OF THE IONIZED GAS IN MARKARIAN 509. I. CHANDRA HIGH-ENERGY GRATING SPECTROSCOPY

## 1 Introduction

X-ray and UV absorption and emission by photoionized circumnuclear gas in type 1 Seyfert galaxies is a key observational diagnostic. While it has been possible to study the UV absorption with a velocity resolution of $`10`$ $`\mathrm{km}\mathrm{s}^1`$, the kinematics of the X-ray absorber observed with CCDs (such as those aboard ASCA ) could only be studied with a velocity resolution $`>10,000`$ $`\mathrm{km}\mathrm{s}^1`$. Inadequate spectral resolution, combined with a lack of simultaneity between X-ray and UV observations has resulted in major uncertainties in the dynamics, physical state, location, and geometry of the X-ray and UV absorbers, as well as the relation between the two. The launch of Chandra and XMM-Newton began a new era in the study of X-ray photoionized circumnuclear gas. The energy resolution of the Chandra transmission gratings is currently the best available in the 0.5–10 keV band, and is as high as $`280`$ $`\mathrm{km}\mathrm{s}^1`$ at 0.5 keV. High resolution X-ray spectroscopy with Chandra now allows the gas kinematics to be studied seriously for the first time, and the detection of individual absorption and emission lines can now place very strong constraints on the ionization structure of the gas.

The existence of warm, or partially ionized, X-ray absorbing gas in type 1 active galactic nuclei (AGNs) was first suggested by Einstein observations of QSO MR 2251$`+`$178 (Halpern (1984)). Subsequently, ROSAT and ASCA showed this to be a common phenomenon, present in roughly $`5060\%`$ of type 1 AGNs, and studies focused on the measurements of the O vii and O viii absorption edges which appeared to be the most prominent features in these low to moderate resolution spectra (Nandra & Pounds (1992); Fabian et al. (1994); Reynolds (1997); George et al. (1998)). High-resolution grating observations with Chandra have since been used to study the X-ray warm absorbers in several Seyfert 1 galaxies (Collinge et al. (2001); Lee et al. (2001); Sako et al. 2001a ; Pounds et al. (2001); Kaastra et al. (2002); Kaspi et al. (2002); Yaqoob et al. 2002a ). Discrete, narrow absorption features (FWHM less than $`2000\mathrm{km}\mathrm{s}^1`$), often unresolved, are found to be typically blueshifted, with outflow velocities ranging from a couple of hundred to a couple of thousand $`\mathrm{km}\mathrm{s}^1`$ relative to systemic. Moreover, in some cases multiple velocity components have been identified (Collinge et al. (2001); Kaspi et al. (2002); Kaastra et al. (2002)). There are typically fewer features in emission than absorption (e.g. Kaastra et al. (2002); Kaspi et al. (2002)). UV absorbing gas in Seyfert 1s was first observed with IUE (Ulrich (1988)). Multiple discrete kinematic components to the UV absorbers have been observed and it has been suggested that the X-ray absorber is associated with with one or more, but not necessarily all, of the UV components (e.g. Mathur, Elvis, & Wilkes (1995); Mathur, Elvis, & Wilkes (1999)). Observations with the improved sensitivity and resolution of HST/STIS and FUSE have since shown that $`60\%`$ of Seyfert 1s exhibit intrinsic UV absorption and that multiple kinematic components are common (Crenshaw et al. (1999)).

At present, models of the X-ray absorbers span a wide range in distance from the central ionizing source, from winds originating at the accretion disk (Elvis (2000)), out to the putative (parsec-scale) molecular torus (e.g. the multi-temperature wind model of Krolik & Kriss (2001), and beyond, to the NLR (e.g. Ogle et al. 2001). In addition, for two particular Seyfert 1 galaxies observed by XMM-Newton (MCG $``$6$``$30$``$15 and Mrk 766) it has been proposed that relativistically broadened soft X-ray lines from an accretion disk can account for some of the spectral features traditionally attributed to a warm absorber (Branduardi-Raymont et al. 2001; Sako et al. 2001a). However, Lee et al. (2001) have argued that the Chandra grating data, for MCG $``$6$``$30$``$15 at least, can be modeled with a dusty warm absorber without the relativistic emission lines. One thing is clear however: all of the models must stand up to the scrutiny of an increasingly large body of results as the results of new observational campaigns become available. The purpose of the present paper is to present the results of one such new campaign, namely simultaneous Chandra HETGS , HST/STIS , and RXTE observations of the luminous ($`L_{210\mathrm{keV}}`$ typically $`1.32.6\times 10^{44}\mathrm{ergs}\mathrm{s}^1`$ 111We use $`H_0=70\mathrm{km}\mathrm{s}^1\mathrm{Mpc}^1`$ and $`q_0=0`$ throughout this paper, unless otherwise stated., Weaver, Gelbord, & Yaqoob (2001)) Seyfert 1 galaxy, Mrk 509 ($`z=0.0344`$, Fisher et al. 1995). Mrk 509 has been studied extensively in the UV and by every major X-ray astronomy mission since HEAO-1 A2. Being so bright and exhibiting interesting absorption structure in the UV (e.g. Kriss et al. (2000)) and X-ray bands (e.g. Pounds et al. 1994; Reynolds (1997); George et al. (1998); Pounds et al. (2001); Perola et al. (2000)) Mrk 509 makes an excellent candidate for this kind of study. The driving principles behind our campaign were to measure, with the highest spectral resolution available, the X-ray and UV absorption features simultaneously in order to eliminate uncertainty due to variability, and to measure the hard X-ray continuum simultaneously with the highest throughput available (i.e. with RXTE ) in order to compensate for the poor efficiency of the Chandra gratings at energies above $`2`$ keV. In the present paper we focus on the soft X-ray spectroscopy results; detailed results from the UV data are presented in a companion paper (Kraemer et al. 2002, hereafter Paper II). Our campaign was also designed to measure the narrow and broad components of the Fe-K line and associated Compton-reflection continuum, but these results are reported elsewhere (Yaqoob et al. 2002b ).

The paper is organized as follows. In §2 we present the data and describe the analysis techniques. In §3 we discuss gross features of the X-ray spectrum, including the intrinsic continuum form and interpret the data in the context of historical, lower spectral resolution CCD data. In §4 we qualitatively discuss the discrete X-ray spectral features before describing detailed spectral modeling. In §5 we describe in detail the modeling of the X-ray spectrum using the photoionization code, XSTAR. In §6 we compare our results with those from a previous XMM-Newton grating observation by Pounds et al. (2001). In §7 we discuss the relationship between the X-ray and UV absorbers. Finally, in §8 we summarize our conclusions.

## 2 Observations and Data

We observed Mrk 509 with Chandra (simultaneously with HST/STIS and RXTE ) on 2001 April 13–14 for a duration of $`59`$ ks, beginning at UT 08 01:31. The Chandra data were reprocessed using ciao 2.1.3 and CALDB version 2.7, according to recipes described in ciao 2.1.3 threads222http://asc.harvard.edu/ciao2.1/documents\_threads.html. The RXTE PCA data were reduced using methods described in Weaver, Krolik, & Pier (1998), except that a later version of the spectral response matrix (v 7.10) was used. A complete description of the RXTE observation and data reduction is given in (Yaqoob et al. 2002b ) and will not be discussed further here.

For Chandra the instrument used in the focal plane of the High Resolution Mirror Assembly (HRMA) was the High-Energy Transmission Grating (or HETGS – Markert, et al. 1995). The HETGS consists of two grating assemblies, a High-Energy Grating (HEG) and a Medium-Energy Grating (MEG). The approximate bandpasses of the HEG and MEG are $`0.810`$ keV and $`0.510`$ keV respectively, although the usable portion of these depends on the flux of the source. Events dispersed by the gratings are collected by a CCD array and can be assigned an energy based on the position along the dispersion axis. Since the CCDs have intrinsic energy resolution, background events can be rejected with a high efficiency, and different spectral orders can be easily discriminated. Genuine photon events collected by the CCDs fall into specific pixel patterns classified by their grade and we retained only grades 0, 2, 3, 4, and 6. We utilized only the first-order grating data since the zeroth-order data are piled up and the higher orders carry much less counts than the first orders. Therefore, only the summed, negative and positive first order Chandra grating spectra were used in our analysis. The mean Chandra total HEG and MEG count rates were $`0.2134\pm 0.0015`$ and $`0.4813\pm 0.0022`$ cts/s respectively. We accumulated separate HEG and MEG grating spectra from events along the dispersion direction, and within $`\pm 3.6`$ arcseconds of the peak in the cross-dispersion direction. The source flux showed little variability over the entire duration of the campaign. For example, for HEG plus MEG lightcurves binned at 1024 s, the excess variance above the expectation for Poisson noise (e.g. see Turner et al. 1999) was $`(0.8\pm 3.7)\times 10^4`$, consistent with zero. HEG, MEG and PCA spectra were therefore extracted over the entire on-time for each instrument. This resulted in net exposure times of 57,950 s for HEG and MEG (which includes a deadtime factor of 0.0129081), and 80,624 s for the PCA.

We made effective area files (ARF, or ancillary response file) using ciao 2.1.3, which also take account of the dithering of the satellite. Photon spectra (summed over the $`\pm 1`$ orders) were made by correcting the counts spectra for the effective area and cosmological redshift, but not Galactic absorption. We also extracted counts spectra in a form suitable for use by the spectral-fitting package XSPEC (version 11.0.1) 333http://heasarc.gsfc.nasa.gov/docs/xanadu/xspec/. Again, we used first-order events only, combining the positive and negative orders but keeping the HEG and MEG spectra separate for independent analysis. The spectra were produced with a range of different bin sizes, from $`0.02\AA `$ to $`0.64\AA `$. The smaller bin sizes are appropriate for studying narrow spectral features which may be unresolved, and the larger bin sizes are better for studying broad features and the continuum. For reference, FWHM spectral resolutions of the HEG and MEG are $`0.012\AA `$ and $`0.023\AA `$ respectively. Since the MEG soft X-ray response is much better than the HEG (whose bandpass only extends down to $`0.8`$ keV) we will use the MEG as the primary instrument but refer to the HEG for confirmation of features in the overlapping bandpass and for constraining the continuum. The MEG spectral resolution corresponds to FWHM velocities of $`280,560`$, and 3,560 $`\mathrm{km}\mathrm{s}^1`$ at observed energies of 0.5, 1.0, and 6.4 keV respectively. The HEG spectral resolution corresponds to velocities of about half of these values. The response matrices acismeg1D1999-07-22rmfN0004.fits and acisheg1D1999-07-22rmfN0004.fits, combined with the ARF files described above, were used to fold models through the instrument response and thereby directly compare predicted and observed counts spectra.

We did not subtract detector or X-ray background since it is such a small fraction of the observed counts ($`<0.5\%`$ for the MEG). We treated the statistical errors on both the photon and counts spectra with particular care since the lowest and highest energies of interest can be in the Poisson regime, with spectral bins often containing a few, or even zero counts. We assign a statistical error of $`1.0+\sqrt{(N+0.75)}`$ on the number of photons, $`N`$, in a given spectral bin. This prescription, from Gehrels (1986), is a good approximation to the positive error for a Poissonian distribution, being good to better then $`1.5\%`$ for all $`N`$, but over-estimates the negative error for small $`N`$. As $`N`$ increases, the approximation tends to the Gaussian limit. It is important to bear in mind however, that even for 100 counts per bin, $`\sqrt{N}`$ still gives a statistical error which is $`10\%`$ too small (the corresponding error on the approximation at this $`N`$ is $`<0.1\%`$ – see Gehrels 1986). We were also careful not to propagate statistical errors when combining spectral orders or binning spectra. Statistical errors were always computed on numbers of photons in final bins, according to the above prescription, since the standard method of propagation of errors is only correct when the errors are Gaussian.

For the HEG data, the signal-to-noise ratio per $`0.02\AA `$ bin is $`>1`$ blueward of $`14\AA `$ and as high as $`7`$ in the $`23.5\AA `$ range. For the MEG data, in the $`225\AA `$ band which we examine here, the signal-to-noise ratio per $`0.02\AA `$ bin ranged from $`1`$ at $`20\AA `$ to a maximum of $`12`$ at $`7\AA `$. The systematic uncertainty in the energy scale is currently believed to be $`0.0028\AA `$ and $`0.0055\AA `$ for the HEG and MEG respectively444http://space.mit.edu/CXC/calib/hetgcal.html. For the MEG, at 0.5 keV, 1 keV and 6.4 keV this corresponds to velocity offsets of $`67`$, 133, and 852 $`\mathrm{km}\mathrm{s}^1`$ respectively, and about half of these values for the HEG.

## 3 Overall Spectrum and Preliminary Spectral Fitting

We used XSPEC v11.0.1 for spectral fitting to the HEG and MEG spectra in the 0.8–5 keV and 0.5–5 keV bands respectively. These energy bands will be used in all the spectral fitting in the present paper, in which we concentrate on features in the soft X-ray spectrum (less than $`2`$ keV). We used the $`C`$-statistic for finding the best-fitting model parameters, and quote 90% confidence, one-parameter statistical errors unless otherwise stated. The harder spectrum, out to 19 keV, (using simultaneous RXTE data in addition to the Chandra data) has been discussed at length in Yaqoob et al. (2002b). The hard X-ray continuum measured by Chandra MEG, HEG, and RXTE was found to be well described with a single power law in the range 2–19 keV, with no Compton-reflection continuum required, and a photon index of $`\mathrm{\Gamma }=1.674_{0.009}^{+0.008}`$, measured from the joint three-instrument spectral fits. In all the spectral fits in the present paper we shall include this hard power-law component for the continuum, with $`\mathrm{\Gamma }`$ fixed at 1.674. Detailed analysis of the Fe-K emission complex was also presented by Yaqoob et al. (2002b) so we shall not discuss this part of the spectrum further. Since we convolve all models through the instrument response before comparing with the data, all our model line-widths are intrinsic values and do not need to be corrected for the instrument broadening. This contrasts with the analysis method in some of the literature on HETGS results in which models are fitted directly to the data and then corrected for instrument broadening (e.g. Kaspi et al. 2001, 2002).

First, we show how the 0.5–5 keV MEG data compare to a simple model consisting only of the hard ($`\mathrm{\Gamma }=1.674`$) power law and Galactic absorption. For the latter, we use a value of $`4.44\times 10^{20}\mathrm{cm}^2`$ (Murphy et al. (1996)) throughout this work. Fig. 1 (a) shows the MEG photon spectrum of Mrk 509 binned at $`0.32\AA `$ with the model overlaid. The bottom panel in Fig. 1 (b) shows the ratio of the data to this model. This simple power law is clearly a poor fit to the data, with considerable complexity apparent, both in the continuum, and in terms of discrete absorption lines and possible edges. Fig. 1 clearly shows a soft X-ray excess, rising up from the hard power law (modified by Galactic absorption), below $`0.7\mathrm{keV}`$, reaching $`60\%`$ above the extrapolated hard power-law spectrum. We caution that there may still be broad residual uncertainties of $`30\%`$ or more in the calibration of the MEG effective area at the lowest energies 555http://space.mit.edu/CXC/calib/hetgcal.html. To quantify this further, we have examined Chandra HETGS data for 3C 120 (observed in 2001, December; details will be reported elsewhere). The residuals when the MEG data are fitted with a power-law plus Galactic absorption are less than 20% in the entire 0.5–5 keV band. This strongly suggests that at least part of the soft excess in Mrk 509 is real. This soft excess has been observed during simultaneous ROSAT / Ginga observations (Pounds et al. 1994), a BeppoSAX observation (Perola et al. 2000), and a recent XMM-Newton observation (Pounds et al. 2001). Both the BeppoSAX and XMM-Newton observations required a photoionized absorber as well as a soft excess. A 1994 ASCA observation on the other hand, did not require a soft excess in addition to the complex absorber (Reynolds et al. 1997; George et al. 1998).

The origin of the soft excess is unclear. It may be the tail end of some kind of soft thermal emission (or Comptonized soft thermal emission), possibly from an accretion disk (e.g. see Piro, Matt, & Ricci (1997), and references therein). Any relativistically-broadened O viii Ly$`\alpha `$ ($`\lambda 18.969\AA `$) emission that is present could also contribute to the soft excess (e.g. Branduardi-Raymont et al. 2001; Turner et al. 2001). Since the soft excess appears only in the 0.5–1 keV band of our data, we do not have enough information to constrain its origin, and sophisticated modeling of it is not warranted. Therefore, in the remainder of this paper we model the 0.5–5 keV intrinsic continuum with a broken power law in which the hard photon index, $`\mathrm{\Gamma }_1`$, above a break energy, $`E_B`$, is always fixed at 1.674 and the soft photon index, $`\mathrm{\Gamma }_2`$ (below $`E_B`$), is a free parameter, as is $`E_B`$. When the data are modeled with this continuum, there is still considerable structure in the soft X-ray spectrum, indicative of the presence of a photoionized, or ‘warm’ absorber. Now, the warm absorber in Mrk 509 and other AGN when observed with CCDs (such as those on ASCA ) has often been modeled simply with absorption edges due to O vii and O viii since the lower CCD spectral resolution did not usually warrant more sophisticated models.

In order to directly compare the new Chandra data with previous observations we modeled the MEG data with two absorption edges and the intrinsic continuum described above. The energies and optical depths (at threshold) of the two absorption edges were allowed to float. The best-fitting model overlaid on the MEG photon spectrum is shown in Fig. 2 . The best-fitting parameters obtained from this model were $`0.732_{0.019}^{+0.004}\mathrm{keV}`$ and $`0.871_{0.020}^{+0.014}\mathrm{keV}`$ for the threshold energies of O vii and O viii respectively. For the the optical depths at threshold we obtained $`\tau =0.30_{0.04}^{+0.04}`$ and $`0.14_{0.03}^{+0.05}`$ for O vii and O viii respectively. All quantities refer to the rest frame of Mrk 509 . The best-fitting soft X-ray photon index was 2.06 and the break energy was 1.28 keV. The measured edge energies are in good agreement with the expected values (0.739 keV and 0.871 keV for O vii and O viii respectively), although the O vii edge is marginally inconsistent at a confidence level of 90% or greater. We can compare the threshold optical depths with those measured from the 1994 ASCA observation (Reynolds 1997): $`0.11_{0.03}^{+0.04}`$ (O vii ) and $`0.04_{0.04}^{+0.04}`$ (O viii ). The MEG values are larger (although they are consistent with lower signal-to-noise measurements from BeppoSAX data (Perola et al. 2000), which has much lower spectral resolution). However, it is known that the apparent optical depths of the O vii and O viii edges are variable in some AGN (e.g. Otani et al. 1996; Guainazzi et al. 1996). Also, since the spectrum is so complex around the regions of the O vii and O viii edges, optical depths derived from simple models should be interpreted with caution. We will show in §5 that photoionization models can adequately describe the data with smaller values of the O vii and O viii edge depths. Even the heavily binned spectrum in Fig. 2 shows a discrete feature at 0.922 keV (rest frame) corresponding to Ne ix resonance absorption. This causes the O viii edge to be somewhat deeper than that which would be obtained if the Ne ix resonance absorption were not present. Additionally, Fe M-shell unresolved transition arrays (UTAs), which have been observed in Mrk 509 and some other sources (e.g. Pounds et al. 2001; Sako et al. 2001b; Lee et al. 2001; Kaspi et al. 2002; Kaastra et al. 2002), may at some level affect the inferred column densities of both O vii and O viii.

These factors which affect the apparent O vii and O viii edge depths obtained from simple modeling clearly have an impact on the puzzling results from variability studies. For example, Otani et al. (1996) found that in the Seyfert 1 galaxy MCG $``$6$``$30$``$15, the O viii edge depth varied (in response to the continuum) whilst the O vii edge depth remained constant. In contrast, Guainazzi et al. (1996) found that the O vii edge was variable whilst the O viii edge depth remained constant. For MCG $``$6$``$30$``$15, Morales, Fabian, & Reynolds (2000) proposed a solution consisting of multiple, spatially separated zones to explain these results. The higher spectral resolution Chandra data shows that these issues need to be revisited. Indeed, as has been pointed out by Lee et al. (2001), more recent Chandra observations of MCG $``$6$``$30$``$15 suggest that the O viii edge in this source is complicated by Ne ix resonance absorption, as well as a complex of lines from Fe xvii and Fe xviii .

## 4 Spectral Features and Kinematics

### 4.1 Absorption and Emission Lines

In order to best illustrate different characteristics of the spectrum we display the spectral data in several different ways. In Fig. 3 we show the MEG photon spectrum below $`1.4`$ keV, as a function of observed energy, along with the deduced intrinsic broken power-law continuum (not corrected for Galactic absorption), as derived from the the best-fitting photoionization model described in §5. The solid red curve in Fig. 3 is the photoionization model itself (the details of which are deferred to §5). The data and the models in Fig. 3 are all absorbed by the Galactic column density. An important point to realize from Fig. 3 is that in some regions the spectrum is so complex that it is difficult to distinguish absorption from emission. For example, at observed energies between $`0.70.8`$ keV, there appears to be a complex emission feature relative to the local two-edge model continuum in Fig. 2 but from Fig. 3 it is clear that the peak flux of this feature (between $`0.78`$–0.79 keV, observed) coincides with the inferred intrinsic continuum, implying that the apparent feature is simply due to the presence of broad absorption complexes on either side of it. Also, there is a sharp variation in the MEG effective area at $`0.8`$ keV and any uncertainties here could manifest themselves as apparent spectral features (see §5 for further discussion).

In Fig. 4 and Fig. 5 we show the MEG and HEG spectra respectively, this time as a function of wavelength in the source rest-frame, redward of $`2\AA `$. These spectra have a bin size of $`0.02\AA `$, approximately the FWHM MEG spectral resolution ($`0.023\AA `$). Below each panel showing the data is the signal-to-noise ratio (SNR) in each bin, so that one can easily guage the statistical significance of any spectral features. The same MEG data are also displayed in Fig. 6 and Fig. 7 . In Fig. 6 we overlay the Lyman series (blue) for H-like N, O, Ne, Mg, Si, S, Ar and the corresponding He-like triplets (red) that lie in the 2-25$`\AA `$ range. In Fig. 7 we overlay the He-like resonance series lines (blue) to the $`n=1`$ level for the same elements, and in addition the Balmer lines (red) of the hydrogenic ions of Si, S, and Ar.

Referring to Figs. 3 to 7, we see that the strongest, clear discrete spectral features detected are absorption lines due to N vii Ly$`\alpha `$ ($`\lambda 24.781\AA `$) , N vii Ly$`\beta `$ ($`\lambda 20.910\AA `$) , O viii Ly$`\alpha `$ ($`\lambda 18.969\AA `$) , Ne ix (r) $`\mathit{1}s^\mathit{2}\mathit{1}s\mathit{2}p`$ ($`\lambda 13.447\AA `$), Ne ix (r) $`\mathit{1}s^\mathit{2}\mathit{1}s\mathit{3}p`$ ($`\lambda 11.549\AA `$), Ne x Ly$`\alpha `$ ($`\lambda 12.134\AA `$) , and Mg xi (r) $`\mathit{1}s^\mathit{2}\mathit{1}s\mathit{2}p`$ ($`\lambda 9.169\AA `$). Some strong Fe absorption lines are also detected. Weaker absorption lines are also apparent from the spectra, such as higher order Lyman lines of O and Ne (there is evidence for transitions up to $`n=5`$ in each case). Higher signal-to-noise X-ray spectroscopy of NGC 3783 (Kaspi et al. 2002) has shown that blending of absorption features considerably complicates the spectrum. In particular, lines from Fe xvii , Fe xix , and Fe xxi are likely to be blended with the absorption troughs at $`11.5,12.1,13.4,16.0\AA `$ in the Mrk 509 spectrum. We note that we do not detect absorption from the highest ionization states of elements beyond Ne, like Si xiv Ly$`\alpha `$ ($`\lambda 6.182\AA `$) (see Fig. 6 ). Thus, the ionization state of the absorber cannot be so high that Si xiv is abundant.

Apart from Fe K$`\alpha `$ and some tentative emission features at $`9.3,9.6,9.8,12.6\AA `$ (possibly attributable to Fe xix ), no other emission-line features are clearly identifiable. In particular, we do not detect the O vii He-like triplet, which was detected during an XMM-Newton observation, by Pounds et al. (2001). In §6 we shall give a more detailed comparison with the XMM-Newton observation.

The presence of broad, bound-free absorption features and many narrow features which may be blended, makes it impossible to define an observed continuum for much of the spectrum, and therefore difficult to measure meaningful equivalent widths of even the strongest narrow absorption features. Rather than try to measure equivalent widths of all candidate features, and compare with model predictions, we will take the physically more direct approach of fitting photoionization models to the data (§5). Nevertheless, in the process of measuring the observed energies of the strongest discrete absorption features, we did attempt to measure the equivalent widths of some absorption lines. The measurements were made using the broken power law plus two-edge model as the baseline spectral model (see §3) and Gaussians to model the absorption lines. The continuum and edge parameters were frozen at the best-fitting values given in §3, and the data were fitted over a few hundred eV centered on the feature of interest. The fitted range of the data was extended down to 0.47 keV in order to measure the parameters of N vii Ly$`\alpha `$ ($`\lambda 24.781\AA `$) . Initially the *intrinsic* width of each Gaussian was frozen at less than the instrumental resolution but then allowed to float in order to investigate whether the lines were resolved. The results for the measured energies, apparent velocity shifts relative to systemic, equivalent widths, and intrinsic widths, of these strongest absorption features are given in Table 1. Note that the quoted equivalent widths are relative to the intrinsic continuum. Again, we caution that the measured equivalents widths are subject to uncertainties in the continuum, line-blending, and any complexity in the line profile. It is instructive to compare line strengths with a physical model so, also given in Table 1 are the predicted equivalent widths from the best-fitting photoionization model discussed in §5.

### 4.2 Absorption-Line Velocity Profiles

Table 1 shows that all of the measured absorption lines are blueshifted, with Gaussian-fitted centroids ranging from near systemic velocity to $`600`$ $`\mathrm{km}\mathrm{s}^1`$. However, some of the velocity profiles appear to be more complex than Gaussian, as can be seen from Fig. 8 (which shows the profiles of Ne x Ly$`\alpha `$ ($`\lambda 12.134\AA `$) , Ne ix (r) $`\mathit{1}s^\mathit{2}\mathit{1}s\mathit{2}p`$ ($`\lambda 13.447\AA `$), Mg xi (r) $`\mathit{1}s^\mathit{2}\mathit{1}s\mathit{2}p`$ ($`\lambda 9.169\AA `$), and O viii Ly$`\alpha `$ ($`\lambda 18.969\AA `$) ). They are centered with zero at the systemic velocity of Mrk 509 , with positive and negative velocities corresponding to redshifts and blueshifts respectively. The velocity profiles were obtained from combined HEG and MEG data except for the O viii Ly$`\alpha `$ ($`\lambda 18.969\AA `$) profile which was determined using MEG data only, since at this energy the HEG effective area is negligible. It can be seen from Table 1 and Fig. 8 that the velocity offset for all of the absorption lines is consistent with $`200`$ $`\mathrm{km}\mathrm{s}^1`$, except for the the Mg xi (r) resonance line. The latter has an apparent minimum at $`600`$ $`\mathrm{km}\mathrm{s}^1`$ which may indiciate a truly different absorption-line profile, or the different offset velocity may be an artifact of contamination from other absorption lines, or there may be emission filling in a trough at $`200`$ $`\mathrm{km}\mathrm{s}^1`$.

Table 1 also shows that Ne x Ly$`\alpha `$ ($`\lambda 12.134\AA `$) and Ne ix $`\mathit{1}s^\mathit{2}\mathit{1}s\mathit{2}p`$ ($`\lambda 13.447\AA `$) lines appear to be marginally resolved, whilst all the other lines are unresolved (FWHM$`<300`$ $`\mathrm{km}\mathrm{s}^1`$ for the lightest elements, going up to FWHM$`<1030`$ $`\mathrm{km}\mathrm{s}^1`$ for Mg). The Ne x Ly$`\alpha `$ ($`\lambda 12.134\AA `$) line is particularly interesting because we obtain a different centroid offset velocity depending on whether the Gaussian model has an intrinsic width fixed at a value much less than the instrument resolution, or whether the intrinsic width is a free parameter. The latter gives a marginally better fit ($`\mathrm{\Delta }C=4.0`$), with an offset of $`210`$ $`\mathrm{km}\mathrm{s}^1`$, and a broad line, but still with FWHM $`<1330`$ $`\mathrm{km}\mathrm{s}^1`$. The narrow-line fit gives a higher blueshift, but in both cases the lower limit on the velocity offset is the same, at $`400`$ $`\mathrm{km}\mathrm{s}^1`$. This is indicative of a complex velocity profile. However, the MEG FWHM velocity resolution goes from $`280`$ $`\mathrm{km}\mathrm{s}^1`$ for the lowest-energy transitions (Nitrogen lines), up to $`730`$ $`\mathrm{km}\mathrm{s}^1`$ for the highest-energy transition (Mg xi (r) ) so any apparent structure in the profiles should be interpreted with caution. The resolution at Ne x Ly$`\alpha `$ ($`\lambda 12.134\AA `$) is 550 $`\mathrm{km}\mathrm{s}^1`$, FWHM. The complexity in the velocity profiles, if real, may either be intrinsic or due to contamination from other absorption and/or emission features. The intrinsic complexity could be due, for example, to the presence of several kinematic components, making different contributions to the overall profile, as is the case for UV lines (see §7).

Fig. 8 (a) shows that the broad trough in the Ne x Ly$`\alpha `$ ($`\lambda 12.134\AA `$) profile, centered at $`200`$ $`\mathrm{km}\mathrm{s}^1`$, extends redward of the systemic velocity, perhaps by up to $`+400`$ $`\mathrm{km}\mathrm{s}^1`$. Fig. 8 (b) is centered around the Ne ix (r) $`\mathit{1}s^\mathit{2}\mathit{1}s\mathit{2}p`$ ($`\lambda 13.447\AA `$) transition and the velocity profile appears to be much more asymmetric than Ne x Ly$`\alpha `$ ($`\lambda 12.134\AA `$) , having a clear, single minimum at $`200`$ $`\mathrm{km}\mathrm{s}^1`$. The profile of Ne ix (r) ($`\lambda 13.447\AA `$) appears to be just as broad as Ne x Ly$`\alpha `$ ($`\lambda 12.134\AA `$) , however. Fig. 8 (c) shows the velocity profile for Mg xi (r) $`\mathit{1}s^\mathit{2}\mathit{1}s\mathit{2}p`$ ($`\lambda 9.169\AA `$) which appears to have two minima, one at $`600`$ $`\mathrm{km}\mathrm{s}^1`$ and the other at systemic. It is possible that the profile is really the same as that of Ne ix (r) ($`\lambda 13.447\AA `$), with the trough contaminated by emission. The velocity profile of O viii Ly$`\alpha `$ ($`\lambda 18.969\AA `$) shown in Fig. 8 (d), is very similar to that of Mg xi (r) ($`\lambda 9.169\AA `$), with two minima at the same velocities, except that the contrast of the minima with the center of the profile is not so high.

Fig. 9 shows velocity spectra centered on several atomic transitions that are not significantly detected in the data (Na xi Ly$`\alpha `$ ($`\lambda 10.025\AA `$) , Ar xviii Ly$`\alpha `$ ($`\lambda 3.733\AA `$) , Mg xii Ly$`\alpha `$ ($`\lambda 8.421\AA `$) , Si xiv Ly$`\alpha `$ ($`\lambda 6.182\AA `$) ). The abundances of Na and Ar are small compared to Oxygen and Neon for example, partially accounting the absence of features due to these ions. There is a hint of Mg xii Ly$`\alpha `$ ($`\lambda 8.421\AA `$) absorption but it is very weak if present. Si xiv Ly$`\alpha `$ ($`\lambda 6.182\AA `$) is clearly not present in absorption in the data, although there is a hint of emission. Since the cosmic abundances of Silicon and Magnesium are similar, and since we see Mg xi (r) but we do not see Si xiv Ly$`\alpha `$ ($`\lambda 6.182\AA `$) , this constrains the ionization state of the absorber and will therefore be important for photoionization modeling, discussed in §5.

The velocity profiles in Fig. 8 are reminiscent of Chandra observations of absorption features in other AGN. The absorption is generally blueshifted with respect to the systemic velocity and there is evidence of multiple kinematic components and multiple ionization states (e.g. NGC 4051, Collinge et al. 2001; NGC 3783, Kaspi et al. 2002; NGC 5548, Kaastra et al. 2002, Yaqoob et al. 2002a). Due to the limited spectral resolution of Chandra , it is possible that there are actually many unresolved kinematic components making up the velocity profiles and we shall return to this point in §7 where we examine the relationship between the X-ray and UV absorbers.

## 5 Photoionization Modeling

We used the photoionization code XSTAR 2.1.d to generate several grids of models of emission and absorption from photoionized gas in order to directly compare with the data. In Paper II CLOUDY was used to model the UV data. We used the default solar abundances in XSTAR and CLOUDY. For reference, these abundances are given in Table 2.

### 5.1 The Spectral Energy Distribution

First, we constructed a spectral energy distribution (SED) for Mrk 509 as follows. Average radio and infrared fluxes were obtained from Ward et al. (1987). UV fluxes were obtained from our HST/STIS spectrum, observed simultaneously with Chandra, from continuum regions centered on 1181, 1366, 1510, 2291, and $`3013\AA `$ (observed frame). The fluxes were dereddened using the Galactic reddening curve of Savage & Mathis (1979) and a reddening value of E(B$``$V) $`=`$ 0.08, corresponding to the observed H I Galactic column (Shull & Van Steenberg 1985). Further details of the UV data analysis can be found in Paper II. In principle the X-ray portion of the SED must be derived iteratively because the intrinsic X-ray continuum can only be deduced from fitting the data self-consistently with a model of the absorption (which is complex and affects the X-ray data over a broad energy range, up to nearly 2 keV). In practice we implemented a two-step process to obtain a fiducial SED and then investigated the effects of adjusting this SED in a manner described below. For the first of the two steps, we started with an SED in which the X-ray spectrum was a single power law with a photon index of 1.674 (consistent with Chandra / RXTE data above 2 keV; see Yaqoob et al. 2002b), extrapolated down to 0.5 keV. The 0.5 keV point was then simply joined onto the last UV point by a straight line in log-log space (this corresponds to a slope of $`1.44`$ in $`L_\nu `$ versus $`\nu `$). The hard X-ray power law in this and subsequent SEDs extended out to 500 keV. Grids of photoionization models (details of which are given below) were then generated using this initial SED and the Chandra MEG and HEG data were then fitted below 5 keV using a broken power law model for the intrinsic continuum, modified by the photoionized absorber and Galactic absorption. The hard power-law index was kept fixed at $`\mathrm{\Gamma }_1=1.674`$. We obtained a soft power-law index of $`\mathrm{\Gamma }_2=2.19`$ and a break energy of 1.05 keV. In the second step, we used the broken power-law, with the above parameters (and normalization obtained from the spectral fit), for the X-ray portion of the SED, down to 0.5 keV. Again, we connected the 0.5 keV point to the last UV point by a straight line in log-log space. The resulting SED is shown in Fig. 11 (filled circles connected by solid lines). The dashed curves show variations on this SED, constructed by raising and lowering the flux at 55 eV (the energy required to doubly ionize He) by a factor 1.5. These latter two SEDs will be used to investigate the effects of uncertainties in the unobserved part of the SED by comparing with the results obtained with the baseline SED. Also shown in Fig. 11 is the ‘mean AGN’ SED derived by Matthews & Ferland (1987).

### 5.2 Model Grids

The photoionization model grids used here are two-dimensional, corresponding to a range in values of equivalent neutral Hydrogen column density, $`N_\mathrm{H}`$, and the ionization parameter, $`\xi =L_{\mathrm{ion}}/(n_er^2)`$ erg cm $`s^1`$. Here $`L_{\mathrm{ion}}`$ is the ionizing luminosity (in $`\mathrm{erg}\mathrm{s}^1`$), in the range 1 to 1000 Rydbergs, $`n_e`$ is the electron density in $`\mathrm{cm}^3`$, and $`r`$ is the distance of the illuminated gas from the ionizing source in cm 666In Paper II a different ionization parameter is used, $`UQ_{\mathrm{ion}}/(4\pi n_ecr^2)`$. Here $`Q_{\mathrm{ion}}`$ is the number of ionizing photons above 1 Rydberg, $`c`$ is the speed of light, and $`n_e`$ and $`r`$ have the same meaning as for $`\xi `$. From our baseline SED, the conversion factor is $`U=0.03208\xi `$, or $`\mathrm{log}U=\mathrm{log}\xi 1.49`$. Therefore, our best-fitting value of $`\mathrm{log}\xi =1.76`$ corresponds to $`U=1.85`$, or $`\mathrm{log}U=0.27`$.. The grids were computed for equi-spaced intervals in the logarithms of $`N_\mathrm{H}`$ and $`\xi `$, which ranged from $`5\times 10^{20}5\times 10^{22}\mathrm{cm}^2`$ and $`0.52.5`$ respectively. The X-ray data cannot constrain the electron density since we do not detect any suitable emission lines, so we fixed $`n_e`$ at $`10^8\mathrm{cm}^3`$ in most of the grids. For diagnostic purposes, some grids were constructed with $`n_e`$ as low as $`10^2\mathrm{cm}^3`$ and as high as $`10^{11}\mathrm{cm}^3`$. We confirmed that results from fitting the photoionizied absorber models to the X-ray data were indistinguishable for densities in the range $`n_e=10^2\mathrm{cm}^3`$ to $`10^{11}\mathrm{cm}^3`$. Hereafter all XSTAR models discussed correspond to a density of $`10^8\mathrm{cm}^3`$, unless otherwise stated. This value is arbitrary and does not signify any preference for high densities.

Finally, all models assumed a velocity turbulence ($`b`$-value) of $`1`$ $`\mathrm{km}\mathrm{s}^1`$, and since XSTAR broadens lines by the greater of the turbulent velocity and the thermal velocity, it is the latter which is relevant for these models. As the turbulent velocity increases, the equivalent width of an absorption line increases for a given column density of an ion. Therefore, to calculate model equivalent widths correctly one must know what the velocity width is (note that the $`b`$-value could represent all sources of line-broadening). We cannot simply extend the XSTAR model grids into another dimension (velocity width), and deduce a $`b`$-value directly from model-fitting, because we are limited by the finite internal energy resolution of XSTAR. The widths of the energy bins of the XSTAR model grids are in the range $`200600`$ $`\mathrm{km}\mathrm{s}^1`$. Our choice of velocity width ($`b`$-value corresponding to the thermal width) ensures that the energy resolution of XSTAR is the limiting factor and not the $`b`$-value itself. We will then need to take a rather more complicated approach to model-fitting, which we describe in §5.3 below.

### 5.3 Model-Fitting

We proceeded to fit the MEG and HEG spectra (binned at $`0.08\AA `$) simultaneously, with all corresponding model parameters for the two instruments tied together, except for the relative normalizations. The intrinsic continuum was a broken power law (the hard photon index again fixed at 1.674) modified by absorption from photoionized gas and the Galaxy. Excluding overall normalizations, there were a total of four free parameters, namely the column density of the warm absorber, $`N_H`$, the ionization parameter, $`\xi `$, the intrinsic soft photon index, $`\mathrm{\Gamma }_2`$, and the break energy of the broken power-law continuum, $`E_\mathrm{B}`$.

Our model-fitting strategy is more complicated than simply comparing the XSTAR model spectra with the data since the XSTAR spectra assume a certain line width ($`b`$-value), which itself is limited by the finite internal energy resolution of XSTAR. We chose $`b=1\mathrm{km}\mathrm{s}^1`$ in order that the energy resolution of XSTAR is the limiting factor. The result is that the equivalent widths of lines in the XSTAR spectra need to be calculated more rigorously using a line width ($`b`$-value) appropriate for the data. On the other hand, the ionic columns in the XSTAR models are robust from this point-of-view and do not depend on the velocity width. Therefore, after finding the best-fitting ionization parameter and warm-aborber column density from a global fit using the model described above, in § 5.4 we will deduce a $`b`$-value from a curve-of-growth analysis, using ionic column densities from the best-fitting global model. We will then construct detailed model profiles for each of the detected absorption lines.

The best-fitting parameters derived from the XSTAR global model fits were $`N_H=2.06_{0.45}^{+0.39}\times 10^{21}\mathrm{cm}^2`$ and $`\mathrm{log}\xi =1.76_{0.14}^{+0.13}`$ ergs cm $`\mathrm{s}^1`$ (or $`\mathrm{log}U=0.27`$). The broken power law model corresponding to this best fit had a break energy of $`E_\mathrm{B}=0.95_{0.09}^{+0.15}\mathrm{keV}`$ and a soft power-law photon index of $`\mathrm{\Gamma }_1=2.36_{0.20}^{+0.21}`$, values which are consistent with the SED that was used as input to the models. Fig. 12 shows the best-fitting model folded through the MEG response and overlaid onto the MEG counts spectrum. The lower panel of Fig. 12 shows the ratio of the data to the best-fitting model. Fig. 13 shows the actual best-fitting XSTAR model before folding through the instrument response. Fig. 14 shows the 68%, 90%, and 99% joint confidence contours of $`\mathrm{log}\xi `$ versus $`N_H`$. Overall, the fit is very good and it is already apparent that the best-fitting parameters which describe the overall spectrum also give good fits to the most prominent absorption lines and edges. This can also be seen in Fig. 3 which shows the best-fitting model overlaid on the photon spectrum, and in Fig. 8 and Fig. 9 which show close-ups of the data and model (in velocity space), centered on particular atomic transitions. We note that formally, a second solution with a higher column density ($`3\times 10^{21}\mathrm{cm}^2`$) but similar ionization parameter is also viable, but the best-fitting break energy of the intrinsic continuum is at $`2.15\pm 0.25`$ keV, inconsistent with the input SED and with the measured value for the first solution. We can therefore eliminate this second solution.

The main driver of these broadband fits is the overall shape of the observed spectrum, but the narrow absorption lines, and the absorption edges also affect the fits. Since the centroids of the absorption lines are blueshifted, a velocity offset had to be applied to the XSTAR model. Although the velocity offsets may be different for different absorption lines (see §4.2), the signal-to-noise of the data is such that anything more complex than a single velocity offset for all the absorption lines is not warranted. We therefore applied a nominal velocity offset of $`200`$ $`\mathrm{km}\mathrm{s}^1`$ relative to systemic, which was satisfactory for all of the absorption features. We had to apply an additional (but non-physical) correction of $`270`$ $`\mathrm{km}\mathrm{s}^1`$. The reason for the latter offset is that the code XSTAR v2.1.d contains hard-wired wavelengths of some atomic transitions which disagree with wavelengths published elsewhere 777For example, in the Atomic Line List (at http://www.pa.uky.edu/ peter/atomic/).. We found that a single, simple offset of $`270`$ $`\mathrm{km}\mathrm{s}^1`$ was required and Fig. 3 shows that this gives an excellent fit for all the detected absorption lines (reported in Table 1), except possibly Mg xi (r) $`\mathit{1}s^\mathit{2}\mathit{1}s\mathit{2}p`$ ($`\lambda 9.169\AA `$). The latter has negligible impact on the spectral fit, given the signal-to-noise of the data. The fact that the individual model line profiles give good fits to the data (Fig. 8 ), and were calculated using the ionic column densities from the best-fitting XSTAR model, published wavelengths, and the deduced $`b`$-value (see §5.4), shows that the various assumptions are good for our purpose.

We mentioned in §3 that the 2.0–2.5 keV region in the Chandra spectra suffers from systematics as large as $`20\%`$ in the effective area due to limitations in the calibration of the X-ray telescope absorption edges in that region 888http://asc.harvard.edu/udocs/docs/POG/MPOG/node13.html. We therefore omitted the 2.0–2.5 keV regions of the Chandra spectra during the spectral fitting so that the fits would not be unduly biased. These and other instrumental absorption edges can be seen in the upper panel of Fig. 12 . All the MEG data in the 0.5–5 keV band are shown here, although the 2.0–2.5 keV region was omitted during spectral fitting. Other regions which have sharp changes in the effective area also show notable mismatches between data and model, but these are not as bad as in the 2.0–2.5 keV region. In particular, the region between $`0.760.81`$ keV shows an apparent broad emission feature. However, the entire region in the $`0.70.9`$ keV is spectrally very complex (see Fig. 3 ). We also mentioned in §4.1 that the peak of the apparent emission between 0.78–0.79 keV (observed) actually coincides with the intrinsic continuum (Fig. 3 ) so could be the result of a lack of absorption rather than an emission feature. However we see that our best-fitting XSTAR model actually predicts absorption due to O viii Ly$`\gamma `$ and Fe xvii (at an observed energy of $`0.780.79`$ keV, or $`0.810.82`$ keV rest-frame). This implies that there must be some emission features in the data. We were not able to model this emission with the emitted spectra from the XSTAR models, even with $`\xi `$ and $`N_H`$ unconstrained (without over-predicting other features which are not observed). Note that there is also emission (above the intrinsic continuum) at 0.80 keV (0.828 keV rest-frame); Fe xvii and Fe xviii lines are possible candidates. However, we should remember that the region of the spectrum around $`0.8`$ keV does coincide with a sharp change in the MEG effective area (Fig. 12 ) so it is likely that the poor fit here may in part be due to calibration uncertainties. Nevertheless, we confirmed that omitting the data in the region $`0.760.81`$ keV had a negligible effect on the derived best-fitting model parameters, so we decided to retain the data in this region since the uncertainties are certainly not as large as those in the 2–2.5 keV region.

### 5.4 Detailed Comparison of Data and Photoionization Model

In this section we compare in detail the best-fitting XSTAR photoionized absorber model and the data (refer to Fig. 3 for the spectrum, and to Fig. 8 and Fig. 9 for some ‘velocity spectra’). Note that although the best-fitting model was derived using spectra binned at $`0.08\AA `$, we can compare the model and data at higher spectral resolution, depending on the signal-to-noise of the feature in question. As discussed in §4.1 the strongest absorption-line features in the Chandra data are N vii Ly$`\alpha `$ ($`\lambda 24.781\AA `$) , N vii Ly$`\beta `$ ($`\lambda 20.910\AA `$) , O viii Ly$`\alpha `$ ($`\lambda 18.969\AA `$) , Ne ix (r) $`\mathit{1}s^\mathit{2}\mathit{1}s\mathit{2}p`$ ($`\lambda 13.447\AA `$), Ne x Ly$`\alpha `$ ($`\lambda 12.134\AA `$) , Ne ix (r) $`\mathit{1}s^\mathit{2}\mathit{1}s\mathit{3}p`$ ($`\lambda 11.547\AA `$), and Mg xi (r) $`\mathit{1}s^\mathit{2}\mathit{1}s\mathit{2}p`$ ($`\lambda 9.169\AA `$) (see also Table 1). No strong, identifiable emission features were found below 5 keV. Fig. 3 shows that the best-fitting XSTAR model described above ($`N_H=2.06\times 10^{21}\mathrm{cm}^2`$, $`\mathrm{log}\xi =1.76`$ \[or $`\mathrm{log}U=0.27`$\]) predicts the strength of all these absorption lines very well, despite the fact that in this direct comparison the model equivalent widths have not been computed for the correct line width ($`b`$-value), as explained at the end of §5.3.

In order to determine what the appropriate $`b`$-value might be, we calculated curves-of-growth for different values of $`b`$ (see Fig. 10 ). We can see from Table 1 that all the Ly $`\alpha `$ transitions from H-like and He-like ions have approximately the same measured equivalent widths, within errors. This suggests that all of these lines are on the saturated part of the curve-of-growth. The theoretical curves-of-growth in Fig. 10 indicate that the measured equivalent widths of $`10^3\AA `$ are all consistent with $`b100\mathrm{km}\mathrm{s}^1`$. This is a rather model-independent conclusion since this deduction does not utilize any information from the XSTAR modeling. We also plotted the measured equivalent widths from Table 1 (converted to Angstroms) as a function of ionic column density (from the best-fitting XSTAR model described above) and overlaid these on the curves-of-growth (Fig. 10 ). This again illustrates that, for solar abundances, all the measurements are consistent with $`b=100`$ $`\mathrm{km}\mathrm{s}^1`$ (except possibly O viii Ly$`\alpha `$ ($`\lambda 18.969\AA `$) ). The predicted equivalent widths for $`b=100`$ $`\mathrm{km}\mathrm{s}^1`$ are shown in Table 1 so that they can be compared directly with the observed equivalent widths.

The velocity profiles in Fig. 8 (for four of the strongest absorption lines: Ne x Ly$`\alpha `$ ($`\lambda 12.134\AA `$) , Ne ix (r) ($`\lambda 13.447\AA `$), Mg xi (r) ($`\lambda 9.169\AA `$), & O viii Ly$`\alpha `$ ($`\lambda 18.969\AA `$) ) also show very good agreement between data and model. In this case the model curves were calculated using the broken power-law and two-edge continuum described in §3, a Gaussian for the absorption line, with $`\sigma =b/\sqrt{2}=70.7`$ $`\mathrm{km}\mathrm{s}^1`$, and an equivalent width from Table 1. Fig. 9 illustrates that some features not predicted by the model are indeed not detected in the data (as would be expected from the low ionic columns in Table 3). These include Ar xviii Ly$`\alpha `$ ($`\lambda 3.733\AA `$) , Na xi Ly$`\alpha `$ ($`\lambda 10.025\AA `$) , Mg xii Ly$`\alpha `$ ($`\lambda 8.421\AA `$) and Si xiv Ly$`\alpha `$ ($`\lambda 6.182\AA `$) . These are all higher ionization features (and Na and Ar have relatively low abundance) so we can see that the absence of features from these ions in the data contributes to the strong constraints on the ionization parameter. Thus, our single-component photoionization model gives surprisingly good fits to the principal absorption lines.

There are many more discrete absorption features apparent in the spectra but with lower signal-to-noise. Although these individual weak features cannot be studied in detail we can at least check whether the best-fitting XSTAR model does not conflict with the data. We found that, as far as narrow absorption lines are concerned, all absorption lines predicted by the model were consistent with the data, with the exception of the 0.78–0.79 keV (observed) region, which has already been discussed in §3 and §4.1 (see Fig. 3 ). In particular, we found that the model agrees well with the data for the low-order Lyman transitions of Ne and O. The first five O vii $`1snp`$ resonance lines also agree well with the data (the rest are too weak). Conversely, the data show possible absorption features which are not predicted by the model, but none of these are statistically significant.

Fig. 3 also shows that the best-fitting XSTAR model is good at the O vii edge but could be better if the edge were deeper since the flux just above the edge is somewhat over-predicted. We note that the Fe ionic columns predicted by the best-fitting XSTAR model are largest for ionization states Fe xiv to Fe xix (see Table 3). According to Behar, Sako, & Khan (2001), this should yield an Fe M-shell unresolved transition array (UTA) in the energy region of interest. This has in fact has been detected by XMM-Newton in Mrk 509 (Pounds et al. 2001), albeit at lower energy (centered at $`0.77`$ keV, rest-frame; 0.744 keV, observed-frame), corresponding to lower ionization states dominated by Fe xi-xii. Such UTAs have also been detected in some other Seyfert 1 galaxies (IRAS 13349$`+`$2438, Sako et al. 2001b; MCG $``$6$``$30$``$15, Lee et al. 2001; NGC 3783, Kaspi et al. 2002; NGC 5548, Kaastra et al. 2002). Fe L-shell absorption could also be present near the O vii (and the O viii edge) due to neutral Fe locked up in dust (see Fig. 3 ) and this is not modeled by XSTAR. Such a scenario was proposed by Lee et al. (2001) for MCG $``$6$``$30$``$15 . However, we do not see evidence for these Fe L edges in Mrk 509 and this is consistent with the amount of reddening, which corresponds to a threshold optical depth of the neutral Fe L3 edge of $`0.02`$, not detectable by the MEG. The complex of O vii $`1s^21snp`$ resonance transitions with $`n>5`$ may also complicate the region just above the O vii edge (see also Lee et al. 2001). We also point out that the data around $`1.021.04\mathrm{keV}`$ are not well-fitted by the model (see Fig. 3 ). However the break energy of the broken power law is at 1.04 keV (observed frame), and the break in the model spectrum is rather sharp so a more physical model of the continuum may fit better.

The best XSTAR model absorber fit around the O viii edge and the Ne ix (r) ($`\lambda 13.447\AA `$) absorption line (which is not far blueward of the O viii edge) is much better than the fit in the O vii edge region. In §3 we mentioned how spectral fits using simple absorption-edge models (representing O vii and O viii) could be misleading. We see that more sophisticated modeling with better data now gives a smaller O viii edge since the data above the O viii edge are affected by other absorption features (Ne ix (r) ($`\lambda 13.447\AA `$) in particular) which can be accounted for by the photoionization models. This has also been pointed out by Lee et al. (2001). However, the edge depth may still be over-estimated due to the presence of Fe inner shell UTAs. From the XSTAR models we can extract the O vii and O viii ionic column densities at the extremes of the $`90\%`$ confidence intervals for $`N_H`$ versus $`\xi `$. We find that the O vii column is $`3.5_{1.7}^{+2.7}\times 10^{17}\mathrm{cm}^2`$ and the O viii column is $`8.1_{2.1}^{+1.1}\times 10^{17}\mathrm{cm}^2`$. Given an absorption cross-section at threshold of $`2.75(1.09)\times 10^{19}\mathrm{cm}^2`$ for O vii (O viii ) (Verner & Yakovlev (1995)), we find that the model optical depths (at threshold) of the O edges are $`\tau _{\mathrm{O}\mathrm{vii}}=0.10_{0.05}^{+0.07}`$ and $`\tau _{\mathrm{O}\mathrm{viii}}=0.09_{0.02}^{+0.01}`$ respectively. These values can be compared with those obtained from a Mrk 509 ASCA observation in 1994 in which simple ‘edge-models’ yielded $`\tau _{\mathrm{O}\mathrm{vii}}=0.11_{0.04}^{+0.03}`$ and $`\tau _{\mathrm{O}\mathrm{viii}}=0.04_{0.03}^{+0.04}`$ (Reynolds (1997); see also George et al. 1998). Whilst the O vii optical depth is consistent, the O viii optical depth is only marginally consistent. However, variability of the warm absorber has been observed in several AGN and Mrk 509 may be no exception.

We investigated the robustness of the XSTAR model fits to the absorption features by examining the data versus model at the extremes of the $`N_H`$ versus $`\xi `$ confidence intervals (see Fig. 14 ). By picking pairs of values of $`N_H`$ and $`\xi `$ in the plane of the contours, we can freeze the column density and ionization parameter at the chosen values and find the new best-fit for each pair of values (this is in fact how such contours are constructed). Then we can examine the data and model spectra in detail for each of these new fits to see where the model and data deviate significantly from each other. We found that the models were still able to account for the strengths of all of the strong absorption-line features (listed in Table 1) for pairs of $`N_H`$ and $`\xi `$ lying inside the 68% confidence contour. On the other hand, for pairs of $`N_H`$ and $`\xi `$ lying near the 99% contour we found that the Ne x Ly$`\alpha `$ ($`\lambda 12.134\AA `$) absorption line was particularly sensitive and the equivalent width would be over-predicted or under-predicted by as much as a factor of two. Therefore, we conclude that the confidence contours in Fig. 14 are conservative, and the true parameter space for the allowed range of $`N_H`$ and $`\xi `$ is even more restricted than the 99% confidence contours in Fig. 14 indicate.

### 5.5 Emission-Line Spectra

As well as absorption, the XSTAR code also calculates emission spectra assuming a shell of gas subtending $`4\pi `$ steradians at the central ionizing source. The fact that we do not detect any strong, identifiable emission features does not place constraints directly on the covering factor since we do not know the gas density or its distance from the ionizing source. Requiring that the shell of gas is much thinner than its distance to the source (i.e. $`\mathrm{\Delta }r/r1`$), and using the best-fitting values of column density and ionization parameter, only constrains the upper limit on the absorber distance on the order of kpc (e.g. see Turner et al. 1993).

It has been argued in the literature, based on XMM-Newton RGS grating data, that the soft X-ray spectra of MCG $``$6$``$30$``$15 and Mrk 766 can be better explained by relativistically-broadened emission lines due to C vi Ly$`\alpha `$, N vii Ly$`\alpha `$ ($`\lambda 24.781\AA `$) , and O viii Ly$`\alpha `$ ($`\lambda 18.969\AA `$) rather than a pure photoionized absorber (e.g. Branduardi-Raymont et al. 2001; however, see Lee et al. 2001 for counter-arguments). Due to the different MEG bandpass, we can only test for relativistically-broadened O viii Ly$`\alpha `$ ($`\lambda 18.969\AA `$) emission in our Mrk 509 data. Firstly, we note that we cannot obtain even a reasonable spectral-fit with only a relativistic disk line and no warm absorber. When we added an emission-line model from a relativistic disk around a Schwarzschild black hole (e.g. Fabian et al. 1989) to the best-fitting photoionized absorber model, we obtained a reduction in the $`C`$-statistic corresponding to only 90% confidence for the addition of two free parameters (the disk inclination and line intensity). The inner and outer radii of the disk were fixed at 6 and 1000 gravitational radii respectively, and the radial line emissivity per unit area was a power law with index $`2.5`$. The line energy was fixed at 0.65362 keV in the Mrk 509 rest frame. The best-fitting inclination angle and equivalent width was $`41_8^{+4}`$ degrees and $`17\pm 9`$ eV respectively. Pounds et al. (2001) assumed an inclination angle of $`30^{}`$ when fitting ionized disk reflection models, and in Paper II we also argue for a small inclination angle. If we fix the disk inclination at $`30^{}`$ in the Chandra fit, we find a much smaller equivalent width of $`8_6^{+8}`$ eV. When the O viii Ly$`\alpha `$ ($`\lambda 18.969\AA `$) emission line is included in the model, the best-fitting XSTAR model of the absorber does not change much: $`\mathrm{log}\xi `$ decreases from 1.76 to 1.65 and $`N_H`$ decreases by $`13\%`$ to $`1.80\times 10^{21}\mathrm{cm}^2`$. We caution that in our case the broad line may simply be modeling residuals which are remaining calibration uncertainties and/or curvature in the spectrum, and conclude that the evidence for relativistically-broadened O viii Ly$`\alpha `$ ($`\lambda 18.969\AA `$) emission in our data is not compelling but not ruled out either.

### 5.6 Effects of Changes in the SED

To investigate the effect of uncertainty in the energy range $`10500\mathrm{eV}`$ in our fiducial SED, we generated XSTAR models using alternative SEDs in the manner described for the fiducial SED (see §5.1). Two alternative SEDs were used, in which the flux at $`55\mathrm{eV}`$ was either 50% lower or 50% higher relative to the fiducial SED. These SEDs are illustrated by dashed lines in Fig. 11 . Proceeding with model-fitting just as described for the fiducial SED, we found that the best-fitting column density ($`N_H`$), ionization parameter ($`\xi `$), soft power-law photon index, and broken power-law break energy, were consistent for all three SEDs, within the statistical errors. Moreover, the models with the alternative SEDs were able to provide fits to all the major discrete absorption features and edges that were just as good, or no worse, than the fiducial SED models. We also found that the predicted ionic columns of O vii and O viii for the best-fitting models using the alternative SEDs did not differ by more than 10% from the values obtained with the baseline SED model. Thus, our results and conclusions are not sensitive to any reasonable uncertainties in the unobserved EUV part of the SED.

## 6 Comparison with an XMM-Newton Observation in October 2000

Mrk 509 was observed by XMM-Newton on 2000 October 25 (Pounds et al. (2001)), $`180`$ days before our Chandra HETGS observation. In this section we compare our Chandra results to the XMM-Newton results for the soft X-ray spectrum of Mrk 509 . The Fe-K region and higher energy spectrum has already been discussed in detail, and compared to the XMM-Newton results, in Yaqoob et al. (2002b). Several factors need to be borne in mind when making the comparison of the soft X-ray spectra. First, the effective areas of the XMM-Newton gratings (RGS) exceed that of the Chandra MEG below $`1.15`$ keV. Second, the spectral resolution of the RGS at 0.5 keV is at best $`850`$ $`\mathrm{km}\mathrm{s}^1`$ (compared to $`280`$ $`\mathrm{km}\mathrm{s}^1`$ for the MEG). The spectral resolution in both cases is worse at higher energies. Third, the exposure times for the XMM-Newton CCDs were $`2527`$ ks, and $`30`$ ks for the RGS. This is to be compared to $`58`$ ks for the Chandra exposure time. Fourth, the 0.5–10 keV observed flux during the XMM-Newton observation was $`2.6\times 10^{11}\mathrm{ergs}\mathrm{cm}^2\mathrm{s}^1`$, a factor of 2.8 less than the corresponding MEG 0.5–10 keV flux of $`7.3\times 10^{11}\mathrm{ergs}\mathrm{cm}^2\mathrm{s}^1`$.

XMM-Newton and Chandra observed a similar underlying continuum. The EPIC XMM-Newton CCD data yielded a 2–10 keV power-law index of $`1.66\pm 0.02`$, in good agreement with our Chandra / RXTE measurements of $`1.674_{0.015}^{+0.010}`$ (Yaqoob et al. 2002b ). A strong soft excess relative to this power law was observed by both XMM-Newton and Chandra and with a similar magnitude relative to the hard power law. Pounds et al. (2001) report detecting only two significant absorption features, namely a blend of Ne ix (r) and Fe xix at $`13.52\AA `$, and a broad absorption trough, likely to be associated with an Fe M-shell unresolved transition array (UTA), centered around $`16.1\AA `$. According to the calculations of Behar et al. (2001), this corresponds to ionization states dominated by Fe xi-xii. The Ne ix (r) ($`\lambda 13.447\AA `$) feature was detected by the MEG, and our data are not inconsistent with the Fe M-shell UTA. We established the latter by adding a Gaussian absorption trough to our best-fitting XSTAR model, in order to model the UTA (using the parameters measured by Pounds et al. 2001), and found that the agreement between data and model improved and the data did not deviate by more than one standard deviation from the model in the 0.70–0.78 keV region (observed). At the Ne ix / Fe xix feature the underlying continuum was a factor of $`2`$ higher during the Chandra observation than in the XMM-Newton observation. The equivalent widths of the Ne ix /Fe xix absorption features ($`1.0_{0.6}^{+0.5}`$ eV for Chandra , $`2.2\pm 1.0`$ eV for XMM-Newton ) are compatible with the absorption responding to the change in continuum level, as would be expected. Since Pounds et al. (2001) do not give any further measurements or limits (in particular on the O vii and O viii edges), or results of photoionization modeling, it is difficult to make a more detailed comparison of the warm absorber during the two observations.

Pounds et al. (2001) also detected O vii He-like triplet emission in the RGS data, with the intercombination line being the strongest (equivalent width $`1.5\pm 0.7`$ eV). Smaller equivalent widths of the O vii He-like triplet emission lines in the Chandra MEG data would be expected if the intensity of the emission lines remained constant whilst the underlying continuum increased (by more than a factor of two in this case). None of the O vii triplet lines are detected significantly, most likely due to insufficient signal-to-noise. For example, at the energy of the O vii $`\mathit{1}s^\mathit{2}\mathit{1}s\mathit{2}p`$ resonance line, the combined effective area of the two RGS instruments on XMM-Newton is a factor $`60`$ higher than the MEG. Combined with the shorter exposure and lower source flux for the XMM-Newton observation, the signal-to-noise of the RGS data at the O vii $`\mathit{1}s^\mathit{2}\mathit{1}s\mathit{2}p`$ resonance line is a factor $`3`$ higher than in the MEG data. Nevertheless, we do obtain a non-zero intensity from Gaussian modeling of the MEG data. Direct measurement of the intercombination line in the MEG data gives an equivalent width of $`1.00_{0.65}^{+0.44}`$ eV. Unfortunately, the signal-to-noise is insufficient to determine whether the emission-line intensity did or did not respond to the change in the continuum, so we cannot constrain the distance of the emitter.

## 7 Relation Between the X-ray and UV Warm Absorbers

Our Chandra HETGS observation was simultaneous with an HST/STIS observation. Full details of the results from the UV data are discussed in Paper II. Here we simply summarize very briefly the findings of Paper II and discuss whether the UV absorption predicted by our simple model of the X-ray absorber is consistent with the UV data.

The HST/STIS spectrum of Mrk 509 shows multiple kinematic components to the UV absorption features, a characteristic which is found to be common in Seyfert 1 galaxies (e.g. Crenshaw & Kraemer 1999). Specifically, eight distinct kinematic components are identified for C iv , N v , and Si iv . The seven principal kinematic components (numbered 1 through 7 in Paper II) lie at $`422,328,259,62,22,+34,+124\mathrm{km}\mathrm{s}^1`$ respectively, relative to systemic. Fig. 9 shows the UV absorber velocities superimposed on some of the strongest absorption features in the Chandra HETGS data, along with the best-fitting XSTAR photoionization model profiles. Shown are the velocity profiles of Ne x Ly$`\alpha `$ ($`\lambda 12.134\AA `$) , Ne ix (r) $`\mathit{1}s^\mathit{2}\mathit{1}s\mathit{2}p`$ ($`\lambda 13.447\AA `$), Mg xi (r) $`\mathit{1}s^\mathit{2}\mathit{1}s\mathit{2}p`$ ($`\lambda 11.547\AA `$), and O viii Ly$`\alpha `$ ($`\lambda 18.969\AA `$) . The UV kinematic components are clumped into two groups and together clearly span the widths of the X-ray profiles. It is possible these X-ray velocity profiles actually consist of several kinematic components which cannot be resolved by Chandra . We convolved the UV kinematic components through the MEG response function and found the resulting profiles to be compatible with the observed X-ray profiles. The observed X-ray profiles of Ne ix (r) $`\mathit{1}s^\mathit{2}\mathit{1}s\mathit{2}p`$ ($`\lambda 13.447\AA `$) and Mg xi (r) $`\mathit{1}s^\mathit{2}\mathit{1}s\mathit{2}p`$ ($`\lambda 9.169\AA `$) appear to be somewhat different to those of Ne x Ly$`\alpha `$ ($`\lambda 12.134\AA `$) and O viii Ly$`\alpha `$ ($`\lambda 18.969\AA `$) , the former pair being somewhat asymmetric. As pointed out in §4 and §5, this could be due to blending with unresolved line emission. Alternatively, the profiles could be intrinsically different. However, we again caution that the velocity resolution of the X-ray profiles shown in Fig. 8 is between $`350`$–730 $`\mathrm{km}\mathrm{s}^1`$ FWHM so the differences in the X-ray profiles must be regarded as tentative.

Although the X-ray and UV absorbers may share the same velocity space, in Paper II we show that the ionization state and column densities of the UV absorbers are too low to produce the observed X-ray absorption. Photoionization models for each of the UV kinematic components yielded column densities, $`N_H`$, in the range $`1.77\times 10^{18}\mathrm{cm}^2`$ to $`4.00\times 10^{19}\mathrm{cm}^2`$ and $`\mathrm{log}\xi `$ in the range 0.01 to 1.33 (or $`\mathrm{log}U`$ in the range $`1.48`$ to $`0.16`$). Conversely, the column density and ionization parameter of the X-ray absorber is high. The best-fitting parameters from photoionization modeling of the X-ray data are $`\mathrm{log}\xi =1.76`$ ($`\mathrm{log}U=0.27`$) and $`N_H=2.06\times 10^{21}\mathrm{cm}^2`$. Some UV absorption is predicted by the best-fitting XSTAR model to the Chandra data but the relevant ionic column densities are small enough that the predictions of the X-ray model are not in conflict with the UV data. Table 3 gives some column densities of some key ions from our best-fitting photoionization model to the X-ray data, compared with some measured column densities from the UV data, as well as some corresponding predicted column densities from the UV photoionization modeling. Indeed, it can seen that in the X-ray absorber, the predicted column densities of C ii, C iii, C iv, N v, and O vi could easily be hidden in the UV absorbers. Full details, including a plausible physical and geometrical picture of the X-ray and UV absorbers can be found in Paper II.

## 8 Conclusions

We observed Mrk 509 for $`59\mathrm{ks}`$ with the Chandra HETGS on 2001 April 13–14, simultaneously with RXTE and HST/STIS . The complex Fe-K line and Compton-reflection continuum are discussed in Yaqoob et al. (2002b). Details of the UV data and results from the HST/STIS observation are given in Paper II. Here we summarize the main results from the Chandra HETGS soft X-ray spectrum, in view of relevant constraints from the RXTE and HST/STIS observations.

1. Combined Chandra MEG, HEG and RXTE data show that the hard X-ray spectrum of Mrk 509 is well described by a simple power law, with little Compton reflection continuum required, and a photon index of $`\mathrm{\Gamma }=1.67`$ above 2 keV. At lower energies, below $`1`$ keV, the spectrum steepens, the soft excess attaining a magnitude of about 60% higher than the extrapolated hard power law. When the intrinsic X-ray continuum is modeled with a broken power-law, self-consistently modeling the X-ray absorption with a photoionization model (see below) yields a break energy $`E_B=0.95_{0.09}^{+0.15}\mathrm{keV}`$ and a soft power law index of $`\mathrm{\Gamma }=2.36_{0.20}^{+0.21}`$. During the observing campaign the broadband source flux was $`5.1\times 10^{11}\mathrm{ergs}\mathrm{cm}^2\mathrm{s}^1`$, typical of historical values (the corresponding 2–10 keV luminosity was $`1.3\times 10^{44}\mathrm{ergs}\mathrm{s}^1`$).
2. Below $`2`$ keV, the observed spectrum shows considerable deviations from a smooth continuum, due mainly to bound-free absorption opacity, and complexes of discrete absorption features. Particularly noteworthy are the O vii and O viii edges at $`0.732_{0.019}^{+0.004}\mathrm{keV}`$ and $`0.871_{0.020}^{+0.014}\mathrm{keV}`$ respectively. Within the errors, both values are consistent (O vii marginally so) with their respective rest energies, and from the best-fitting photoionization models the optical depths at threshold are $`0.10_{0.05}^{+0.07}`$ for O vii and $`0.09_{0.02}^{+0.01}`$ for O viii. Compared with a previous ASCA observation (Reynolds (1997); George et al. (1998)), the O vii edge is consistent, whilst the O viii edge is somewhat larger in the MEG data. However, we note that the edge depths may be variable in some AGN (e.g. Otani et al. 1996; Guainazzi et al. 1996). Estimates of the O viii edge depth are also complicated by nearby absorption features due, for example, to Ne and Fe. The spectral region between the O vii and O viii edges is very complex and the most difficult to model with a simple photoionized absorber. This part of the spectrum is also where one would expect Fe L edges (e.g. due to dust) and Fe M-shell unresolved transition arrays (UTA), neither of which are detected. The data, are, however consistent with a UTA with model parameters measured during an XMM-Newton observation (Pounds et al. 2001).
3. On the next level of detail, we detect absorption lines from H-like ions of N, O, Ne, He-like ions of O, Ne, Mg, as well as absorption features due to highly ionized Fe. The ionization state of the absorber is high, but not so high that absorption due to H-like Mg or Si is detected. Only the Ne x Ly$`\alpha `$ ($`\lambda 12.134\AA `$) and Ne ix $`\mathit{1}s^\mathit{2}\mathit{1}s\mathit{2}p`$ lines appear to be marginally resolved, and the rest are unresolved (FWHM$`<300`$ $`\mathrm{km}\mathrm{s}^1`$ for N, going up to FWHM$`<1330`$ $`\mathrm{km}\mathrm{s}^1`$ for Mg). The absorption lines are consistent with an outflow of $`200`$ $`\mathrm{km}\mathrm{s}^1`$ relative to systemic. However, the detailed velocity profiles of the absorption features are not all the same for all ionic species. The complexity and differences in profiles could be due to the contribution from different, unresolved kinematic components and/or blending and contamination from absorption/emission due to other atomic transitions.
4. We have modeled the Chandra HETGS spectra using the photoionization code XSTAR 2.1.d, with a spectral energy distribution (SED) constructed using our UV and X-ray data. The best-fitting ionization parameter and neutral equivalent Hydrogen column density of the absorbing gas are $`\mathrm{log}\xi =1.76_{0.14}^{+0.13}`$ ergs cm $`\mathrm{s}^1`$ (or $`\mathrm{log}U=0.27`$), and $`N_H=2.06_{0.45}^{+0.39}\times 10^{21}\mathrm{cm}^2`$ respectively. This best-fitting model gives an excellent fit to the overall observed spectrum. It also is able to model all the principal local absorption features to a degree ranging from fair to excellent, except for the region around 0.78–0.80 keV. The poor fit here may be, in part, due to uncertainties in the instrument response function. A curve-of-growth analysis indicates that a velocity width of $`b=100\mathrm{km}\mathrm{s}^1`$ gives a good match between the measured absorption-line equivalent widths. Our results are insensitive to reasonable uncertainties in the unobserved EUV part of the SED.
5. We do not detect any clearly identifiable emission lines (apart from the Fe-K line), in contrast with an earlier XMM-Newton observation in which Pounds et al. (2001) detected He-like O vii triplet emission, which constrained the electron density to be $`>10^{11}\mathrm{cm}^3`$. However, this lower limit is subject to uncertainties in the line-ratio measurements. Although the broadband X-ray flux during that observation was nearly a factor of three lower than it was during our campaign, the signal-to-noise of our data is worse, and insufficient to constrain the distance of the emitter from the ionizing source. Since we cannot assume that the emitter and absorber have the same ionization state and/or column density, time-resolved spectroscopy with better signal-to-noise is required to address the question of the location of the absorber and emitter. Deducing the mass outflow of the X-ray absorber must also await better data because the density and global covering factor are unknown.
6. Simultaneous HST/STIS observations of Mrk 509 indicate that there are eight kinetic components comprising the UV absorbers, with velocities ranging from $`422`$ to $`+124`$ $`\mathrm{km}\mathrm{s}^1`$. The X-ray absorber is compatible with sharing the same velocity space as the UV absorbers. It is possible that the velocity profiles of the X-ray absorbers are also made up of several kinematic components, possibly the same as the UV ones, but unresolved because of the factor of $`>30`$ worse velocity resolution of the X-ray data compared to the UV data. The X-ray profiles do however hint at complex structure, possibly two kinematic components, or groups of components. The UV components certainly appear to cluster into two groups. There are also differences in the X-ray velocity profiles between some of the ionic species. This may either be due to genuine differences in gas dynamics but may also be due to unresolved and unmodeled line emission. On the other hand, other Seyfert 1 galaxies also show two kinematic components (or groups of components) in their absorption-line profiles, but with different offsets relative to systemic (NGC 5548, Kaastra et al. (2002); NGC 4051, Collinge et al. (2001); NGC 3783, Kaspi et al. (2002)).
7. Although the X-ray and UV absorbers may share the same velocity space, Paper II shows that the ionization state and column densities of the UV absorbers are too low to produce the observed X-ray absorption. Conversely, the ionization and column density of the X-ray absorber is high; some UV absorption is predicted by our best-fitting photoionization model to the Chandra data but the relevant ionic column densities can be hidden in the UV absorbers.

The authors gratefully acknowledge support from NASA grants NCC-5447 (T.Y.), NAG5-10769 (T.Y.), NAG5-7385 (T.J.T), NAG5-4103 (S.B.K.), and CXO grant GO1-2101X (T.Y., B.M.). This research made use of the HEASARC online data archive services, supported by NASA/GSFC and also of the NASA/IPAC Extragalactic Database (NED) which is operated by the Jet Propulsion Laboratory, California Institute of Technology, under contract with NASA. The authors are grateful to the HST/STIS , Chandra and RXTE instrument and operations teams for making these observations possible, and to Tim Kallman for much advice on XSTAR. The authors also thank Julian Krolik for useful discussions, and an anonymous referee for doing a very thorough job on the manuscript. TY would like to dedicate this paper to his mother, Zubaida Begum Yaqoob, who passed away in March 2001, after sacrificing so much in order that her children could get an education and pursue their goals.

## Figure Captions

Figure 1
Comparison of the Mrk 509 MEG spectrum to the best-fitting power-law model fitted to the $`219\mathrm{keV}`$ (joint HETGS / RXTE data) extrapolated down to $`0.5\mathrm{keV}`$. Galactic absorption of $`4.44\times 10^{20}\mathrm{cm}^2`$ is included in the model and the power-law index is $`\mathrm{\Gamma }=1.674`$. The MEG data are binned at $`0.32\AA `$. The top panel shows the photon spectrum and the bottom panel shows the ratio of the MEG data to the above model. Both panels show that the intrinsic spectrum is required to steepen at low energies, relative to the hard X-ray power-law.

Figure 2
Comparison of the Mrk 509 MEG data (binned at $`0.32\AA `$) to a broken power-law model modified by two absorption edges (representing opacity due to O vii and O viii ), and Galactic absorption ($`4.44\times 10^{20}\mathrm{cm}^2`$). The hard X-ray photon index is fixed at $`1.674`$, and the best-fitting soft X-ray index and break energy are $`2.06`$ and $`1.28\mathrm{keV}`$ respectively. The best-fitting edge energies agree well with the expected rest-frame energies of the O vii ($`0.739\mathrm{keV}`$) and O viii ($`0.871\mathrm{keV}`$) edges. This kind of model has historically been used to model lower spectral resolution CCD data. Note that using this model, the inferred optical depth of the O viii edge could be affected by the Ne ix $`\mathit{1}s^\mathit{2}\mathit{1}s\mathit{2}p`$ ($`\lambda 13.447\AA `$) absorption feature (at $`0.89\mathrm{keV}`$, observed). The estimated depth of the O vii edge could also be influenced by complexity in the spectrum between $`0.70.8`$ keV, in particular from Fe inner-shell absorption.

Figure 3
Mrk 509 MEG observed photon spectrum compared to the the best-fitting photoionized absorber model (red solid line). Also shown is the intrinsic continuum (blue solid line) modified by Galactic absorption (neither the data nor model have been corrected for Galactic absorption). The dashed lines show the expected positions of some bound-free absorption edges. The model consists of an intrinsic continuum which is a broken power law (best-fitting break energy at 1.04 keV), absorbed by photoionized gas with best-fitting ionization parameter of $`\mathrm{log}\xi =1.76`$ (or $`\mathrm{log}U=0.27`$) and column density $`2.06\times 10^{21}\mathrm{cm}^2`$. Full details of the model calculations, fitting procedures, and discussion of the details of the comparison between data and model can be found in §5. The 0.7–0.9 keV region is very complex so simple two-edge models fitted to older CCD data (of Seyfert 1s in general) could have been biased by this complexity. In particular, note that the apparent emission feature at $`0.780.79\mathrm{keV}`$ (observed) is consistent with unabsorbed continuum and strong absorption on either side. There is also an instrumental edge at $`0.8`$ keV which may partly be responsible for the poor fit in this region. The panel showing the Mg xi (r) $`\mathit{1}s^\mathit{2}\mathit{1}s\mathit{2}p`$ ($`\lambda 9.169\AA `$) line, with data binned at $`0.02\AA `$, is shown separately for clarity, since there are no significant features between the end of the previous panel (at 1.15 keV) and the Mg xi (r) $`\mathit{1}s^\mathit{2}\mathit{1}s\mathit{2}p`$ ($`\lambda 9.169\AA `$) absorption line. The remaining data above $`0.5`$ keV are binned at $`0.08\AA `$ and at $`0.04\AA `$ below 0.5 keV.

Figure 4
Chandra MEG photon spectrum for Mrk 509 against wavelength in the source rest-frame (binned at $`0.02\AA `$, approximately the MEG FWHM spectral resolution). The corresponding signal to noise (SNR) ratio per bin is also shown. The spectrum has not been corrected for Galactic absorption. Many discrete absorption features are identifiable but none are labeled in this plot since it is primarily for finding the SNR at a particular wavelength. The same spectrum is shown in Figs. 6 and 7 but this time with labels corresponding to different arrays of atomic transitions. See also Figure 3, which shows the $`0.471.4`$ keV region of the spectrum with some important atomic features labeled.

Figure 5
Chandra HEG photon spectrum for Mrk 509 against wavelength in the source rest-frame (binned at $`0.02\AA `$; the HEG spectral resolution is $`0.012\AA `$ FWHM). The corresponding signal to noise (SNR) ratio per bin is also shown. The spectrum has not been corrected for Galactic absorption. No atomic transitions are labeled in this plot since it is primarily for finding the SNR at a particular wavelength and for confirming features identified in the MEG in overlapping wavelength regions. Features can be identified using the labeled MEG spectra in Figs. 6 and 7.

Figure 6
Chandra MEG photon spectrum for Mrk 509 against wavelength in the source rest-frame (binned at $`0.02\AA `$, approximately the MEG FWHM spectral resolution). Labels show the Lyman series wavelengths (in blue) for Ar, S, Si, Mg, Na, Ne, O, and N. Also shown (in red) are the wavelengths of the Helium-like triplets (resonance, intercombination and forbidden lines) of Ar, S, Si, Mg, Ne and O.

Figure 7
Chandra MEG photon spectrum for Mrk 509 against wavelength in the source rest-frame (binned at $`0.02\AA `$, approximately the MEG FWHM spectral resolution). Plotted in blue are the wavelengths of He-like resonance-absorption transitions ($`n=12,3,4,`$..) of Ar, S, Si, Mg, Na, Ne, O and N. Also shown (in red) are the Balmer series transitions of Ar, S and Si.

Figure 8
Velocity profiles from combined Chandra MEG and HEG spectra (except for O viii Ly$`\alpha `$ ($`\lambda 18.969\AA `$) which is from MEG data only since it is outside of the bandpass of the HEG). The profiles are for some of the strongest absorption features in the data. It can be seen that the absorption features are well-described by the column densities from the best-fitting photoionization model (black solid lines), which has $`\mathrm{log}\xi =1.76`$ (or $`\mathrm{log}U=0.27`$) and $`N_H=2.06\times 10^{21}\mathrm{cm}^2`$ (see §5). The model profiles were calculated using a Gaussian with $`\sigma =b/\sqrt{2}`$, for $`b=100\mathrm{km}\mathrm{s}^1`$, deduced from a curve-of-growth analysis (see §5.4 and Fig. 10 ). A velocity of zero corresponds to the systemic velocity for Mrk 509 (assuming $`z=0.0344`$). A negative velocity here indicates a blueshift relative to systemic. The centroids of the absorption features lie at around $`200\mathrm{km}/\mathrm{s}`$ (red), but all the profiles extend redward to the systemic velocity and slightly beyond. FWHM velocities from Gaussian fitting are given in Table 1 and can be compared with the FWHM MEG velocity resolution of 352, 496, 550, and 728 km/s for O viii Ly$`\alpha `$ ($`\lambda 18.969\AA `$) , Ne ix (r) $`\mathit{1}s^\mathit{2}\mathit{1}s\mathit{2}p`$ ($`\lambda 13.447\AA `$), Ne x Ly$`\alpha `$ ($`\lambda 12.134\AA `$) , and Mg xi (r) $`\mathit{1}s^\mathit{2}\mathit{1}s\mathit{2}p`$ ($`\lambda 9.169\AA `$) respectively. The velocities of the principal seven kinematic components of the UV absorber are also shown (blue) and are $`422,328,259,62,22,+34`$, and $`+124\mathrm{km}\mathrm{s}^1`$ (see Paper II).

Figure 9
Velocity spectra from combined Chandra MEG and HEG spectra. The profiles are centered on atomic transitions that are not present in the data. The solid lines correspond to the best-fitting photoionization model, which has $`\mathrm{log}\xi =1.76`$ (or $`\mathrm{log}U=0.27`$) and $`N_H=2.06\times 10^{21}\mathrm{cm}^2`$ (see §5). Clearly the model does not over-predict key features which the spectra are centered on (as labeled). A velocity of zero corresponds to the systemic velocity for Mrk 509 (assuming $`z=0.0344`$). A negative velocity here indicates a blueshift relative to systemic. The dotted line corresponds to $`200\mathrm{km}\mathrm{s}^1`$, consistent with the blueshift of absorption lines which are detected (Fig. 8 ).

Figure 10
Curves of growth for various values of the velocity width, $`b`$. Plotted for each $`b`$ is the logarithm of line equivalent width (EW) per unit wavelength against the logarithm of the product of ionic column density ($`N`$), oscillator strength ($`f`$), and wavelength ($`\lambda `$). The plotted points are taken from the measured equivalent widths (converted to Angstroms using the values in Table 1) and predicted ionic column densities (from the best-fitting XSTAR model described in §5). These values are consistent with $`b=100\mathrm{km}\mathrm{s}^1`$.

Figure 11
The observed and interpolated baseline SED (solid curve) used for photoionization modeling of Mrk 509. Average radio and IR fluxes are from Ward et al. (1987). The UV data are dereddened fluxes from the HST/STIS observation (Kraemer et al. (2002)) and the X-ray data points are from our simultaneous Chandra HETGS data. The hard X-ray power law has $`\mathrm{\Gamma }=1.674`$ and has been extended to 500 keV. The dashed lines are deviations representing modifications to the baseline SED used to investigate the effects of uncertainties in the unobserved part of the SED. The modifications to the baseline SED correspond to changing the flux at 55 eV (just above the ionization energy of neutral He) by $`\pm 50\%`$. See §5.1 for full details of the construction and applications of the SEDs. The dotted curve is the ‘mean AGN’ SED of Matthews & Ferland (1987), normalized to the same ionizing luminosity (i.e. in the range 1–1000 Rydberg) as that of the Mrk 509 baseline SED.

Figure 12
Comparison of MEG data (top panel, raw counts spectrum) binned at $`0.16\AA `$ with the best-fitting XSTAR photoionization model (red curve; see §5) and the ratio of data to model (bottom panel), showing a good overall fit to the data. In this representation the various instrumental edges can be seen, and in particular the poor fit around 2.0–2.5 keV can be seen to coincide with the large jump in the X-ray telescope effective area.

Figure 13
Best-fitting photoionization model spectrum corresponding to Fig. 12 (see also Fig. 3 ). The ionization parameter is $`\mathrm{log}\xi =1.76`$ (or $`\mathrm{log}U=0.27`$) and $`N_H=2.06\times 10^{21}\mathrm{cm}^2`$. The intrinsic continuum is a broken power law, and Galactic absorption is included. Full details and other parameters can be found in the text (§5).

Figure 14
The $`68\%,90\%`$, and $`99\%`$ confidence contours of the logarithm of the ionization parameter ($`\mathrm{log}\xi `$) versus the column density ($`N_H`$) of a photoionized absorber. The contours are from a joint MEG and HEG spectral fit to the Mrk 509 data, using a broken power-law intrinsic continuum, a photoionized absorber, and Galactic absorption. The HEG and MEG spectra were binned at $`0.08\AA `$. See §5 for details.