function vprime = myode( t, v )
% parameters (defined elsewhere)
global sigma;
global r;
global b;

% map current vector to user-friendly variable names
x = v(1);
y = v(2);
z = v(3);

% compute derivatives with the Lorenz model
xprime = sigma*(-x+y);
yprime = r*x-y-x*z;
zprime = -b*z + x*y;

% map back to vector format
vprime=zeros(3,1);
vprime(1) = xprime;
vprime(2) = yprime;
vprime(3) = zprime;

end