def dhugo(p2,d1,p1,g):

	"""
	Calculates the density on the hugoniot curve
	Input:
	p2 - Downstream pressure
	d1 - Upstream density
	p1 - Upstream pressure
	g - Adiabatic index
	"""
	
	return (d1*((-1 + g)*p1 + (1 + g)*p2))/((1 + g)*p1 + (-1 + g)*p2)