%ex8_12.m
% 2012/3/19
% MESH Analysis
%
% Loop 1 (I1 cuurent): +E1 - VR1  -VR2 - E2 = 0
% Loop 2 (I2 current):  E2  - VR2 - VR3 = 0
% Then find 
%   VR1 = I1*R1
%   VR3 = I2* R2
%   VR2 from sum of current through VR2 = R2 * (I1 + I2)
%
% -7*I1 + 6*I2 = 5
%  6*I1 - 8*I2  = -10
% Second Order Determinants to solve I1, and I3;
% Then obtain I2 = I1 + I3 
%
%       Colum Colum
%         1     2      
%      |  d11  d12  |  <== Row 1
%  D = |  d21  d22  |  <== Row 2
%
%  det(D) = (d11*d22) - (d21*d12) = 20
%        
%  det(num1) = 20
%  det(num2) = 40
D = [-7  6; ...
      6  -8];
num1 = [  5   6; ...
        -10  -8];
num2 = [ -7     5; ...
          6  -10];
I1 = det(num1)/det(D)   % 1 A
I2 = det(num2)/det(D)   % 2 A
IR2 = I2 - I1           % 1 A