%-------Define segment length (cm) ---------------------
w = 0.10;
t = 0.0001;
l_1_a = 2.60;
l_1_b = 7.70;
l_1_c = 5.00;
l_1_d = 7.60;
l_2_a = 4.95;
l_2_b = 7.60;
l_2_c = 4.85;
l_2_d = 7.35;
l_3_a = 4.60;
l_3_b = 7.30;
l_3_c = 4.45;
l_3_d = 7.10;
l_4_a = 1.70;


gama = 0.20;
%---------- distance between branches (cm) -------
d_a1_a2 = 0.20;
d_a1_a3 = 0.40;
d_a1_c3 = 7.70;
d_a1_c2 = 7.90;
d_a1_c1 = 8.10;
d_a2_a3 = 0.20;
d_a2_c3 = 7.50;
d_a2_c2 = 7.70;
d_a2_c1 = 7.90;
d_a3_c3 = 7.30;
d_a3_c2 = 7.50;
d_a3_c1 = 7.70;
d_b1_b2 = 0.20;
d_b1_b3 = 0.40;
d_b1_d3 = 4.95;
d_b1_d2 = 5.15;
d_b1_d1 = 5.35;
d_b2_b3 = 0.20;
d_b2_d3 = 4.75;
d_b2_d2 = 4.95;
d_b2_d1 = 5.15;
d_b3_d3 = 4.55;
d_b3_d2 = 4.75;
d_b3_d1 = 4.95;
d_c3_c2 = 0.20;
d_c3_c1 = 0.40;
d_c2_c1 = 0.20;
d_d3_d2 = 0.20;
d_d3_d1 = 0.40;
d_d2_d1 = 0.20;

%----------calculate self inductance ---------
L_1_A = 2*l_1_a*(log((2*l_1_a)/(w+t))+0.50049+(w+t)/(3*l_1_a));
L_1_B = 2*l_1_b*(log((2*l_1_b)/(w+t))+0.50049+(w+t)/(3*l_1_b));
L_1_C = 2*l_1_c*(log((2*l_1_c)/(w+t))+0.50049+(w+t)/(3*l_1_c));
L_1_D = 2*l_1_d*(log((2*l_1_d)/(w+t))+0.50049+(w+t)/(3*l_1_d));
L_2_A = 2*l_2_a*(log((2*l_2_a)/(w+t))+0.50049+(w+t)/(3*l_2_a));
L_2_B = 2*l_2_b*(log((2*l_2_b)/(w+t))+0.50049+(w+t)/(3*l_2_b));
L_2_C = 2*l_2_c*(log((2*l_2_c)/(w+t))+0.50049+(w+t)/(3*l_2_c));
L_2_D = 2*l_2_d*(log((2*l_2_d)/(w+t))+0.50049+(w+t)/(3*l_2_d));
L_3_A = 2*l_3_a*(log((2*l_3_a)/(w+t))+0.50049+(w+t)/(3*l_3_a));
L_3_B = 2*l_3_b*(log((2*l_3_b)/(w+t))+0.50049+(w+t)/(3*l_3_b));
L_3_C = 2*l_3_c*(log((2*l_3_c)/(w+t))+0.50049+(w+t)/(3*l_3_c));
L_3_D = 2*l_3_d*(log((2*l_3_d)/(w+t))+0.50049+(w+t)/(3*l_3_d));

L_o = L_1_A+L_1_B+L_1_C+L_1_D+L_2_A+L_2_B+L_2_C+L_2_D+L_3_A+L_3_B+L_3_C+L_3_D

