dt_var = variables.get("dt", None)
if dt_var is not None:
for symbol in symbols:
if not t in set.union(*(el.atoms() for el in symbol.args)):
continue // not a function of time
symbol = str(symbol.func)
var = variables.get(symbol, None)
After Change
if dt_var is not None:
// This will raise an error if we meet the symbol "t" anywhere
// except as an argument of a locally constant function
for entry in itertools.chain(matrix, constants):
_check_for_t(entry, variables, dt_var.get_value(), t)
symbols = [Symbol(variable, real=True) for variable in varnames]
solution = sp.solve_linear_system(matrix.row_join(constants), *symbols)
b = sp.ImmutableMatrix([solution[symbol] for symbol in symbols]).transpose()