skip to primary navigationskip to content
 

mmRHS.m

Objective-C source code icon mmRHS.m — Objective-C source code, 1 KB

File contents

function ret=mmRHS(t,y)
    % set up ret in the correct form (i.e. a column vector)
    ret = zeros(2,1);   
    % parameters used (to make them easy to change)
    kMinusOne = 0.1;
    kOne = 5;
    kTwo = 1;
    eZero = 0.1;    
    % extract current values of V and P
    S = y(1);
    C = y(2);
    % return updates
    ret(1) = kMinusOne * C - kOne * S * (eZero - C);
    ret(2) = kOne * S * (eZero - C) - (kMinusOne + kTwo)*C;