%-------- calculate Positive mutual inductance --------
M_A_1 = 2*l_1_a*((log((l_1_a/d_a1_a2)+((1+(l_1_a/d_a1_a2)^2)^(1/2))))-((1+(d_a1_a2/l_1_a)^2)^(1/2))+(d_a1_a2/l_1_a)); 
M_A_2 = 2*l_2_a*((log((l_2_a/d_a1_a2)+((1+(l_2_a/d_a1_a2)^2)^(1/2))))-((1+(d_a1_a2/l_2_a)^2)^(1/2))+(d_a1_a2/l_2_a)); 
M_gama = 2*d_a1_a2*((log((gama/d_a1_a2)+((1+(gama/d_a1_a2)^2)^(1/2))))-((1+(d_a1_a2/gama)^2)^(1/2))+(d_a1_a2/gama)); 
M_P_A1_A2 = (1/2)*(M_A_1+M_A_2-M_gama);

M_A_1 = 2*l_1_a*((log((l_1_a/d_a1_a3)+((1+(l_1_a/d_a1_a3)^2)^(1/2))))-((1+(d_a1_a3/l_1_a)^2)^(1/2))+(d_a1_a3/l_1_a)); 
M_A_3 = 2*l_3_a*((log((l_3_a/d_a1_a3)+((1+(l_3_a/d_a1_a3)^2)^(1/2))))-((1+(d_a1_a3/l_3_a)^2)^(1/2))+(d_a1_a3/l_3_a)); 
M_gama = 2*d_a1_a3*((log((gama/d_a1_a3)+((1+(gama/d_a1_a3)^2)^(1/2))))-((1+(d_a1_a3/gama)^2)^(1/2))+(d_a1_a3/gama)); 
M_P_A1_A3 = (1/2)*(M_A_1+M_A_3-M_gama);

M_A_2 = 2*l_2_a*((log((l_2_a/d_a2_a3)+((1+(l_2_a/d_a2_a3)^2)^(1/2))))-((1+(d_a2_a3/l_2_a)^2)^(1/2))+(d_a2_a3/l_2_a)); 
M_A_3 = 2*l_3_a*((log((l_3_a/d_a2_a3)+((1+(l_3_a/d_a2_a3)^2)^(1/2))))-((1+(d_a2_a3/l_3_a)^2)^(1/2))+(d_a2_a3/l_3_a)); 
M_gama = 2*d_a2_a3*((log((gama/d_a2_a3)+((1+(gama/d_a2_a3)^2)^(1/2))))-((1+(d_a2_a3/gama)^2)^(1/2))+(d_a2_a3/gama));
M_P_A2_A3 = (1/2)*(M_A_2+M_A_3-M_gama);

M_B_2 = 2*l_2_b*((log((l_2_b/d_b1_b2)+((1+(l_2_b/d_b1_b2)^2)^(1/2))))-((1+(d_b1_b2/l_2_b)^2)^(1/2))+(d_b1_b2/l_2_b)); 
M_B_1 = 2*l_1_b*((log((l_1_b/d_b1_b2)+((1+(l_1_b/d_b1_b2)^2)^(1/2))))-((1+(d_b1_b2/l_1_b)^2)^(1/2))+(d_b1_b2/l_1_b)); 
M_gama = 2*d_b1_b2*((log((gama/d_b1_b2)+((1+(gama/d_b1_b2)^2)^(1/2))))-((1+(d_b1_b2/gama)^2)^(1/2))+(d_b1_b2/gama));
M_P_B1_B2 = (1/2)*(M_B_2+M_B_1-M_gama);

M_B_3 = 2*l_3_b*((log((l_3_b/d_b1_b3)+((1+(l_3_b/d_b1_b3)^2)^(1/2))))-((1+(d_b1_b3/l_3_b)^2)^(1/2))+(d_b1_b3/l_3_b)); 
M_B_1 = 2*l_1_b*((log((l_1_b/d_b1_b3)+((1+(l_1_b/d_b1_b3)^2)^(1/2))))-((1+(d_b1_b3/l_1_b)^2)^(1/2))+(d_b1_b3/l_1_b)); 
M_gama = 2*d_b1_b3*((log((gama/d_b1_b3)+((1+(gama/d_b1_b3)^2)^(1/2))))-((1+(d_b1_b3/gama)^2)^(1/2))+(d_b1_b3/gama));
M_P_B1_B3 = (1/2)*(M_B_3+M_B_1-M_gama);

