Package pycosmicstar :: Package cosmolib
[hide private]
[frames] | no frames]

Source Code for Package pycosmicstar.cosmolib

  1  #!/usr/bin/env python3 
  2   
  3  __author__ = "Eduardo dos Santos Pereira" 
  4  __email__ = "pereira.somoza@gmail.com" 
  5  __credits__ = ["Eduardo dos Santos Pereira"] 
  6  __license__ = "GPLV3" 
  7  __version__ = "1.0.1" 
  8  __maintainer__ = "Eduardo dos Santos Pereira" 
  9  __status__ = "Stable" 
 10   
 11  """ 
 12  DISCLAIMER: 
 13   
 14  A FORTRAN wrapper library for cosmology analisys in Python 
 15   
 16  cosmolib is free software: you can redistribute it and/or modify 
 17  it under the terms of the GNU General Public License as published by 
 18  the Free Software Foundation, either version 3 of the License. 
 19  cosmolib is distributed in the hope that it will be useful, 
 20  but WITHOUT ANY WARRANTY; without even the implied warranty of 
 21  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
 22  GNU General Public License for more details. 
 23   
 24  You should have received a copy of the GNU General Public License 
 25  along with Foobar.  If not, see <http://www.gnu.org/licenses/>. 
 26   
 27   
 28  AUTHOR: 
 29   
 30      Eduardo S. Pereira 
 31      email: pereira.somoza@gmail.com 
 32   
 33   
 34  Initialization: 
 35   
 36     import cosmolib 
 37     omegab = 0.04 
 38     omegam = 0.24 
 39     omegal = 0.7 
 40     h = 0.7 
 41     myUniverse = cosmolib.init(omegab,omegam,omegal,h) 
 42   
 43  FUNCTIONS: 
 44      dtdz(z) : Time and Redshift Relation for S{Lambda}CDM Universe 
 45      dtdzCG : Time and Redshift Relation for  Chaplygin Gas 
 46      rz(z): comove distancy  for S{Lambda}CDM Universe 
 47      rzGC(z) : comove distancy  for  Chaplygin Gas 
 48      dr_dz(z) : variation of comove distance with redshift for 
 49      S{Lambda}CDM Universe 
 50      drGC_dz(z) : variation of comove distance with redshift  for  Chaplygin Gas 
 51      dV_dz(z) : variation of comove volume with redshift for S{Lambda}CDM 
 52      Universe 
 53      age(z):  Age of the Universe for S{Lambda}CDM Universe 
 54      ageCG(z) : Age of the Universe for  Chaplygin Gas 
 55   
 56      sigma: the variance of the linear density field. 
 57      dsigma2_dk: Derivative of the variance of the linear density field 
 58                           with respect to the scala factor 
 59      grow: Growth function. 
 60   
 61      rhodm : Evolution of the dark matter density 
 62      rhobr : Evolution of the barionic matter density. 
 63   
 64      NUMERICAL METHODS: 
 65          rk4_in: 
 66              4th-order Runge-Kutta method for solving the 
 67              initial value problem { y}' = { F(x,{ y} )} , where 
 68              { y} = { y[0],y[1],...y[n-1]} . 
 69              ARGUMENTS: 
 70                  y: nitial conditions. 
 71                  Xarray : Array with the x value for all range 
 72                  Yarray: Output Array with the solutions of Y' 
 73                  fun: user-supplied function that returns the 
 74                                   array F(x,y) = { y'[0],y'[1],...,y'[n-1]} . 
 75              RETURN: 
 76                  The integrated numerical function 
 77          romberg: 
 78              Romberg Integration 
 79              ARGUMENTS: 
 80                  func : Function to be integrated 
 81                  a : start point 
 82                  b : end point 
 83                  tol : tolerance 
 84              RETURN: 
 85                  The integrated value 
 86   
 87          locate: 
 88              Localiza a posicao de dado ponto a partir de dois adjacentes. 
 89              ARGUMENTS: 
 90                  func --- function or entry table 
 91                  xx   --- entry table 
 92                  n    --- n point in the table 
 93                  x    ---  value in x that is related to y 
 94              RETURN 
 95                  j    ---  x,y position 
 96   
 97          dfridr: 
 98              Gives the derivate of func with respect to x 
 99              Arguments: 
100                  func - Function to be derived 
101                  x - point in x where the derivative is analysed 
102                  h - step for diferential 
103                  error - internal parameter for function error 
104              RETURN: 
105                  The derived value of the funtion in the x point 
106   
107   
108  """ 
109   
110  __all__ = ['lcdmlib', 'chaplyginlib', 'numericallib'] 
111