Skip to content

Add documentation for including breakpoints in a RHS #67

Description

@Schlevidon

Summary

Breakpoints placed in a RHS will not trigger when solving with IFDIFF because the RHS is exported into a new file, which does not contain the breakpoints from the original RHS.

An easy fix would be to use the keyboard command instead, which will be transferred over to the RHS and any derived functions. We should document this for users.

Example

RHS

function dy = rhsBreakpoint(t, y, p)
dy = 1;
keyboard;
x = 5;
if y > x
    dy = 0;
end
end

which will be preprocessed as

function dy = rhs_preprocessed_rhsBreakpoint(datahandle,t,y,p)
    dy = 1;
    keyboard;
    x = 5;
    switchEval_if_1 = x - (y);
    conditionValue = ctrlif( switchEval_if_1, false, true, 1, 0, datahandle );
    if conditionValue
        dy = 0;
    end
end

Note that the keyboard command is also present in the switching function

%rhs_preprocessed_rhsBreakpoint:1/1/0
function switchingValue = sw_rhs_preprocessed_rhsBreakpoint_C717E8E3_1_1(datahandle,t,y,p)
    keyboard;
    x = 5;
    switchEval_if_1 = x - (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

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions