eqdisco.models.split_terms#

eqdisco.models.split_terms(expr)[source]#

Split an expression at its top-level add/sub/neg nodes.

Returns a list of (sign, term): the additive terms of the expression, the basis functions of a linear-in-parameters reading of the model. A constant factor of a term (mul(c, F)) is removed, so that 2*x0 - 3*sin(x1) gives the terms x0 and sin(x1).