M_B_3 = 2*l_3_b*((log((l_3_b/d_b2_b3)+((1+(l_3_b/d_b2_b3)^2)^(1/2))))-((1+(d_b2_b3/l_3_b)^2)^(1/2))+(d_b2_b3/l_3_b)); 
M_B_2 = 2*l_2_b*((log((l_2_b/d_b2_b3)+((1+(l_2_b/d_b2_b3)^2)^(1/2))))-((1+(d_b2_b3/l_2_b)^2)^(1/2))+(d_b2_b3/l_2_b)); 
M_gama = 2*d_b2_b3*((log((gama/d_b2_b3)+((1+(gama/d_b2_b3)^2)^(1/2))))-((1+(d_b2_b3/gama)^2)^(1/2))+(d_b2_b3/gama));
M_P_B2_B3 = (1/2)*(M_B_2+M_B_3-M_gama);

M_C_2 = 2*l_2_c*((log((l_2_c/d_c2_c1)+((1+(l_2_c/d_c2_c1)^2)^(1/2))))-((1+(d_c2_c1/l_2_c)^2)^(1/2))+(d_c2_c1/l_2_c)); 
M_C_1 = 2*l_1_c*((log((l_1_c/d_c2_c1)+((1+(l_1_c/d_c2_c1)^2)^(1/2))))-((1+(d_c2_c1/l_1_c)^2)^(1/2))+(d_c2_c1/l_1_c)); 
M_gama = 2*d_c2_c1*((log((gama/d_c2_c1)+((1+(gama/d_c2_c1)^2)^(1/2))))-((1+(d_c2_c1/gama)^2)^(1/2))+(d_c2_c1/gama));
M_P_C1_C2 = (1/2)*(M_C_1+M_C_2-M_gama);

M_C_3 = 2*l_3_c*((log((l_3_c/d_c3_c1)+((1+(l_3_b/d_c3_c1)^2)^(1/2))))-((1+(d_c3_c1/l_3_c)^2)^(1/2))+(d_c3_c1/l_3_c)); 
M_C_1 = 2*l_1_c*((log((l_1_c/d_c3_c1)+((1+(l_1_b/d_c3_c1)^2)^(1/2))))-((1+(d_c3_c1/l_1_c)^2)^(1/2))+(d_c3_c1/l_1_c)); 
M_gama = 2*d_c3_c1*((log((gama/d_c3_c1)+((1+(gama/d_c3_c1)^2)^(1/2))))-((1+(d_c3_c1/gama)^2)^(1/2))+(d_c3_c1/gama));
M_P_C1_C3 = (1/2)*(M_C_1+M_C_3-M_gama);

M_C_3 = 2*l_3_c*((log((l_3_c/d_c3_c2)+((1+(l_3_c/d_c3_c2)^2)^(1/2))))-((1+(d_c3_c2/l_3_c)^2)^(1/2))+(d_c3_c2/l_3_c)); 
M_C_2 = 2*l_2_c*((log((l_2_c/d_c3_c2)+((1+(l_2_c/d_c3_c2)^2)^(1/2))))-((1+(d_c3_c2/l_2_c)^2)^(1/2))+(d_c3_c2/l_2_c)); 
M_gama = 2*d_c3_c2*((log((gama/d_c3_c2)+((1+(gama/d_c3_c2)^2)^(1/2))))-((1+(d_c3_c2/gama)^2)^(1/2))+(d_c3_c2/gama));
M_P_C2_C3 = (1/2)*(M_C_2+M_C_3-M_gama);

