Skip to content

MaxLan-dev/Research_project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

Research_project

This is a C++ code that calculates the elemental abundance ratio of oxygen to hydrogen in an astronomical object, using the so-called Te method. The Te method uses the ratio of two emission lines of ionized oxygen, [OIII] 4959/5007 and [OII] 3727/3729, and the intensity of another emission line of ionized oxygen, [OII] 4363, along with the electron density of the object, to calculate the temperature of the ionized gas and the oxygen abundance.

The code first defines a function n_e that takes in the intensities of the [OII] emission lines at wavelengths 6716 and 6731 Angstrom and returns the electron density n_e of the gas using a formula that depends on the ratio of the two intensities.

The main function then reads in the intensities of the three [OII] and [OIII] emission lines, along with the intensity of the [OII] 4363 line, from either the command line or from an input file. If the user enters the values from the command line, they are prompted to do so by the program. If an input file is used, its name is passed to the program as the first argument, and the data is read in from the file.

The program then calls the Te_method function, passing in the intensities and the electron density calculated by the n_e function, and two pointers to variables t_2 and t_3 that are used to return the temperatures of the ionized gas corresponding to the singly ionized oxygen (O+) and doubly ionized oxygen (O++) ions, respectively.

The Te_method function then uses an iterative approach to calculate the temperature of the ionized gas corresponding to the [OIII] 4959/5007 emission lines, t_3, by first assuming an initial value for t_3 and calculating the temperature of the ionized gas corresponding to the [OII] 3727/3729 emission lines, t_2. It then calculates the electron temperature using t_2 and t_3, and the electron density n_e. Finally, it uses the calculated electron temperature and the intensities of the [OII] and [OIII] emission lines to calculate the elemental abundance ratio of oxygen to hydrogen using the logO1_H1 and logO2_H1 formulas.

The program then outputs the calculated oxygen abundance ratio, the temperatures t_2 and t_3, and the input intensities to either an output file or the standard output, depending on the program arguments. If an output file is used, its name is passed to the program as the second argument. If the calculation fails to converge within 50 iterations, the temperature values t_2 and t_3 are set to 0 and the program continues with the calculation of the next set of input values. If this happens, a message is also output to a file named bad.

About

This is my reasarch paper

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages