ebook img

Computational Electronic Circuits: Simulation and Analysis with MATLAB® PDF

457 Pages·2021·24.288 MB·English
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview Computational Electronic Circuits: Simulation and Analysis with MATLAB®

Sotoudeh Hamedi-Hagh Computational Electronic Circuits SSiimmuullaattiioonn aanndd AAnnaallyyssiiss wwiitthh MMAATTLLAABB®® Computational Electronic Circuits Sotoudeh Hamedi-Hagh Computational Electronic Circuits ® Simulation and Analysis with MATLAB SotoudehHamedi-Hagh SanJoseStateUniversity SanJose,CA,USA ISBN978-3-030-75567-6 ISBN978-3-030-75568-3 (eBook) https://doi.org/10.1007/978-3-030-75568-3 ©TheEditor(s)(ifapplicable)andTheAuthor(s),underexclusivelicensetoSpringerNatureSwitzerland AG2022 Thisworkissubjecttocopyright.AllrightsaresolelyandexclusivelylicensedbythePublisher,whether thewholeorpartofthematerialisconcerned,specificallytherightsoftranslation,reprinting,reuseof illustrations, recitation, broadcasting, reproduction on microfilms or in any other physical way, and transmission or information storage and retrieval, electronic adaptation, computer software, or by similarordissimilarmethodologynowknownorhereafterdeveloped. Theuseofgeneraldescriptivenames,registerednames,trademarks,servicemarks,etc.inthispublication doesnotimply,evenintheabsenceofaspecificstatement,thatsuchnamesareexemptfromtherelevant protectivelawsandregulationsandthereforefreeforgeneraluse. The publisher, the authors, and the editorsare safeto assume that the adviceand informationin this bookarebelievedtobetrueandaccurateatthedateofpublication.Neitherthepublishernortheauthorsor theeditorsgiveawarranty,expressedorimplied,withrespecttothematerialcontainedhereinorforany errorsoromissionsthatmayhavebeenmade.Thepublisherremainsneutralwithregardtojurisdictional claimsinpublishedmapsandinstitutionalaffiliations. ThisSpringerimprintispublishedbytheregisteredcompanySpringerNatureSwitzerlandAG Theregisteredcompanyaddressis:Gewerbestrasse11,6330Cham,Switzerland To my dearest family For their love and support Preface Writing a full-scale circuit simulator is a very intriguing and satisfying task, espe- ciallyforstudents.Intheprocessofwritingacircuitsimulator,studentswillbetter understandandlearnthecircuittheoryandanalysis.Thesearethemotivationsthat promptmetowritethisbook.Acircuitsimulatorhastwomainparts.Thefirstpartis the generation of a graphical user interface for drawing circuits and interconnects. This is called the schematic editor. The second part is translating the circuit into codesthatcanbemathematicallycomputed.Thisiscalledthecircuitanalyzer.Both the graphical user interface and the computational engine are integrated into a compiler called the circuit simulator. The compiler is written using a computer programming language like C and includes an extensive library of different func- tionsthatuserscanexecute,suchasmovingacircuitcomponenttoanewlocation androtatingitorcreatingnetlistfromthecircuitandperformingaspecificsimulation followedbycalculatingsomecharacteristics,suchasthetime-domainaverageofa signalorthefrequency-domaingroupdelayofavoltage-gaintransferfunction. Writing a compiler using a programming language is not in the scope of this book.Instead,aversatilecompilersuchasMATLABisusedinthisbookinorderto showthegeneration ofacircuitgraphicaluser interface, translatingthecircuit into codes thatcanbecomputationallycalculated aswellascreating alibraryofcircuit analysis functions. The generation of the graphical user interface and translating circuitsintonetlistsaredemonstratedattheendofChap.1aftercircuitcomponents and their characteristics are studied. Although the generation of a graphical user interfaceisveryfunandhelpfulforcreatingacircuitsimulator,itisnotessentialin learning circuit theories and analyses. As a result, this first part of the circuit simulatorisonlystudiedinChap.1.Themainemphasizeintheremainingchapters is to show how to create computational codes required by the second part of the circuitsimulatorinordertoanalyzecircuitsandextracttheircharacteristics. The universal adaptability of computational codes is considered throughout his book.Asanexample,insteadofaskingstudentstohandcalculatethevoltage-gain transfer functions of different filters before plotting them using MATLAB, the voltage-gain transfer functions for circuits with different number of nodes and vii viii Preface configurationsareautomaticallycalculatedusingCramer’srulesandLaplaceexpan- sionsappliedtoadmittancematrices.Asaresult,thecodesandthemethodsadopted in this book can be used in a universal circuit simulator rather than a specific-task simulation. Utilizing custom simulation functions such as calculating fast Fourier transform andnumerical analysis ofsystems ofequationsarealsoused throughout this book instead of relying on pre-existing MATLAB functions, such as FFT or solvecommands.Mostofthecomputationalbooksinengineeringtopicsuseexten- siveamountsofmaththatcaneasilyforceareadertolosethecomprehensionandthe interestinthetopic.Whileanextensiveamountofsimulationmethodsiscoveredin thisbook,theamountofmathiskeptataminimumlevel. Circuitanalysiscan bedone using nodalcurrents, mesh voltages, or both. Each methodifappliedproperlycananalyzeanykindofcircuits.Thenodalanalysisbased on Kirchhoff’s current law is used throughout this book to analyze circuits. The signalnotationsusedinthisbookincludepresentingtheinstantaneousvoltageand currentsignalsby“V ”and“I ”(capitalletterfollowedbycapitalsubscript),the TR TR DC components of the signals by “v ” and “i ” (lowercase letter followed by DC DC capital subscript), and presenting the AC components of the signals by “vac” and “iac”(lowercaseitalicletterfollowedbylowercasesubscript).IntheabsenceofAC signalsinDCanalysis,theDCandinstantaneoussignalsbecomeequalandtheDC voltages and currents might optionally be shown with the instantaneous signal notation. Circuit analysis is done using two distinct numerical and symbolic approaches. Both methods are covered in this book. The numerical approach generates a component-obscure result after each simulation but is very computer-memory effi- cient because when multiple numbers are added, subtracted, multiplied, or divided together, the result will be just a number. The symbolic approach generates a component-visibleresultthatshowshowthecircuitcharacteristicchangesbyvary- ing each component but is very computer-memory inefficient because as different symbolicvariablesareadded,subtracted,multiplied,ordividedtogether,themath- ematicalexpressionsexpandinsize.Forsmallcircuitsorsimplebuildingblocksthat arestudiedinelectroniccourses,thesymbolicanalysisisadvantageousinteaching students how the circuits work. For large circuits, full symbolic analysis becomes impracticalandthenumericalanalysisbecomestheonlypracticalchoiceincreating circuitsimulators. Themodelingandcharacteristicsofcircuitcomponentsandcreatingcircuitsand netlists are studied in Chap. 1. The DC analysis of linear and nonlinear circuits is studied in Chap. 2. The calculation of inverse matrix, Laplace expansion, LU decomposition, Gaussian elimination, and iterative methods such as conjugate gradient, Gauss-Seidel, and Newton-Raphson are demonstrated in this chapter. The transient analysis of linear and nonlinear circuits is studied in Chap. 3. The calculation offinite difference and finite integrals, Laplace transforms, partial frac- tiondecomposition,andfastFouriertransformaredemonstratedinthischapter.The AC analysis of linearized circuits is studied in Chap. 4. The Cramer’s rules and Laplace expansion, Taylorseriesexpansion,nodeelimination,extractionofadmit- tancematrixandtransferfunctions,powergains,Y-,Z-,andS-parametersandtheir Preface ix conversions, poles and zeros, impulse and step responses, Bode, Nyquist and Nichols plots, root locus and Smith charts are demonstrated in this chapter. The noiseanalysisoflinearizedcircuitsisstudiedinChap.5.Thetransientandspectral noisecharacteristics,noisematrices,noisetransformation,inputandoutputreferred noise calculations, noise factors, and noise and power tradeoff are demonstrated in thischapter.Finally,thebehavioralanalysisofcircuitswherespecific-taskmodeling andalgorithmsareappliedtodifferentcircuitsinordertostudytheirfunctionalityis studiedinChap.6.Anoverviewofchaptertopicsislistedinthefollowingtable. Signals Schematic Composing Ch. 1 Framework Components DC, Transient, AC and Noise modeling Netlisting DC Linear Equations Direct Methods Ch. 2 DC Circuit Model Analysis Nonlinear Equations Iterative Methods Transient Linear Circuits Aperiodic and Periodic Signals Laplace Transform Ch. 3 Analysis Nonlinear Circuits Switching Circuits Differential Equations AC Ch. 4 Linearized s-domain Model Matrix Calculations Transfer Function Characteristics Analysis Noise Ch. 5 Linearized s-domain Model Noise Matrix Calculations Noise Transformation Analysis Behavioral Ch. 6 Block-Level Modeling Accuracy and Speed Tradeoff Analysis Incontrarytothecurrentcomputationalmethodsforsomeengineeringfieldssuch as electromagnetics and antenna where different methods and approaches are required for simulating different open boundary or closed boundary systems, the circuitanalysisisverywellstructuredanddeveloped.Forexample,asingletransient analysiscansolve anytype oflinearornonlinear circuitswith anytype ofcompo- nents with any number of nodes and meshes with any number and types of signal sources. A simulation algorithm works for all types of circuits. All fundamental knowledge and skills required for students in order to develop their own circuit simulator are included in this book with the hope to make circuit and electronic coursesveryenjoyableandmemorableforall. SanJose,CA,USA SotoudehHamedi-Hagh Contents 1 Framework. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 1.1 NumericandSymbolicAnalyses. . . . . . . . . . . . . . . . . . . . . . . . 2 1.2 FiniteIntegral. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 1.3 FiniteDifference. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 1.4 LaplaceTransformation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 1.4.1 BasicSignals. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 1.4.2 MultiplicationandConvolution. . . . . . . . . . . . . . . . . . . 8 1.4.3 Scaling. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 1.4.4 Shifting. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 1.4.5 Differentiation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 1.4.6 Integration. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 1.4.7 MultiplicationbyTime. . . . . . . . . . . . . . . . . . . . . . . . . 10 1.4.8 ConjugateProperty. . . . . . . . . . . . . . . . . . . . . . . . . . . 10 1.4.9 InitialandFinalValues. . . . . . . . . . . . . . . . . . . . . . . . 10 1.4.10 Periodicity. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 1.5 Waveforms. . . . . . . . .. . . . . . . . . .. . . . . . . . .. . . . . . . . . .. . 11 1.6 Components. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 1.6.1 Ground. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 1.6.2 Short. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 1.6.3 Open. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 1.6.4 IdealSwitch. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 1.6.5 Resistors. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 1.6.6 Capacitors. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 1.6.7 NonidealSwitch. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 1.6.8 Inductors. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 1.6.9 Transformers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 1.6.10 NonidealSources. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 1.6.11 DependentSources. . . . . . . . .. . . . . . . . .. . . . . . . . .. 30 1.6.12 Diodes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 xi xii Contents 1.6.13 BipolarJunctionTransistors. . . . . . . . . . . . . . . . . . . . . 37 1.6.14 MetalOxideSemiconductorFieldEffectTransistors. . . 44 1.7 LTI/LTV/NTI/NTV. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53 1.8 SchematicEditor. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54 1.8.1 Netlisting. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55 1.9 Conclusions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60 Questions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60 Q.1.1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60 Q.1.2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62 Q.1.3. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62 Q.1.4. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63 Q.1.5. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64 Q.1.6. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64 Q.1.7. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65 Q.1.8. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66 Q.1.9. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67 Q.1.10. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68 2 DCAnalysis. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71 2.1 AnalysisAlgorithms. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72 2.2 InverseMatrixCalculation. . . . . . . . . . . . . . . . . . . . . . . . . . . . 75 2.3 DeterminantRatiosObtainedbyLaplaceExpansion. . . . . . . . . . 81 2.4 DeterminantRatiosObtainedbyLUDecomposition. . . . . . . . . . 86 2.5 GaussianElimination. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91 2.6 ConjugateGradientIterations. . . . . . . . . . . . . . . . . . . . . . . . . . 96 2.7 Gauss-SeidelIterativeMethod. . . . . . . . . . . . . . . . . . . . . . . . . . 102 2.8 Newton-Raphson. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105 2.9 Conclusions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109 Questions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109 Q.2.1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109 Q.2.2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111 Q.2.3. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112 Q.2.4. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113 Q.2.5. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114 Q.2.6. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115 Q.2.7. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116 Q.2.8. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118 3 TransientAnalysis. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119 3.1 PartialFractionDecomposition. . . . . . . . . . . . . . . . . . . . . . . . . 121 3.2 AperiodicCapacitiveCircuits. . . . . . . . . . . . . . . . . . . . . . . . . . 122 3.3 AperiodicInductiveCircuits. . . . . . . . . . . . . . . . . . . . . . . . . . . 126 3.4 PeriodicTransformation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130 3.5 PeriodicCapacitiveCircuits. . . . . . . . . . . . . . . . .. . . . . . . . . . . 131 3.5.1 Circuit1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131

See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.