M_D_2 = 2*l_2_d*((log((l_2_d/d_d2_d1)+((1+(l_2_d/d_d2_d1)^2)^(1/2))))-((1+(d_d2_d1/l_2_d)^2)^(1/2))+(d_d2_d1/l_2_d)); 
M_D_1 = 2*l_1_d*((log((l_1_d/d_d2_d1)+((1+(l_1_d/d_d2_d1)^2)^(1/2))))-((1+(d_d2_d1/l_1_d)^2)^(1/2))+(d_d2_d1/l_1_d)); 
M_gama = 2*d_d2_d1*((log((gama/d_d2_d1)+((1+(gama/d_d2_d1)^2)^(1/2))))-((1+(d_d2_d1/gama)^2)^(1/2))+(d_d2_d1/gama));
M_P_D1_D2 = (1/2)*(M_D_1+M_D_2-M_gama);

M_D_3 = 2*l_3_d*((log((l_3_d/d_d3_d1)+((1+(l_3_d/d_d3_d1)^2)^(1/2))))-((1+(d_d3_d1/l_3_d)^2)^(1/2))+(d_d3_d1/l_3_d)); 
M_D_1 = 2*l_1_d*((log((l_1_d/d_d3_d1)+((1+(l_1_d/d_d3_d1)^2)^(1/2))))-((1+(d_d3_d1/l_1_d)^2)^(1/2))+(d_d3_d1/l_1_d)); 
M_gama = 2*d_d3_d1*((log((gama/d_d3_d1)+((1+(gama/d_d3_d1)^2)^(1/2))))-((1+(d_d3_d1/gama)^2)^(1/2))+(d_d3_d1/gama));
M_P_D1_D3 = (1/2)*(M_D_1+M_D_3-M_gama);

M_D_3 = 2*l_3_d*((log((l_3_d/d_d3_d2)+((1+(l_3_d/d_d3_d2)^2)^(1/2))))-((1+(d_d3_d2/l_3_d)^2)^(1/2))+(d_d3_d2/l_3_d)); 
M_D_2 = 2*l_2_d*((log((l_2_d/d_d3_d2)+((1+(l_2_d/d_d3_d2)^2)^(1/2))))-((1+(d_d3_d2/l_2_d)^2)^(1/2))+(d_d3_d2/l_2_d)); 
M_gama = 2*d_d3_d2*((log((gama/d_d3_d2)+((1+(gama/d_d3_d2)^2)^(1/2))))-((1+(d_d3_d2/gama)^2)^(1/2))+(d_d3_d2/gama));
M_P_D2_D3 = (1/2)*(M_D_2+M_D_3-M_gama);

M_P = 2*(M_P_A1_A2+M_P_A1_A3+M_P_A2_A3)+2*(M_P_B1_B2+M_P_B1_B3+M_P_B2_B3)+2*(M_P_C1_C2+M_P_C1_C3+M_P_C2_C3)+2*(M_P_D1_D2+M_P_D1_D3+M_P_D2_D3)
%-------- calculate negative mutual inductance --------

M_A_1 = 2*l_1_a*((log((l_1_a/d_a1_c3)+((1+(l_1_a/d_a1_c3)^2)^(1/2))))-((1+(d_a1_c3/l_1_a)^2)^(1/2))+(d_a1_c3/l_1_a)); 
M_C_3 = 2*l_3_c*((log((l_3_c/d_a1_c3)+((1+(l_3_c/d_a1_c3)^2)^(1/2))))-((1+(d_a1_c3/l_3_c)^2)^(1/2))+(d_a1_c3/l_3_c)); 
M_gama = 2*d_a1_c3*((log((gama/d_a1_c3)+((1+(gama/d_a1_c3)^2)^(1/2))))-((1+(d_a1_c3/gama)^2)^(1/2))+(d_a1_c3/gama)); 
M_N_A1_C3 = (1/2)*(M_A_1+M_C_3-M_gama);

