Press-Schechter function in python

In summary, if you are a beginner in programming and want to write a program in Python that takes in "redshift", "M" range, and "dn/dM" range as input and plots the "Press-Schechter" function to produce a graph, you can start by learning Python through the tutorials on python.org. Then, you can make use of the Python math library and the pyplot library to calculate and display the graph.
  • #1
mahya
8
0
I want to write program in python that gives "redshift", range of "M" and range of "dn/dM" as input and plots "Press-Schechter" function and delivers a graph as output. would you please give some hints? I'm beginner in programming and I don't know how to start.
 
Technology news on Phys.org
  • #2
mahya said:
I want to write program in python that gives "redshift", range of "M" and range of "dn/dM" as input and plots "Press-Schechter" function and delivers a graph as output. would you please give some hints? I'm beginner in programming and I don't know how to start.
A good place to start learning Python would probably be the tutorials over at python.org, for example:
https://docs.python.org/3.4/tutorial/introduction.html

The full tutorial can be found here:
https://docs.python.org/3.4/tutorial/index.html

If you can get some understanding of python, when it's time to do the calculation you'll probably need to make use of the Python math library:
https://docs.python.org/3.4/library/math.html

In particular you'll have to use math.exp(), math.pi, math.sqrt(), and math.pow().

To display the graph, try making use of pyplot:
http://matplotlib.org/api/pyplot_api.html
 

Related to Press-Schechter function in python

What is the Press-Schechter function?

The Press-Schechter function is a mathematical formula used in cosmology to predict the number of dark matter halos in a given mass range. It is based on the theory of hierarchical structure formation in the universe.

Why is the Press-Schechter function important?

The Press-Schechter function is important because it provides a way to quantify the distribution of dark matter halos, which are crucial for understanding the large-scale structure of the universe. It is also used in simulations and observations to study the evolution of galaxies and the growth of cosmic structures.

How is the Press-Schechter function calculated in python?

The Press-Schechter function can be calculated in python using the astropy.cosmology and scipy.integrate libraries. The function takes in parameters such as the mass of the dark matter halo, the cosmological parameters, and the redshift, and returns the predicted number density of halos in that mass range.

What are some limitations of the Press-Schechter function?

The Press-Schechter function assumes a simplified model of halo formation and does not take into account the effects of baryonic matter, which can significantly affect the distribution of halos. It also assumes a constant mass function, which may not hold true in some cases.

Are there any alternative functions to the Press-Schechter function?

Yes, there are alternative functions such as the Sheth-Tormen function and the Tinker function, which have been proposed to improve upon the limitations of the Press-Schechter function. These alternative functions take into account additional factors such as the impact of environment on halo formation.

Similar threads

  • Programming and Computer Science
Replies
4
Views
3K
  • Programming and Computer Science
Replies
2
Views
2K
  • Programming and Computer Science
2
Replies
55
Views
4K
  • Programming and Computer Science
Replies
8
Views
2K
  • Programming and Computer Science
Replies
2
Views
1K
  • Programming and Computer Science
Replies
3
Views
525
  • Programming and Computer Science
Replies
3
Views
862
  • Programming and Computer Science
Replies
5
Views
3K
  • Programming and Computer Science
Replies
3
Views
903
  • Programming and Computer Science
Replies
34
Views
3K
Back
Top