hh := {1, 1, 1} . {q^2/2/g, p/(ρ g),  
          z}
hh

example  9.5  p.234

para = {g ->  9.8, ρ ->  1000}

hha = hh /. {q ->  5, p ->  1.4 10^5, z ->  20} /. 
        para

hhb = hh /. {q -> 8, p ->  2.0 10^5, z ->  10} /. 
        para

hha - hhb