M_A_1 = 2*l_1_a*((log((l_1_a/d_a1_c2)+((1+(l_1_a/d_a1_c2)^2)^(1/2))))-((1+(d_a1_c2/l_1_a)^2)^(1/2))+(d_a1_c2/l_1_a)); 
M_C_2 = 2*l_2_c*((log((l_2_c/d_a1_c2)+((1+(l_2_c/d_a1_c2)^2)^(1/2))))-((1+(d_a1_c2/l_2_c)^2)^(1/2))+(d_a1_c2/l_2_c)); 
M_gama = 2*d_a1_c2*((log((gama/d_a1_c2)+((1+(gama/d_a1_c2)^2)^(1/2))))-((1+(d_a1_c2/gama)^2)^(1/2))+(d_a1_c2/gama)); 
M_N_A1_C2 = (1/2)*(M_A_1+M_C_2-M_gama);

M_A_1 = 2*l_1_a*((log((l_1_a/d_a1_c1)+((1+(l_1_a/d_a1_c1)^2)^(1/2))))-((1+(d_a1_c1/l_1_a)^2)^(1/2))+(d_a1_c1/l_1_a)); 
M_C_1 = 2*l_1_c*((log((l_1_c/d_a1_c1)+((1+(l_1_c/d_a1_c1)^2)^(1/2))))-((1+(d_a1_c1/l_1_c)^2)^(1/2))+(d_a1_c1/l_1_c)); 
M_gama = 2*d_a1_c1*((log((gama/d_a1_c2)+((1+(gama/d_a1_c1)^2)^(1/2))))-((1+(d_a1_c1/gama)^2)^(1/2))+(d_a1_c1/gama)); 
M_N_A1_C1 = (1/2)*(M_A_1+M_C_1-M_gama);


M_A_2 = 2*l_2_a*((log((l_2_a/d_a2_c3)+((1+(l_2_a/d_a2_c3)^2)^(1/2))))-((1+(d_a2_c3/l_2_a)^2)^(1/2))+(d_a2_c3/l_2_a)); 
M_C_3 = 2*l_3_c*((log((l_3_c/d_a2_c3)+((1+(l_3_c/d_a2_c3)^2)^(1/2))))-((1+(d_a2_c3/l_3_c)^2)^(1/2))+(d_a2_c3/l_3_c)); 
M_gama = 2*d_a2_c3*((log((gama/d_a2_c3)+((1+(gama/d_a2_c3)^2)^(1/2))))-((1+(d_a2_c3/gama)^2)^(1/2))+(d_a2_c3/gama));
M_N_A2_C3 = (1/2)*(M_A_2+M_C_3-M_gama);

M_A_2 = 2*l_2_a*((log((l_2_a/d_a2_c2)+((1+(l_2_a/d_a2_c2)^2)^(1/2))))-((1+(d_a2_c2/l_2_a)^2)^(1/2))+(d_a2_c2/l_2_a)); 
M_C_2 = 2*l_2_c*((log((l_3_c/d_a2_c2)+((1+(l_2_c/d_a2_c2)^2)^(1/2))))-((1+(d_a2_c2/l_2_c)^2)^(1/2))+(d_a2_c2/l_2_c)); 
M_gama = 2*d_a2_c2*((log((gama/d_a2_c2)+((1+(gama/d_a2_c2)^2)^(1/2))))-((1+(d_a2_c2/gama)^2)^(1/2))+(d_a2_c2/gama)); 
M_N_A2_C2 = (1/2)*(M_A_2+M_C_2-M_gama);

