Closed shuheng-liu closed 1 year ago
Plus, here's my interpretation of line 1331. It might be helpful to anyone else trying to understand what the non_var_filter
is doing.
len(conditions)
is the number of functions to solve for+ 1
is hard-coded number of free variables/coordinates/inputs to functions. Since this is an ODE solver, there's only 1
input.+ n
is the index of a var
(a parameter that appears only in the condition). It's deleted since the var
doesn't appear in the equation by assumption.- i
accounts for the fact that at step i
(starting from 0), a total of i
vars have been previously deleted. This assumes previously deleted var
s appear before the current var
(i.e., non_var
list is sorted)! Which is not guaranteed by line 1326 and can lead to unnoticeable bugs!
The following code block assumes each bundle parameter must fall into one of the following categories.
However, in theory, there should be a case where the parameter appears both in the equation and in the initial/boundary condition. The
var
here probably implies a parameter that appears only in the equation. A fix is needed.