Presentation is loading. Please wait.

Presentation is loading. Please wait.

Introduction to MatLab: Circuit Analysis. 2 Introduction MatLab can be a useful tool in many applications. We will learn how to analyze a simple electrical.

Similar presentations


Presentation on theme: "Introduction to MatLab: Circuit Analysis. 2 Introduction MatLab can be a useful tool in many applications. We will learn how to analyze a simple electrical."— Presentation transcript:

1 Introduction to MatLab: Circuit Analysis

2 2 Introduction MatLab can be a useful tool in many applications. We will learn how to analyze a simple electrical circuit, set the problem up as N equations in N unknowns, and transform the equations into a matrix formulation that MatLab can solve.

3 Introduction to MatLab: Circuit Analysis3 Topics Electrical Devices.Electrical Devices. Kirchhoff’s Laws.Kirchhoff’s Laws. Analyzing a Resistor Network.Analyzing a Resistor Network. Inverting Matrices.Inverting Matrices. A MatLab Solution.A MatLab Solution.

4 Introduction to MatLab: Circuit Analysis4 Electrical Devices Voltage and Current.Voltage and Current. Sources.Sources. Resistors: Ohms Law.Resistors: Ohms Law. Capacitors: Charge Storage.Capacitors: Charge Storage. Inductors: Current Storage.Inductors: Current Storage.

5 Introduction to MatLab: Circuit Analysis5 Voltage and Current Voltage - the force that pushes electrical current around a circuit. (Sometimes called “potential” as in potential energy.)Voltage - the force that pushes electrical current around a circuit. (Sometimes called “potential” as in potential energy.) Current - the flow of electrical charge through a conductor. (Electrons flow backwards)Current - the flow of electrical charge through a conductor. (Electrons flow backwards) Conductor - the “pipe” through which an electrical current flows.Conductor - the “pipe” through which an electrical current flows.

6 Introduction to MatLab: Circuit Analysis6 Sources Voltage Source: Fixed Voltage waveformVoltage Source: Fixed Voltage waveform –Direct Current: A battery –Alternating Current: A generator (sine waves) Current Source: Fixed current waveform (AC or DC)Current Source: Fixed current waveform (AC or DC)

7 Introduction to MatLab: Circuit Analysis7 Resistors A constriction in the flow of currentA constriction in the flow of current Analogous to a small orifice in a water pipe, it takes a high pressure (voltage) to force a flow of water (current) through the resistance.Analogous to a small orifice in a water pipe, it takes a high pressure (voltage) to force a flow of water (current) through the resistance. Ohm’s Law V=I*ROhm’s Law V=I*R

8 Introduction to MatLab: Circuit Analysis8 Resistor Color Codes 0 - Black 1 - Brown 2 - Red 3 - Orange 4 - Yellow 5 - Green 6 - Blue 7 - Violet 8 - Gray 9 - White First two stripes: Digits Third stripe: Power of 10 Fourth stripe: Precision (none - 20%, silver - 10%, gold - 5%)

9 Introduction to MatLab: Circuit Analysis9 Capacitors A charge storage deviceA charge storage device Analogous to a water tank that is filled from the bottom. As the water level rises (charge divided by the cross sectional area – capacitance), the pressure (voltage) rises.Analogous to a water tank that is filled from the bottom. As the water level rises (charge divided by the cross sectional area – capacitance), the pressure (voltage) rises. Capacitor Law V=Q/CCapacitor Law V=Q/C

10 Introduction to MatLab: Circuit Analysis10 Inductors A current storage deviceA current storage device Analogous to the inertial effect of the flow of a fluid. The inductance is the mass that is moving.Analogous to the inertial effect of the flow of a fluid. The inductance is the mass that is moving. Inductor Law V=L*dI/dt (dI/dt is the “rate of change” in the current. This is analogous to velocity.)Inductor Law V=L*dI/dt (dI/dt is the “rate of change” in the current. This is analogous to velocity.)

11 Introduction to MatLab: Circuit Analysis11 Kirchhoff’s Laws Conservation of Current: The sum of all currents into a “node” equals zero.Conservation of Current: The sum of all currents into a “node” equals zero. Loop Law: The sum of all voltages around a loop equals zero.Loop Law: The sum of all voltages around a loop equals zero.

12 Introduction to MatLab: Circuit Analysis12 A Resistor Network

13 Introduction to MatLab: Circuit Analysis13 Measurements Multimeter (Analog and Digital)Multimeter (Analog and Digital) Voltage - measured relative to a reference, usually electrical ground.Voltage - measured relative to a reference, usually electrical ground. Resistance - meter puts a small current through the resistor and uses Ohm’s law.Resistance - meter puts a small current through the resistor and uses Ohm’s law. Current - careful, the meter can be destroyed by an over-current.Current - careful, the meter can be destroyed by an over-current.

14 Introduction to MatLab: Circuit Analysis14 Loop Equations Establish Independent Loop CurrentsEstablish Independent Loop Currents Write Equation for Each LoopWrite Equation for Each Loop –Determine voltages in terms of the loop currents. –Sum to zero (note: Alternative, use a set of “Node” equations)

15 Introduction to MatLab: Circuit Analysis15 Our Circuit – First Step 9v = 15k*(I 1 -I 2 ) + 1k*(I 1 -I 3 ) 0 = 10k*I k*(I 2 -I 1 ) + 15k*(I 2 -I 3 ) 0 = 1k*(I 3 -I 1 ) + 15k*(I 3 -I 2 ) + 3.3k*I 3

16 Introduction to MatLab: Circuit Analysis16 Our Circuit – Collecting Terms 9v = 16k*I k*I 2 - 1k*I 3 0 = -15k*I k*I k*I 3 0 = -1k*I k*I k*I 3

17 Introduction to MatLab: Circuit Analysis17 Vectorizing N Equations Rewrite, ordering variablesRewrite, ordering variables Formulate equivalent as an input column vector equals a coefficient matrix times an “unknowns” vectorFormulate equivalent as an input column vector equals a coefficient matrix times an “unknowns” vector Solution: pre-multiply both sides by the inverse of the coefficient matrix.Solution: pre-multiply both sides by the inverse of the coefficient matrix.

18 Introduction to MatLab: Circuit Analysis18 Our Circuit – Vector Equation 9v 16k -15k -1k I 1 0 = -15k 40k -15k * I k -15k 19.3k I 3

19 Introduction to MatLab: Circuit Analysis19 Inverting Matrices The inverse of a square matrix is that matrix which, when multiplied by the original matrix yields the Identity matrixThe inverse of a square matrix is that matrix which, when multiplied by the original matrix yields the Identity matrix In MatLab use “inv()”.In MatLab use “inv()”.

20 Introduction to MatLab: Circuit Analysis20 Our Circuit – Inverse Matrix I I 2 = * 0 *10 -3 I

21 Introduction to MatLab: Circuit Analysis21 Our Circuit – Currents I I 2 = * amps I

22 Introduction to MatLab: Circuit Analysis22 Intro To PSpice Originally from Microsim, now part of OrCad.Originally from Microsim, now part of OrCad. Demo/student CDROM is free at current version is 9.2, Limited to small circuits and part library.Demo/student CDROM is free at current version is 9.2, Limited to small circuits and part library. Graphical simulation of circuits and automated Printed Circuit board layout.Graphical simulation of circuits and automated Printed Circuit board layout.

23 Introduction to MatLab: Circuit Analysis ma ma1.256 ma


Download ppt "Introduction to MatLab: Circuit Analysis. 2 Introduction MatLab can be a useful tool in many applications. We will learn how to analyze a simple electrical."

Similar presentations


Ads by Google