M_A_2 = 2*l_2_a*((log((l_2_a/d_a2_c1)+((1+(l_2_a/d_a2_c1)^2)^(1/2))))-((1+(d_a2_c1/l_2_a)^2)^(1/2))+(d_a2_c1/l_2_a)); 
M_C_1 = 2*l_1_c*((log((l_1_c/d_a2_c1)+((1+(l_1_c/d_a2_c1)^2)^(1/2))))-((1+(d_a2_c1/l_1_c)^2)^(1/2))+(d_a2_c1/l_1_c)); 
M_gama = 2*d_a2_c1*((log((gama/d_a2_c1)+((1+(gama/d_a2_c1)^2)^(1/2))))-((1+(d_a2_c1/gama)^2)^(1/2))+(d_a2_c1/gama));
M_N_A2_C1 = (1/2)*(M_A_2+M_C_1-M_gama);

M_A_3 = 2*l_3_a*((log((l_3_a/d_a3_c3)+((1+(l_3_a/d_a3_c3)^2)^(1/2))))-((1+(d_a3_c3/l_3_a)^2)^(1/2))+(d_a3_c3/l_3_a)); 
M_C_3 = 2*l_3_c*((log((l_3_c/d_a3_c3)+((1+(l_3_c/d_a3_c3)^2)^(1/2))))-((1+(d_a3_c3/l_3_c)^2)^(1/2))+(d_a3_c3/l_3_c)); 
M_gama = 2*d_a3_c3*((log((gama/d_a3_c3)+((1+(gama/d_a3_c3)^2)^(1/2))))-((1+(d_a3_c3/gama)^2)^(1/2))+(d_a3_c3/gama));
M_N_A3_C3 = (1/2)*(M_A_3+M_C_3-M_gama);

M_A_3 = 2*l_3_a*((log((l_3_a/d_a3_c2)+((1+(l_3_a/d_a3_c2)^2)^(1/2))))-((1+(d_a3_c2/l_3_a)^2)^(1/2))+(d_a3_c2/l_3_a)); 
M_C_2 = 2*l_2_c*((log((l_2_c/d_a3_c2)+((1+(l_2_c/d_a3_c2)^2)^(1/2))))-((1+(d_a3_c2/l_2_c)^2)^(1/2))+(d_a3_c2/l_2_c)); 
M_gama = 2*d_a3_c2*((log((gama/d_a3_c2)+((1+(gama/d_a3_c2)^2)^(1/2))))-((1+(d_a3_c2/gama)^2)^(1/2))+(d_a3_c2/gama));
M_N_A3_C2 = (1/2)*(M_A_3+M_C_2-M_gama);

M_A_3 = 2*l_3_a*((log((l_3_a/d_a3_c1)+((1+(l_3_a/d_a3_c1)^2)^(1/2))))-((1+(d_a3_c1/l_3_a)^2)^(1/2))+(d_a3_c1/l_3_a)); 
M_C_1 = 2*l_1_c*((log((l_1_c/d_a3_c1)+((1+(l_1_c/d_a3_c1)^2)^(1/2))))-((1+(d_a3_c1/l_1_c)^2)^(1/2))+(d_a3_c1/l_1_c)); 
M_gama = 2*d_a3_c1*((log((gama/d_a3_c1)+((1+(gama/d_a3_c1)^2)^(1/2))))-((1+(d_a3_c1/gama)^2)^(1/2))+(d_a3_c1/gama));
M_N_A3_C1 = (1/2)*(M_A_3+M_C_1-M_gama);

M_B_1 = 2*l_1_b*((log((l_1_b/d_b1_d3)+((1+(l_1_b/d_b1_d3)^2)^(1/2))))-((1+(d_b1_d3/l_1_b)^2)^(1/2))+(d_b1_d3/l_1_b)); 
M_D_3 = 2*l_3_d*((log((l_3_d/d_b1_d3)+((1+(l_3_d/d_b1_d3)^2)^(1/2))))-((1+(d_b1_d3/l_3_d)^2)^(1/2))+(d_b1_d3/l_3_d)); 
M_gama = 2*d_b1_d3*((log((gama/d_b1_d3)+((1+(gama/d_b1_d3)^2)^(1/2))))-((1+(d_b1_d3/gama)^2)^(1/2))+(d_b1_d3/gama));
M_N_B1_D3 = (1/2)*(M_B_1+M_D_3-M_gama);

