def updateParams(self, pars): ok = LCDMCosmology.updateParams(self, pars) if not ok: return False for p in pars: if p.name == "mquin": self.mquin = p.value elif p.name == "mphan": self.mphan = p.value elif p.name == "iniphi": self.iniphi = p.value elif p.name == 'beta': self.beta = p.value #Searches initial conditions and computes the Hubble function self.search_ini() if self.chatty: print('phi, phan, beta, ini', self.mquin, self.mphan, self.beta, self.iniphi) if False: #if self.mid != 0: "Useful for testing purposes" quin, dquin, phan, dphan = self.solution w1 = 0.5 * dquin**2 + self.qp * 0.5 * dphan**2 - self.Vtotal( quin, phan, 0) / self.cte - self.Vtotal(quin, phan, 0) / self.cte w2 = 0.5 * dquin**2 + self.qp * 0.5 * dphan**2 + self.Vtotal( quin, phan, 0) / self.cte + self.Vtotal(quin, phan, 0) / self.cte plt.plot(self.zvals, self.logatoz(w1 / w2)) plt.title('mquin %f, mphan %f' % (self.mquin, self.mphan)) plt.show() return True
def updateParams(self, pars): ok = LCDMCosmology.updateParams(self, pars) if not ok: return False for p in pars: if p.name == "philam": self.ilam = p.value elif p.name == "phialp": self.alpha = p.value elif p.name == "phibeta": self.beta = p.value elif p.name == "phimu": self.mu = p.value elif p.name == "Ok": self.Ok = p.value self.setCurvature(self.Ok) if (abs(self.Ok) > 1.0): return False self.set_ini() """ Testing import matplotlib.pyplot as plt dataHz = np.loadtxt('data/Hz_all.dat') redshifts, obs, errors = [dataHz[:,i] for i in [0,1,2]] plt.errorbar(redshifts, obs, errors, xerr=None, color='purple', marker='o', ls='None', elinewidth =2, capsize=5, capthick = 1, label='$Datos$') plt.xlabel(r'$z$') plt.ylabel(r'$H(z) [km/s Mpc^{-1}]$') plt.plot(self.zvals, [67.4*np.sqrt(self.RHSquared_a(1./(1+z))) for z in self.zvals]) #plt.plot(self.zvals, [67.4*np.sqrt(self.hubble(1./(1+z))) for z in self.zvals]) plt.title('mquin %f'%(self.alpha)) plt.show() """ return True
def updateParams(self, pars): ok = LCDMCosmology.updateParams(self, pars) if not ok: return False for p in pars: if p.name == "alpha": self.alpha = p.value self.start() return True
def updateParams(self, pars): ok = LCDMCosmology.updateParams(self, pars) if not ok: return False for p in pars: if p.name == "dw": self.dw0 = p.value elif p.name == "Ok": self.Ok = p.value self.setCurvature(self.Ok) if (abs(self.Ok) > 1.0): return False return True
def updateParams(self, pars): ok = LCDMCosmology.updateParams(self, pars) if not ok: return False for p in pars: if p.name == "Ok": self.Ok = p.value # se comments to BaseCosmology class # in short, WE hold the Ok parameter # (maybe you want to parameterize it differently), # but the BaseCosmology class needs to know about Ok in order # to get Da and its sin/sinhs right. self.setCurvature(self.Ok) if (abs(self.Ok) > 1.0): return False if self.zeroDE: # set curvature so that Ode=0 self.Ok = 1 - self.Om self.setCurvature(self.Ok) return True
def updateParams(self, pars): ok = LCDMCosmology.updateParams(self, pars) if not ok: return False for p in pars: if p.name == "w": self.w0 = p.value elif p.name == "wa": self.wa = p.value elif p.name == "Ok": self.Ok = p.value self.setCurvature(self.Ok) if (abs(self.Ok) > 1.0): return False elif p.name == "q0": self.q0 = p.value elif p.name == "j0": self.j0 = p.value elif p.name == "Omega0": self.Omega0 = p.value return True