180 likes | 399 Vues
TECHNIQUES OF CIRCUIT ANALYSIS. MATLAB SOLUTION EXAMPLES. MATLAB OBJECTIVES. TO USE MATLAB TOOLS FOR CIRCUIT ANALYSIS ALGEBRAIC LINEAR EQUATIONS: AX=B A : square matrix, X:Unknown elements currents and voltages, column matric; B:knowns Independent source values , column matric
E N D
TECHNIQUES OF CIRCUIT ANALYSIS MATLAB SOLUTION EXAMPLES Ertuğrul Eriş
MATLAB OBJECTIVES • TO USE MATLAB TOOLS FOR CIRCUIT ANALYSIS • ALGEBRAIC LINEAR EQUATIONS: AX=B • A:square matrix, • X:Unknown elements currents and voltages, column matric; • B:knowns Independent source values , column matric • MATLAB: X=A\B • ALTERNATIVE: S=solve(Eq1,...) Ertuğrul Eriş
CIRCUIT EQUATIONS :KCL TOPOLOGY: KIRCHOFF’S CURRENT LAW EQUATIONS: nd-1 =4 i5 i1 i4 i3 i2 Ertuğrul Eriş
CIRCUIT EQUATIONS: KVL TOPOLOGY: KIRCHOFF’S VOLTAGE LAW EQUATIONS: ne-nd+1 =3 i2 i5 i4 i3 Ertuğrul Eriş
CIRCUIT EQUATIONS: V-I ELEMENTS: V-I RELATIONS, DEFINITION RELATIONS : ne =7 i2 i5 i4 i3 Ertuğrul Eriş
2 ne CIRCUIT EQUATIONS KCL equations: 3 KVL equations: 4 V-I relations:7 Definition relations Ertuğrul Eriş
X = -2.0000 2.0000 0.8000 1.2000 1.0000 0.2000 0.2000 20.0000 4.0000 16.0000 6.0000 10.0000 0.4000 9.6000 A=[1,1,0,0,0,0,0,0,0,0,0,0,0,0;0,-1,1,1,0,0,0,0,0,0,0,0,0,0; 0,0,0,-1,1,1,0,0,0,0,0,0,0,0;0,0,0,0,0,-1,1,0,0,0,0,0,0,0; 0,0,0,0,0,0,0,-1,1,1,0,0,0,0;0,0,0,0,0,0,0,0,0,-1,1,1,0,0; 0,0,0,0,0,0,0,0,0,0,0,-1,1,1;0,0,0,0,0,0,0,1,0,0,0,0,0,0; 0,-2,0,0,0,0,0,0,1,0,0,0,0,0;0,0,-20,0,0,0,0,0,0,1,0,0,0,0; 0,0,0,-5,0,0,0,0,0,0,1,0,0,0;0,0,0,0,-10,0,0,0,0,0,0,1,0,0; 0,0,0,0,0,-2,0,0,0,0,0,0,1,0;0,0,0,-8,0,0,0,0,0,0,0,0,0,1]; B=[0;0;0;0;0;0;0;20;0;0;0;0;0;0]; X=A\B ErtuğrulEriş
ALTERNATIVE MATLAB TOOL:’solve’ i6 Elements numeration simple in order to follow the results easily i4 i2 i7 i1 i3 i5 Definition re v1=20 KCL: KVL: v2=2i2 i1+i2=0 -v1+v2+v3=0 v3=20i3 -12+i3+i4=0 -v3+v4+v5=0 v4=10i4 -i4+i5+i6=0 -v5+v6+v7=0 v5=10i5 -i6+i7=0 v6=2i6 v7=8i4 Ertuğrul Eriş
ALTERNATIVE MATLAB SOLUTION Equations are written directly not in the matrix format: s=solve('i1+i2=0','-i2+i3+i4=0','-i4+i5+i6=0','-i6+i7=0','-v1+v2+v3=0','-v3+v4+v5=0','-v5+v6+v7=0','v1=20','v2=2*i2','v3=20*i3','v4=5*i4','v5=10*i5','v6=2*i6','v7=8*i4'); s=[s.i1 s.i2 s.i3 s.i4 s.i5 s.i6 s.i7 s.v1 s.v2 s.v3 s.v4 s.v5 s.v6 s.v7] s = [ -2, 2, 4/5, 6/5, 1, 1/5, 1/5, 20, 4, 16, 6, 10, 2/5, 48/5] Ertuğrul Eriş
CIRCUIT ANALYSIS: NODE- VOLTAGE METHOD 1.Step KCL Element currents Nd-1 ne 2.Step element voltages Nd-1 ne 3.Step Node Voltages Nd-1 nd-1 New variables Definition relation Unknowns V-I relation Number of equations Node voltages Number of unknowns AX=B; X Elements voltages Definition relation Independent Voltage’s current is unknown but its known voltage gives an additional equation Elements currents Ertuğrul Eriş
NODE VOLTAGE CIRCUIT EQUATIONS 3 4 2 1 i2 i5 i1 i4 i3 Node voltage equations:4 Originated from KCL Supplementary equations:2 Ertuğrul Eriş
SIMPLIFIED NODE VOLTAGE CIRCUIT EQUATIONS 3 4 2 1 i2 i5 i1 i4 i3 Ertuğrul Eriş
NODE VOLTAGE CIRCUIT EQUATIONS SOLUTION 3 4 2 1 A=[1,0,1/2,-1/2,0,0;0,0,-1/2,3/4,-1/5,0;0,0,0,-1/5,4/5,-1/2;0,1,0,0,-1/2,1/2;0,0,1,0,0,0;0,0,0,-8/5,8/5,1]; B=[0;0;0;0;20;0]; X=A\B X = i2 i5 i1 i4 i3 -2.0000 0.2000 20.0000 16.0000 10.0000 9.6000 Ertuğrul Eriş
NODE VOLTAGE CIRCUIT EQUATIONS ALTERNATIVE SOLUTION 3 4 2 1 i2 i5 i1 • s=solve('i1+0.5*vd1-0.5*vd2','-0.5*vd1+0.75*vd2-0.2*vd3','-0.2*vd2+0.8*vd3-0.5*vd4','i2-0.5*vd3+0.5*vd4','vd1-20','-1.6*vd2+1.6*vd3+vd4') • s = • [ -2.0, 0.2, 20.0, 16.0, 10.0, 9.6] i4 i3 i1+0.5*vd1-0.5*vd2=0 -0.5*vd1+0.75*vd2-0.2*vd3=0 -0.2*vd2+0.8*vd3-0.5*vd4=0 i7-0.5*vd3+0.5*vd4=0 Vd1=20 -1.6*vd2+1.6*vd3+vd4=0 Ertuğrul Eriş
CIRCUIT ANALYSIS: MESH - CURRENT METHOD 1.STEP KVL Elements’ voltages ne-nd+1 ne 2.STEP Elements’ currents ne-nd+1 ne 3.STEP Mesh currents ne-nd+1 ne-nd+1 New variables Definition relations Unknowns Number of equations Mesh currents V-I relations Number of unknowns AX=B; X Elements currents Definition relations Independent current’s voltage is unknown but its known current gives an additional equation Elements voltages Ertuğrul Eriş
CIRCUIT EQUATIONS: MESH CURRENT RC=1000Ω, β= 100 RE=100Ω, V0= 5V R1=120Ω, Vcc=10V R2=20Ω Mesh current equations Supplementary equation Ertuğrul Eriş
CIRCUIT EQUATIONS: MESH CURRENT A=[1120,0,-1000,1; 0,120,-100,0; -1000,-100,1100,-1; 101,-100,-1,0]; B=[5;-5;-10;0]; >> X=A\B X = -0.0714 A -0.0717 A -0.0361 A 48.8661 V Ertuğrul Eriş
CIRCUIT EQUATIONS: MESH CURRENT ALTERNATIVE SOLUTION s=solve('1120*ia-1000*ic+va-5','120*ib-100*ic+5','-1000*ia-100*ib+1100*ic-va+10','101*ia-100*ib-ic'); >> s=[s.ia s.ib s.ic s.va] s = [ -1011/14164, -254/3541, -511/14164, 173035/3541] Ertuğrul Eriş