Imported from https://github.com/dynamicslab/SINDy-PI