This pages contains some notes on the analysis algorithm that is used in our IDA solver in ASCEND. Work in progress!
- reanalyze_solver_lists, to update the rels/vars in the system system according to the WHENs
- set the VAR_NONBASIC flag: zero = 'normal' variables; one = the independent variable ('x')
- integrator_ida_check_vars, to check for differential variables that are not incident (for example when 'Q' is not present in any equation except in the form of 'der(Q)': we want to expand the solvers_var_list in that case to include Q, so that IDA can pass values of Q back to the user. Does this function do anything else?
- integrator_ida_flag_rels, simply loops through all of the relations in the solvers_rel_list, and calls rel_classify_differential, which checks if any of the variables in a relation are derivatives, ie like 'der(x)'.
- integrator_ida_sort_rels_and_vars. For vars, this cuts the 'nonderivs' first, then the 'derivs' and then the 'others' (including fixed variables and the independent variable). For rels, this cuts the active, included, equality relations to the start of the list. TODO: we're not checking whether or not the model includes inequalities?
- integrator_ida_create_lists. Creates lists y, ydot and y_id, which help IDA to find its way back to the correct entries in the solvers_var_list.
- integrator_ida_check_diffindex (performs a series of hopefully unnecessary checks)
- (there is some code commented out here to do with checking the structure of the system for structural singularity etc)
- integrator_ida_check_index should tell the user if there is an index problem (perhaps we can apply automatic index reduction?). This is done by calculating the jacobian matrices df_dydp and dg_dya (using system_jacobian function that was written for IDA), checking both are square, and checking that both of them are full rank. TODO: check if this is being done every time we cross a boundary?
- some checks of the diffvars: do we have a single indep var, is the indep var what we expected it to be. TODO it seems like it's too late to be checking this here?
- copy the list of observed vars (both continuous and discrete) into the integ data struct from the diffvars struct (which doesn't seem like a great place for that stuff now)
TODO complete this section.