M_B_1 = 2*l_1_b*((log((l_1_b/d_b1_d2)+((1+(l_1_b/d_b1_d2)^2)^(1/2))))-((1+(d_b1_d2/l_1_b)^2)^(1/2))+(d_b1_d2/l_1_b)); 
M_D_2 = 2*l_2_d*((log((l_2_d/d_b1_d2)+((1+(l_2_d/d_b1_d2)^2)^(1/2))))-((1+(d_b1_d2/l_2_d)^2)^(1/2))+(d_b1_d2/l_2_d)); 
M_gama = 2*d_b1_d2*((log((gama/d_b1_d2)+((1+(gama/d_b1_d2)^2)^(1/2))))-((1+(d_b1_d2/gama)^2)^(1/2))+(d_b1_d2/gama));
M_N_B1_D2 = (1/2)*(M_B_1+M_D_2-M_gama);

M_B_1 = 2*l_1_b*((log((l_1_b/d_b1_d1)+((1+(l_1_b/d_b1_d1)^2)^(1/2))))-((1+(d_b1_d1/l_1_b)^2)^(1/2))+(d_b1_d1/l_1_b)); 
M_D_1 = 2*l_1_d*((log((l_1_d/d_b1_d1)+((1+(l_1_d/d_b1_d1)^2)^(1/2))))-((1+(d_b1_d1/l_1_d)^2)^(1/2))+(d_b1_d1/l_1_d)); 
M_gama = 2*d_b1_d1*((log((gama/d_b1_d1)+((1+(gama/d_b1_d1)^2)^(1/2))))-((1+(d_b1_d1/gama)^2)^(1/2))+(d_b1_d1/gama));
M_N_B1_D1 = (1/2)*(M_B_1+M_D_1-M_gama);

M_B_2 = 2*l_2_b*((log((l_2_b/d_b2_d3)+((1+(l_2_b/d_b2_d3)^2)^(1/2))))-((1+(d_b2_d3/l_2_b)^2)^(1/2))+(d_b2_d3/l_2_b)); 
M_D_3 = 2*l_3_d*((log((l_3_d/d_b2_d3)+((1+(l_3_d/d_b2_d3)^2)^(1/2))))-((1+(d_b2_d3/l_3_d)^2)^(1/2))+(d_b2_d3/l_3_d)); 
M_gama = 2*d_b2_d3*((log((gama/d_b2_d3)+((1+(gama/d_b2_d3)^2)^(1/2))))-((1+(d_b2_d3/gama)^2)^(1/2))+(d_b2_d3/gama));
M_N_B2_D3 = (1/2)*(M_B_2+M_D_3-M_gama);

M_B_2 = 2*l_2_b*((log((l_2_b/d_b2_d2)+((1+(l_2_b/d_b2_d2)^2)^(1/2))))-((1+(d_b2_d2/l_2_b)^2)^(1/2))+(d_b2_d2/l_2_b)); 
M_D_2 = 2*l_2_d*((log((l_2_d/d_b2_d2)+((1+(l_2_d/d_b2_d2)^2)^(1/2))))-((1+(d_b2_d2/l_2_d)^2)^(1/2))+(d_b2_d2/l_2_d)); 
M_gama = 2*d_b2_d2*((log((gama/d_b2_d2)+((1+(gama/d_b2_d2)^2)^(1/2))))-((1+(d_b2_d2/gama)^2)^(1/2))+(d_b2_d2/gama));
M_N_B2_D2 = (1/2)*(M_B_2+M_D_2-M_gama);

