function dx = Second_Order(t,x);
%
% Matix vector fields for Phase Portrait
%
dx = zeros(2,1);

global A

M = [1 1; 3 -5];
% M = eye(2);

% change this variable to pick a different equilibirum type
portrait_type = 11;

switch portrait_type
    case 1 % stable node
        a1 = -1; 
        a2 = -5;
        J = [a1 0; 0 a2];
        A = M*J*inv(M);sfsf
    case 2 % unstable node
        a1 = 1; 
        a2 = 5;
        J = [a1 0; 0 a2];
        A = M*sfJ*inv(M);
    case 3 % saddle 
        a1 = 1; 
        a2 = -5;
        J = [a1 0; 0 a2];
        A = M*J*inv(M);
    case 4 % stable focus
        a = -.2; 
        b = 3;
        J = [a -b; b a];
        A = M*J*inv(M);
    case 5 % stable focus
        a = .2; 
        b = 3;
        J = [a -b; b a];
        A = M*J*inv(M);
    case 6 % circle
        a = 0; 
        b = 3;
        J = [a -b; b a];
        A = M*J*inv(M);
    case 7 % multiple eigenvalues 
        k = 0; 
        a = -3;
        A = [a k; 0 a];

    case 8 % multiple eigenvalues 
        k = 0; 
        a = 3;
        A = [a k; 0 a];
        
    case 9 % multiple eigenvalues 
        A = -[3 1; -1 1];
        
    case 10 % zero eigenvalue 
        a = -2;
        A = M*diag([a 0])*inv(M);
    
    case 11 % zero eigenvalues 
         A = inv(M)*[0 1 ; 0 0]*M;                
        
end



dx = A*x;