Modeling, simulation, and measurement of nonlinearities in superconducting transmission lines and resonators