M_B_2 = 2*l_2_b*((log((l_2_b/d_b2_d1)+((1+(l_2_b/d_b2_d1)^2)^(1/2))))-((1+(d_b2_d1/l_2_b)^2)^(1/2))+(d_b2_d1/l_2_b)); 
M_D_1 = 2*l_1_d*((log((l_1_d/d_b2_d1)+((1+(l_1_d/d_b2_d1)^2)^(1/2))))-((1+(d_b2_d1/l_1_d)^2)^(1/2))+(d_b2_d1/l_1_d)); 
M_gama = 2*d_b2_d1*((log((gama/d_b2_d1)+((1+(gama/d_b2_d1)^2)^(1/2))))-((1+(d_b2_d1/gama)^2)^(1/2))+(d_b2_d1/gama));
M_N_B2_D1 = (1/2)*(M_B_2+M_D_1-M_gama);
 
M_B_3 = 2*l_3_b*((log((l_3_b/d_b3_d3)+((1+(l_3_b/d_b3_d3)^2)^(1/2))))-((1+(d_b3_d3/l_3_b)^2)^(1/2))+(d_b3_d3/l_3_b)); 
M_D_3 = 2*l_3_d*((log((l_3_d/d_b3_d3)+((1+(l_3_d/d_b3_d3)^2)^(1/2))))-((1+(d_b3_d3/l_3_d)^2)^(1/2))+(d_b3_d3/l_3_d)); 
M_gama = 2*d_b3_d3*((log((gama/d_b3_d3)+((1+(gama/d_b3_d3)^2)^(1/2))))-((1+(d_b3_d3/gama)^2)^(1/2))+(d_b3_d3/gama));
M_N_B3_D3 = (1/2)*(M_B_3+M_D_3-M_gama);
 
M_B_3 = 2*l_3_b*((log((l_3_b/d_b3_d2)+((1+(l_3_b/d_b3_d2)^2)^(1/2))))-((1+(d_b3_d2/l_3_b)^2)^(1/2))+(d_b3_d2/l_3_b)); 
M_D_2 = 2*l_2_d*((log((l_2_d/d_b3_d2)+((1+(l_2_d/d_b3_d2)^2)^(1/2))))-((1+(d_b3_d2/l_2_d)^2)^(1/2))+(d_b3_d2/l_2_d)); 
M_gama = 2*d_b3_d2*((log((gama/d_b3_d2)+((1+(gama/d_b3_d2)^2)^(1/2))))-((1+(d_b3_d2/gama)^2)^(1/2))+(d_b3_d2/gama));
M_N_B3_D2 = (1/2)*(M_B_3+M_D_2-M_gama);

M_B_3 = 2*l_3_b*((log((l_3_b/d_b3_d1)+((1+(l_3_b/d_b3_d1)^2)^(1/2))))-((1+(d_b3_d1/l_3_b)^2)^(1/2))+(d_b3_d1/l_3_b)); 
M_D_1 = 2*l_1_d*((log((l_1_d/d_b3_d1)+((1+(l_1_d/d_b3_d1)^2)^(1/2))))-((1+(d_b3_d1/l_1_d)^2)^(1/2))+(d_b3_d1/l_1_d)); 
M_gama = 2*d_b3_d1*((log((gama/d_b3_d1)+((1+(gama/d_b3_d1)^2)^(1/2))))-((1+(d_b3_d1/gama)^2)^(1/2))+(d_b3_d1/gama));
M_N_B3_D1 = (1/2)*(M_B_3+M_D_1-M_gama);

M_N = 2*(M_N_A1_C3+M_N_A1_C2+M_N_A1_C1)+2*(M_N_A2_C3+M_N_A2_C2+M_N_A2_C1)+2*(M_N_A3_C3+M_N_A3_C2+M_N_A3_C1)+2*(M_N_B1_D3+M_N_B1_D2+M_N_B1_D1)+2*(M_N_B2_D3+M_N_B2_D2+M_N_B2_D1)+2*(M_N_B3_D3+M_N_B3_D2+M_N_B3_D1)
%--------- Total Inductance (nH) -----------
L_T = L_o + M_P -M_N
