Summary
IFDIFF keeps disp calls in functions derived from the RHS (e.g. switching function, jump function, etc.). However, the arguments of the disp call are not added to the list of variables required to compute the function value, so IFDIFF removes them which leads to an error when calling the derived function.
Example
RHS
function dy = rhsDisp(t, y, p)
x = 10;
disp(x);
dy = 1;
if y > 1
dy = 0;
end
end
with malformed switching function
%rhs_preprocessed_rhsDisp:1/1/0
function switchingValue = sw_rhs_preprocessed_rhsDisp_B1C3501C_1_1(datahandle,t,y,p)
disp( x );
switchEval_if_1 = 1 - (y);
switchingValue = switchEval_if_1;
end
Summary
IFDIFF keeps
dispcalls in functions derived from the RHS (e.g. switching function, jump function, etc.). However, the arguments of thedispcall are not added to the list of variables required to compute the function value, so IFDIFF removes them which leads to an error when calling the derived function.Example
RHS
with malformed switching function