# Help with Python computation to calculate age of universe

1. Jan 29, 2016

### Pavkazz

1. The problem statement, all variables and given/known data
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.

2. Relevant equations
vrec = H0*Dgal.
5 log dpc − 5 + AV = µ + AV
3. The attempt at a solution
Below is my code to work out hubbles constant. My Distance mod is accurate

#### Attached Files:

• ###### Screen Shot 2016-01-29 at 14.52.30.png
File size:
124.8 KB
Views:
34
2. Jan 29, 2016

### Staff: Mentor

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.

3. Jan 29, 2016

### phyzguy

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 (Text):

import numpy as np
x = 0.5
y = np.sin(x)
print "The sine of %f is %f"%(x,y)

4. Jan 29, 2016

### Pavkazz

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)?

5. Jan 29, 2016

### Staff: Mentor

The +1 should be in the exponent, right.