function xdot = jjmatrix(t,x) %matrix formulation with
%constraint Ib as part of the vector
global  betac Ib
betaover = 1/(betac); %in an effort to have it run faster, but it does not
%for Ib=1.5 and Betac=1, it takes 58 seconds, but jj.m takes 42 seconds
%as does jj2.m
%
%
%
%The Matric, x(1)= phase, x(2)= voltage , x(3)= current
%
JJM= [ 0,                1,         0
 (-sin(x(1))./(x(1)*betac)), -betaover,   betaover
            0                 0          0];
xdot=JJM*x;

