-
Notifications
You must be signed in to change notification settings - Fork 1
/
agg_accuracy_wFirst.py
38 lines (33 loc) · 1.15 KB
/
agg_accuracy_wFirst.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import math
from functions.sfq import dsfq
#create luminosity distance functions
dsfq1 = dsfq()
dsfq2 = dsfq()
dcdm = dsfq()
#redshifts at which to calculate aggregate accuracy
z1 = 0.5
z2 = 1.32
#assign appropriate values in luminosity distance functions for SFQ-I, SFQ-II and Lambda-CDM models
dsfq1.update(factor=1, at=0.50, tau=0.33, wp=0, wm=0, wf=-1)
dsfq2.update(factor = 1, at=0.23, tau=0.33, wp=0, wm=0, wf=-1)
dcdm.update(factor=0)
#calculate d_L for each model at redshift z=0.5
d_L1 = dsfq1.cal(z1)
d_L2 = dsfq2.cal(z1)
d_lamcdm = dcdm.cal(z1)
#find aggregate accuracy for SFQ-I model
aggy1 = abs((d_L1-d_lamcdm)/d_L1)
print('sfq1 (z = ' + str(z1) + '):' + str(aggy1))
#find aggregate accuracy for SFQ-I model
aggy2 = abs((d_L2-d_lamcdm)/d_L2)
print('sfq2 (z = ' + str(z1) + '):' + str(aggy2))
#calculate d_L for each model at redshift z=1.32
d_L1 = dsfq1.cal(z2)
d_L2 = dsfq2.cal(z2)
d_lamcdm = dcdm.cal(z2)
#find aggregate accuracy for SFQ-I model
aggy1 = abs((d_L1-d_lamcdm)/d_L1)
print('sfq1 (z = ' + str(z2) + '):' + str(aggy1))
#find aggregate accuracy for SFQ-II model
aggy2 = abs((d_L2-d_lamcdm)/d_L2)
print('sfq2 (z = ' + str(z2) + '):' + str(aggy2))