I was just testing an example from Numerical Methods in Engineering with Python.
from numpy import zeros, array from math import sin, log from newto
you are getting math domain error for either one of the reason : either you are trying to use a negative number inside log function or a zero value.