# == Test that nu has a real solution before assigning == #
warning_msg = """
Hint: you probably set government spending too {}. Elect a {}
Congress and start over.
"""
disc = a0**2 - 4 * a0 * b0
if disc >= 0:
nu = 0.5 * (a0 - sqrt(disc)) / a0
else:
print "There is no Ramsey equilibrium for these parameters."
print warning_msg.format('high', 'Republican')
sys.exit(0)
# == Test that the Lagrange multiplier has the right sign == #
if nu * (0.5 - nu) < 0:
print "Negative multiplier on the government budget constraint."
print warning_msg.format('low', 'Democratic')
sys.exit(0)