Skip to content

Incorrect treatment of disp statement in RHS when generating derived functions #66

Description

@Schlevidon

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions