Python Help with Python computation to calculate age of universe

AI Thread Summary
The discussion revolves around calculating the age of the universe using Python by determining the distance modulus for galaxies in the V and I bands. The user is encountering discrepancies in their results, specifically a Hubble constant that is ten times too large, which affects the calculated age of the universe. Key equations include the relationship between recession velocity and distance, as well as the distance modulus formula. The user seeks clarification on the term AVG_DPC_V and its significance in their calculations. They suspect that a misunderstanding in the mathematical expression, particularly regarding the placement of the +1 in the exponent of the distance calculation formula, may be the source of their errors. Proper formatting of code is also suggested to facilitate better understanding and troubleshooting.
Pavkazz
Messages
2
Reaction score
0

Homework Statement


I'm using python to calculate the age of the universe, by working out the distmodulus for a set of galaxys (using the V and I bands) then working out the distance in parsecs and then hubbles constant etc... I keep getting values that are 10s of magnitudes out which I assume has something to do with my unit conversion.

Homework Equations


vrec = H0*Dgal.
5 log dpc − 5 + AV = µ + AV

The Attempt at a Solution


Below is my code to work out hubbles constant. My Distance mod is accurate [/B]
 

Attachments

  • Screen Shot 2016-01-29 at 14.52.30.png
    Screen Shot 2016-01-29 at 14.52.30.png
    102.8 KB · Views: 545
Technology news on Phys.org
What is AVG_DPC_V and what does the formula calculating it mean? What is f?
The Hubble constant is a factor 10 too large, that error propagates to the age of the universe.
 
By the way, if you enclose your code in "code" tags, we can see your code with the appropriate formatting and even run it if we like. This makes it easier for people to understand code related questions. Below is an example.

Code:
import numpy as np
x = 0.5
y = np.sin(x)
print "The sine of %f is %f"%(x,y)
 
mfb said:
What is AVG_DPC_V and what does the formula calculating it mean? What is f?
The Hubble constant is a factor 10 too large, that error propagates to the age of the universe.
Average distance in the V band and the formula calculating is (5 log dpc − 5 + AV = µ + AV) which is dpc = 10^u/5 + 1. I think I may have solved the issue? Is it simply the bracket in the equation above where I am calculating (10^u/5) +1 not 10^(u/5 + 1)?
 
The +1 should be in the exponent, right.
 
Thread 'Star maps using Blender'
Blender just recently dropped a new version, 4.5(with 5.0 on the horizon), and within it was a new feature for which I immediately thought of a use for. The new feature was a .csv importer for Geometry nodes. Geometry nodes are a method of modelling that uses a node tree to create 3D models which offers more flexibility than straight modeling does. The .csv importer node allows you to bring in a .csv file and use the data in it to control aspects of your model. So for example, if you...
I tried a web search "the loss of programming ", and found an article saying that all aspects of writing, developing, and testing software programs will one day all be handled through artificial intelligence. One must wonder then, who is responsible. WHO is responsible for any problems, bugs, deficiencies, or whatever malfunctions which the programs make their users endure? Things may work wrong however the "wrong" happens. AI needs to fix the problems for the users. Any way to...
Back
Top