Theory and applications of the collocation method with splines for ordinary and partial differential equations