Feedback and Control Systems: MATLAB Fundamentals, Laplace Transforms, and Transfer Functions

MATLAB Environment and Interface Fundamentals

  • Overview of MATLAB:

    • MATLAB (Matrix Laboratory) is a high-level programming language and interactive environment tailored for numerical computation, data analysis, visualization, algorithm development, and application development.

    • It allows engineers and scientists to explore multiple computational approaches and solve mathematical problems significantly faster than using traditional spreadsheets or low-level programming languages such as C, C++, or Java.

  • Core Applications:

    • Signal processing and communications

    • Image and video processing

    • Control systems engineering (calculating transfer functions, determining root locus, and analyzing time response)

    • Test and measurement systems

    • Computational finance

    • Computational biology

  • Key Features:

    • High-level language for numerical computation and application development.

    • Interactive environment for iterative design, data exploration, and problem-solving.

    • Built-in mathematical functions covering linear algebra, statistics, Fourier analysis, filtering, optimization, numerical integration, and ordinary differential equations (ODEs).

    • Graphics tools for standard data visualization and custom plotting.

    • Development tools for code quality, debugging, performance optimization, and maintainability.

    • Graphical user interface (GUI) building tools.

    • Functions for integrating MATLAB algorithms with external applications written in C, Java, .NET, and Microsoft Excel.

  • Simulink Companion Tool:

    • Simulink is a block-diagram environment integrated with MATLAB designed for multidomain simulation and model-based design.

    • In control systems, Simulink is utilized for simulating dynamical systems and graphing complex output responses.

  • User Interface Layout (Five Core Areas):     

    MATLAB Interface Layout
    • 1. Command Window: The primary text interface where commands are entered at the prompt marker >>. It acts similarly to the Windows Command Prompt (cmd) or Linux terminal. Commands like why or help why can be issued directly here.

    • 2. Command History: Logs all commands entered into the Command Window during previous and current sessions, allowing users to track and reuse past code.

    • 3. Current Folder: Works as an embedded file explorer to navigate working directories and manage files.

    • 4. Workspace: Displays all variables currently created or loaded into memory, showing variable names, current values, sizes, and data types/classes.

    • 5. Toolstrip: The top toolbar organized into tabs, similar to Microsoft Office ribbons:

      • Home Tab: Contains controls for file handling, variable management, workspace operations, layout customization, and environment preferences.

      • Plots Tab: Facilitates one-click plotting of variables selected in the Workspace.

      • Apps Tab: Houses specialized toolboxes for specific engineering disciplines (e.g., Image Processing, Digital Signal Processing).

    • Layout Modification: The interface configuration can be modified under the HOME tab by selecting Environment →\rightarrow Layout.

MATLAB Basics and Matrix Operations

  • Variable Assignments:

    • Assigning a scalar value: entering a = 1 creates a variable storing a floating-point number (default type double).

    • Default variable ans: if a command returns a result without an explicit destination variable, MATLAB stores the result in ans (short for answer).

    • Suppressing output: placing a semicolon ; at the end of a command executes the statement but suppresses output display in the Command Window (e.g., e = a*b;).

  • Array and Matrix Creation:

    • MATLAB operates natively on whole matrices and arrays. All variables are treated as multidimensional arrays.

    • Row Vector Creation: Separate elements with spaces or commas:         a=(1234)\mathbf{a} = \begin{pmatrix} 1 & 2 & 3 & 4 \end{pmatrix}         Command syntax: a = [1 2 3 4] or a = [1, 2, 3, 4].

    • Matrix Creation: Separate rows with semicolons:         a=(1234567810)\mathbf{a} = \begin{pmatrix} 1 & 2 & 3 \\ 4 & 5 & 6 \\ 7 & 8 & 10 \end{pmatrix}         Command syntax: a = [1 2 3; 4 5 6; 7 8 10].

    • Built-in Matrix Generators:

      • zeros(m, n) creates an m×nm \times n matrix of zeros (e.g., z = zeros(5,1) creates a 5×15 \times 1 column vector of zeros).

      • ones(m, n) creates an m×nm \times n matrix of ones.

      • rand(m, n) creates an m×nm \times n matrix of uniformly distributed random numbers.

  • Matrix and Element-Wise Arithmetic Operations:

    • Scalar Addition: a + 10 adds 1010 to every element in matrix a.

    • Function Application: sin(a) computes the sine of each individual element in radians.

    • Matrix Transpose: The single quote ' transposes a matrix (e.g., a').

    • Standard Matrix Multiplication: The * operator performs linear algebra matrix multiplication:         p=a×a−1\mathbf{p} = \mathbf{a} \times \mathbf{a}^{-1}         Command syntax: p = a*inv(a).

    • Display Formats: MATLAB stores numbers as double-precision floating-point values:

      • format short: displays 4 decimal places (default).

      • format long: displays 15 decimal places.

      • Note: The format command alters display output only and does not impact internal precision or mathematical calculations.

    • Element-Wise Operations: Preceding an operator with a dot . forces element-by-element evaluation rather than linear algebra operations:

      • .* Element-wise multiplication (e.g., p = a.*a).

      • ./ Element-wise division.

      • .^ Element-wise exponentiation (e.g., a.^3 raises each element of a to the third power).

  • Array Concatenation:

    • Square brackets [] act as the concatenation operator.

    • Horizontal Concatenation: Joins matrices side-by-side using commas or spaces (requires matching row counts):         A = [a, a]

    • Vertical Concatenation: Stacks matrices vertically using semicolons (requires matching column counts):         A = [a; a]

  • Array Indexing:

    • Two-Subscript Indexing: Reference elements using A(row, column). For example, A(4,2) accesses the element at row 4, column 2.

    • Linear Indexing: Uses a single subscript A(k) traversing down columns sequentially. For a 4×44 \times 4 matrix, element A(8) corresponds to row 4, column 2.

    • Index Out of Bounds: Referencing an out-of-bounds element on the right side of an assignment generates an error. Referencing outside bounds on the left side (e.g., A(4,5) = 17) dynamically expands the array size, padding unassigned elements with zeros.

    • Colon Operator : Usage:

      • Sub-range selection: A(1:3, 2) selects rows 1 through 3 in column 2.

      • Full dimension selection: A(3, :) selects all columns in row 3.

      • Equally spaced vector generation: start:step:end (e.g., B = 0:10:100 yields values from 00 to 100100 incremented by 1010). Omitting step defaults to an increment of 11 (start:end).

  • Character Strings:

    • Strings are sequences of characters enclosed in single quotes (e.g., myText = 'Hello, world').

    • Including a single quote within a string requires typing two consecutive single quotes: otherText = 'You''re right' yields You're right.

    • Data type/class is char. String variables are stored as character arrays.

    • Concatenating strings: longText = [myText, ' - ', otherText].

    • Conversion functions: num2str(x) converts numerical values to character strings; int2str(x) converts integers.

  • Help Systems:

    • doc <function>: Opens detailed documentation in a standalone help window.

    • help <function>: Displays text documentation inside the Command Window (e.g., help mean, help sin, help max, help rand).

  • 2D Plotting:

    • plot(x, y): Generates a basic line plot.

    • Adding labels and titles:

      • xlabel('x') adds horizontal axis label.

      • ylabel('sin(x)') adds vertical axis label.

      • title('Plot of the Sine Function') adds plot title.         

        Plot of Sine Function
    • Line formatting specs: plot(x, y, 'r--') plots a red dashed line; 'g:*' plots a green dotted line with asterisk markers.

    • Overlaying plots: calling plot clears existing figure windows by default. To overlay graphs, use hold on. To release the overlay mode, use hold off. matlab x = 0:pi/100:2*pi; y = sin(x); plot(x,y) hold on y2 = cos(x); plot(x,y2,'r:') legend('sin','cos') &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;         

      Sine and Cosine Plot
  • Polynomial Handling:

    • Polynomials are represented as row vectors containing coefficients ordered by descending powers.

      • Example: p(x)=x3−2x−5p(x) = x^3 - 2x - 5 is represented as p = [1 0 -2 -5].

    • polyval(p, x): Evaluates polynomial p at scalar value x (e.g., polyval(p, 5) returns 110110).

    • polyvalm(p, X): Evaluates polynomial p in a matrix sense (p(X)=X3−2X−5Ip(\mathbf{X}) = \mathbf{X}^3 - 2\mathbf{X} - 5\mathbf{I}) for a square matrix X.

    • roots(p): Calculates the roots of polynomial p and returns them in a column vector.

    • poly(r): Constructs polynomial coefficients given a vector of roots r.

    • conv(p1, p2): Performs polynomial multiplication (algebraic convolution) (e.g., p3 = conv([1 2 3], [2 0 5])).

MATLAB Programming: Control Flow, M-Files, and Functions

  • M-Files:

    • Text files containing MATLAB commands saved with a .m file extension.

    • Key utility commands used inside m-files:

      • clc: Clears the Command Window display.

      • clear: Erases all variables from the Workspace memory.

      • disp('string'): Prints text or variable contents to the Command Window.

  • Control Flow Statements:

    • Conditional Statements:

      • if, elseif, else, end structure: matlab a = randi(100, 1); if a < 30 disp('small') elseif a < 80 disp('medium') else disp('large') end &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

      • switch, case, otherwise, end structure: used for discrete equality checks. matlab [dayNum, dayString] = weekday(date, 'long', 'en_US'); switch dayString case 'Monday' disp('Start of the work week') case 'Friday' disp('Last day of the work week') otherwise disp('Weekend!') end &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

    • Loop Statements:

      • for loops: Execute a code block a specified number of times with an incrementing index variable. matlab x = ones(1,10); for n = 2:6 x(n) = 2 * x(n - 1); end &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

      • while loops: Repeat execution as long as a evaluated conditional statement remains true. matlab n = 1; nFactorial = 1; while nFactorial < 1e100 n = n + 1; nFactorial = nFactorial * n; end &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

    • Loop Termination Control:

      • break: Terminates loop execution prematurely.

      • continue: Skips the remainder of the current loop iteration and advances to the next iteration.

      • Ctrl+C: Halts infinite execution loops manually.

  • Relational Operators:

    • Relational operators compare arrays element-by-element and return logical arrays containing ones (true) and zeros (false).

    • <: Less than

    • <=: Less than or equal to

    • >: Greater than

    • >=: Greater than or equal to

    • ==: Equal to

    • ~=: Not equal to

  • Scripts vs. Functions:

    • Scripts: Sequential files that execute commands directly within the base Workspace. They take no input arguments and return no output arguments.

    • Functions: Programs that accept inputs and return outputs. Declared using the function keyword and stored in a file matching the function name (function_name.m). Functions operate inside their own isolated workspace.

      • Function declaration syntax: function a = triarea(b,h)matlab function a = triarea(b,h) a = 0.5*(b.* h); &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

  • Laboratory Exercises and Activities:

    • Activity 1a Requirements:

      • 1.a. Add matrices A=(2110−34)\mathbf{A} = \begin{pmatrix} 2 & 1 & 1 \\ 0 & -3 & 4 \end{pmatrix} and B=(3−13205)\mathbf{B} = \begin{pmatrix} 3 & -1 & 3 \\ 2 & 0 & 5 \end{pmatrix}.

      • 1.b. Compute 3A−2B3\mathbf{A} - 2\mathbf{B} for A=(1230)\mathbf{A} = \begin{pmatrix} 1 & 2 \\ 3 & 0 \end{pmatrix} and B=(130−4)\mathbf{B} = \begin{pmatrix} 1 & 3 \\ 0 & -4 \end{pmatrix}.

      • 1.c. Compute 5A−2B5\mathbf{A} - 2\mathbf{B} using matrices from item 1.a.

      • 2. Compute C(A+B)\mathbf{C}(\mathbf{A} + \mathbf{B}) where A=(1230)\mathbf{A} = \begin{pmatrix} 1 & 2 \\ 3 & 0 \end{pmatrix}, B=(2−134)\mathbf{B} = \begin{pmatrix} 2 & -1 \\ 3 & 4 \end{pmatrix}, and C=(2−2134−1)\mathbf{C} = \begin{pmatrix} 2 & -2 \\ 1 & 3 \\ 4 & -1 \end{pmatrix}.

      • 3. Compute CA+CB\mathbf{C}\mathbf{A} + \mathbf{C}\mathbf{B} using matrices from item 2.

      • 4. Plot y=x2+5x+3y = x^2 + 5x + 3 (red solid line) and y=x3+4y = x^3 + 4 (blue dashed line) on a single plot.

      • 5. Plot the signals from item 4 on separate subplots using subplot.

      • 6. Find the roots of polynomials:

        • a. s7+32s6+8s5+85s4+4s3+s2+3s+1=0s^7 + 32s^6 + 8s^5 + 85s^4 + 4s^3 + s^2 + 3s + 1 = 0

        • b. 3s5−s4+24s3+9s2+6s+2=03s^5 - s^4 + 24s^3 + 9s^2 + 6s + 2 = 0

        • c. s3+77s2+11s+1=0s^3 + 77s^2 + 11s + 1 = 0

      • 7. Compute polynomial convolutions of item 6.a with 6.b, and 6.a with 6.c.

    • Activity 1b Requirements:

      • Fibonacci Generator: Function newFibonacci.m accepting two boundary integers and outputting all Fibonacci numbers within that closed interval.

      • Palindrome Checker: Function verifying whether a string input reads identically forward and backward (e.g., racecar, anna).

Laplace Transform Theory and Principles

  • Role in Control Systems:

    • Developing mathematical models is a primary phase of control system design.

    • Dynamic systems are governed by linear time-invariant (LTI) differential equations that map input signals r(t)r(t) to output signals c(t)c(t).

    • Solving high-order differential equations directly in the time domain is mathematically cumbersome.

    • The Laplace transform simplifies dynamic system analysis by converting calculus operations (differentiation and integration) into simple algebraic operations in the complex frequency domain (ss--domain).

  • Definition of the Laplace Transform:

    • The unilateral Laplace transform of a time-domain signal f(t)f(t) is defined by the integral:         L[f(t)]=F(s)=∫0−∞f(t)e−st dt\mathcal{L}[f(t)] = F(s) = \int_{0^-}^{\infty} f(t) e^{-st}\,dt         where s=σ+jωs = \sigma + j\omega is a complex frequency variable.

    • Initial Condition Evaluation: The lower limit 0−0^- allows system analysis to incorporate initial conditions present immediately prior to initial input disturbances or discontinuities at t=0t = 0

  • Fundamental Laplace Transform Derivations:

    • Ramp Function f(t)=t u(t)f(t) = t\,u(t):         Using integration by parts (where u=tu = t, du=dtdu = dt, dv=e−stdtdv = e^{-st}dt, v=−1se−stv = -\frac{1}{s}e^{-st}):         F(s)=∫0∞te−st dt=[−1ste−st]0∞+1s∫0∞e−st dt=0+[−1s2e−st]0∞=1s2F(s) = \int_{0}^{\infty} t e^{-st}\,dt = \left[ -\frac{1}{s} t e^{-st} \right]_{0}^{\infty} + \frac{1}{s} \int_{0}^{\infty} e^{-st}\,dt = 0 + \left[ -\frac{1}{s^2} e^{-st} \right]_{0}^{\infty} = \frac{1}{s^2}

    • Exponential Function f(t)=e−atu(t)f(t) = e^{-at}u(t):         F(s)=∫0∞e−ate−st dt=∫0∞e−(s+a)t dt=[−1s+ae−(s+a)t]0∞=−1s+a[0−1]=1s+aF(s) = \int_{0}^{\infty} e^{-at} e^{-st}\,dt = \int_{0}^{\infty} e^{-(s+a)t}\,dt = \left[ -\frac{1}{s+a} e^{-(s+a)t} \right]_{0}^{\infty} = -\frac{1}{s+a}[0 - 1] = \frac{1}{s+a}

    • Cosine Function f(t)=cos⁡(ωt)u(t)f(t) = \cos(\omega t)u(t):         Applying Euler's formula cos⁡(ωt)=ejωt+e−jωt2\cos(\omega t) = \frac{e^{j\omega t} + e^{-j\omega t}}{2}:         F(s)=∫0∞(ejωt+e−jωt2)e−st dt=12∫0∞e−(s−jω)t dt+12∫0∞e−(s+jω)t dtF(s) = \int_{0}^{\infty} \left( \frac{e^{j\omega t} + e^{-j\omega t}}{2} \right) e^{-st}\,dt = \frac{1}{2} \int_{0}^{\infty} e^{-(s-j\omega)t}\,dt + \frac{1}{2} \int_{0}^{\infty} e^{-(s+j\omega)t}\,dt         F(s)=12(s−jω)+12(s+jω)=(s+jω)+(s−jω)2(s−jω)(s+jω)=2s2(s2+ω2)=ss2+ω2F(s) = \frac{1}{2(s - j\omega)} + \frac{1}{2(s + j\omega)} = \frac{(s + j\omega) + (s - j\omega)}{2(s - j\omega)(s + j\omega)} = \frac{2s}{2(s^2 + \omega^2)} = \frac{s}{s^2 + \omega^2}

  • Standard Laplace Transform Pairs:     

    Laplace Transform Table
    • 1. Impulse Function: δ(t)⟷1\delta(t) \longleftrightarrow 1

    • 2. Unit Step Function: u(t)⟷1su(t) \longleftrightarrow \frac{1}{s}

    • 3. Ramp Function: t u(t)⟷1s2t\,u(t) \longleftrightarrow \frac{1}{s^2}

    • 4. Polynomial Function: tnu(t)⟷n!sn+1t^n u(t) \longleftrightarrow \frac{n!}{s^{n+1}}

    • 5. Exponential Decay: e−atu(t)⟷1s+ae^{-at} u(t) \longleftrightarrow \frac{1}{s+a}

    • 6. Sine Wave: sin⁡(ωt)u(t)⟷ωs2+ω2\sin(\omega t) u(t) \longleftrightarrow \frac{\omega}{s^2 + \omega^2}

    • 7. Cosine Wave: cos⁡(ωt)u(t)⟷ss2+ω2\cos(\omega t) u(t) \longleftrightarrow \frac{s}{s^2 + \omega^2}

Laplace Transform Theorems & Properties

  • Summary of Key Laplace Theorems:     

    Laplace Transform Theorems Table
    • Definition Theorem:         L[f(t)]=F(s)=∫0−∞f(t)e−st dt\mathcal{L}[f(t)] = F(s) = \int_{0^-}^{\infty} f(t) e^{-st}\,dt

    • Linearity Theorems:         L[k f(t)]=k F(s)\mathcal{L}[k\,f(t)] = k\,F(s)         L[f1(t)+f2(t)]=F1(s)+F2(s)\mathcal{L}[f_1(t) + f_2(t)] = F_1(s) + F_2(s)

    • Frequency Shift Theorem:         L[e−atf(t)]=F(s+a)\mathcal{L}[e^{-at}f(t)] = F(s+a)

    • Time Shift Theorem:         L[f(t−T)]=e−sTF(s)\mathcal{L}[f(t-T)] = e^{-sT} F(s)

    • Scaling Theorem:         L[f(at)]=1aF(sa)\mathcal{L}[f(at)] = \frac{1}{a} F\left(\frac{s}{a}\right)

    • First Differentiation Theorem:         L[dfdt]=s F(s)−f(0−)\mathcal{L}\left[\frac{df}{dt}\right] = s\,F(s) - f(0^-)

    • Second Differentiation Theorem:         L[d2fdt2]=s2F(s)−s f(0−)−f′(0−)\mathcal{L}\left[\frac{d^2f}{dt^2}\right] = s^2 F(s) - s\,f(0^-) - f'(0^-)

    • nn-th Differentiation Theorem:         L[dnfdtn]=snF(s)−∑k=1nsn−kf(k−1)(0−)\mathcal{L}\left[\frac{d^n f}{dt^n}\right] = s^n F(s) - \sum_{k=1}^{n} s^{n-k} f^{(k-1)}(0^-)

    • Integration Theorem:         L[∫0−tf(τ) dτ]=F(s)s\mathcal{L}\left[ \int_{0^-}^{t} f(\tau)\,d\tau \right] = \frac{F(s)}{s}

    • Final Value Theorem:         f(∞)=lim⁡s→0s F(s)f(\infty) = \lim_{s \to 0} s\,F(s)

    • Initial Value Theorem:         f(0+)=lim⁡s→∞s F(s)f(0^+) = \lim_{s \to \infty} s\,F(s)

  • Applications of Theorems (Review Derivations):

    • Damped Sine Wave: Deriving L[e−atsin⁡(ωt)u(t)]\mathcal{L}[e^{-at}\sin(\omega t)u(t)]         Applying Frequency Shift Theorem to Pair 6 (ωs2+ω2\frac{\omega}{s^2 + \omega^2}):         L[e−atsin⁡(ωt)u(t)]=ω(s+a)2+ω2\mathcal{L}[e^{-at}\sin(\omega t)u(t)] = \frac{\omega}{(s+a)^2 + \omega^2}

    • Damped Cosine Wave: Deriving L[e−atcos⁡(ωt)u(t)]\mathcal{L}[e^{-at}\cos(\omega t)u(t)]         Applying Frequency Shift Theorem to Pair 7 (ss2+ω2\frac{s}{s^2 + \omega^2}):         L[e−atcos⁡(ωt)u(t)]=s+a(s+a)2+ω2\mathcal{L}[e^{-at}\cos(\omega t)u(t)] = \frac{s+a}{(s+a)^2 + \omega^2}

    • Cubic Power: Deriving L[t3u(t)]\mathcal{L}[t^3 u(t)]         Applying Pair 4 for n=3n = 3:         L[t3u(t)]=3!s3+1=6s4\mathcal{L}[t^3 u(t)] = \frac{3!}{s^{3+1}} = \frac{6}{s^4}

Inverse Laplace Transform and Partial Fraction Expansion

  • Definition of the Inverse Laplace Transform:

    • The complex inversion integral reconstructs the time-domain signal f(t)f(t) from F(s)F(s):         L−1[F(s)]=12πj∫σ−j∞σ+j∞F(s)est ds=f(t)u(t)\mathcal{L}^{-1}[F(s)] = \frac{1}{2\pi j} \int_{\sigma - j\infty}^{\sigma + j\infty} F(s) e^{st}\,ds = f(t) u(t)

    • Because direct evaluation of this complex surface integral is difficult, Partial Fraction Expansion (PFE) combined with transform tables is used instead.

  • Partial Fraction Expansion (PFE) Principles:

    • For a rational function F(s)=N(s)D(s)F(s) = \frac{N(s)}{D(s)}, the order of the numerator N(s)N(s) must be strictly less than the order of the denominator D(s)D(s).

    • If the degree of N(s)≥N(s) \ge degree of D(s)D(s), polynomial long division must be performed first until the fraction displays a remainder numerator of lower degree than its denominator:         F(s)=s3+2s2+6s+7s2+s+5=s+1+s+2s2+s+5F(s) = \frac{s^3 + 2s^2 + 6s + 7}{s^2 + s + 5} = s + 1 + \frac{s + 2}{s^2 + s + 5}         f(t)=dδ(t)dt+δ(t)+L−1[s+2s2+s+5]f(t) = \frac{d\delta(t)}{dt} + \delta(t) + \mathcal{L}^{-1}\left[ \frac{s + 2}{s^2 + s + 5} \right]

  • PFE Case 1: Real and Distinct Roots:

    • Given F(s)=2(s+1)(s+2)F(s) = \frac{2}{(s+1)(s+2)}, expand into distinct linear fractions:         F(s)=K1s+1+K2s+2F(s) = \frac{K_1}{s+1} + \frac{K_2}{s+2}

    • Calculate residue K1K_1 by multiplying by (s+1)(s+1) and setting s→−1s \to -1:         K1=(s+1)F(s)∣s→−1=2s+2∣s→−1=2−1+2=2K_1 = \left. (s+1) F(s) \right|_{s \to -1} = \left. \frac{2}{s+2} \right|_{s \to -1} = \frac{2}{-1+2} = 2

    • Calculate residue K2K_2 by multiplying by (s+2)(s+2) and setting s→−2s \to -2:         K2=(s+2)F(s)∣s→−2=2s+1∣s→−2=2−2+1=−2K_2 = \left. (s+2) F(s) \right|_{s \to -2} = \left. \frac{2}{s+1} \right|_{s \to -2} = \frac{2}{-2+1} = -2

    • Inverse transform result:         f(t)=L−1[2s+1−2s+2]=(2e−t−2e−2t)u(t)f(t) = \mathcal{L}^{-1}\left[ \frac{2}{s+1} - \frac{2}{s+2} \right] = (2e^{-t} - 2e^{-2t})u(t)

  • PFE Case 2: Real and Repeated Roots:

    • Given F(s)=2(s+1)(s+2)2F(s) = \frac{2}{(s+1)(s+2)^2}, expand accounting for root multiplicity:         F(s)=K1s+1+K2(s+2)2+K3s+2F(s) = \frac{K_1}{s+1} + \frac{K_2}{(s+2)^2} + \frac{K_3}{s+2}

    • Calculate distinct residue K1K_1:         K1=(s+1)F(s)∣s→−1=2(s+2)2∣s→−1=2K_1 = \left. (s+1) F(s) \right|_{s \to -1} = \left. \frac{2}{(s+2)^2} \right|_{s \to -1} = 2

    • Calculate highest-power repeated residue K2K_2:         K2=(s+2)2F(s)∣s→−2=2s+1∣s→−2=−2K_2 = \left. (s+2)^2 F(s) \right|_{s \to -2} = \left. \frac{2}{s+1} \right|_{s \to -2} = -2

    • Calculate lower-power repeated residue K3K_3 using differentiation:         K3=dds[(s+2)2F(s)]∣s→−2=dds(2s+1)∣s→−2=−2(s+1)2∣s→−2=−2K_3 = \left. \frac{d}{ds} \left[ (s+2)^2 F(s) \right] \right|_{s \to -2} = \left. \frac{d}{ds} \left( \frac{2}{s+1} \right) \right|_{s \to -2} = \left. \frac{-2}{(s+1)^2} \right|_{s \to -2} = -2

    • Inverse transform result:         f(t)=(2e−t−2te−2t−2e−2t)u(t)f(t) = (2e^{-t} - 2t e^{-2t} - 2e^{-2t})u(t)

  • PFE Case 3: Complex Conjugate Roots:

    • Given F(s)=3s(s2+2s+5)F(s) = \frac{3}{s(s^2 + 2s + 5)}, write quadratic factor directly:         F(s)=K1s+K2s+K3s2+2s+5F(s) = \frac{K_1}{s} + \frac{K_2 s + K_3}{s^2 + 2s + 5}

    • Solve for K1K_1:         K1=sF(s)∣s→0=3s2+2s+5∣s→0=35K_1 = \left. s F(s) \right|_{s \to 0} = \left. \frac{3}{s^2 + 2s + 5} \right|_{s \to 0} = \frac{3}{5}

    • Equate numerator coefficients (3=K1(s2+2s+5)+(K2s+K3)s3 = K_1(s^2 + 2s + 5) + (K_2 s + K_3)s):         3=(K1+K2)s2+(2K1+K3)s+5K13 = (K_1 + K_2)s^2 + (2K_1 + K_3)s + 5K_1

      • s2 term:K1+K2=0  ⟹  K2=−K1=−35s^2 \text{ term:} \quad K_1 + K_2 = 0 \implies K_2 = -K_1 = -\frac{3}{5}

      • s1 term:2K1+K3=0  ⟹  K3=−2K1=−65s^1 \text{ term:} \quad 2K_1 + K_3 = 0 \implies K_3 = -2K_1 = -\frac{6}{5}

    • Resulting expansion:         F(s)=3/5s−35s+65s2+2s+5=35(1s)−35[s+2(s+1)2+22]F(s) = \frac{3/5}{s} - \frac{\frac{3}{5}s + \frac{6}{5}}{s^2 + 2s + 5} = \frac{3}{5}\left(\frac{1}{s}\right) - \frac{3}{5}\left[ \frac{s + 2}{(s+1)^2 + 2^2} \right]

  • Solving Differential Equations using Laplace Transforms:

    • Problem Statement: Solve for y(t)y(t) given d2y(t)dt2+12dy(t)dt+32y(t)=32u(t)\frac{d^2 y(t)}{dt^2} + 12\frac{dy(t)}{dt} + 32y(t) = 32u(t) with zero initial conditions.

    • Step 1: Transform equation into ss-domain:         s2Y(s)+12sY(s)+32Y(s)=32ss^2 Y(s) + 12s Y(s) + 32Y(s) = \frac{32}{s}

    • Step 2: Isolate Output Y(s)Y(s):         Y(s)(s2+12s+32)=32s  ⟹  Y(s)=32s(s2+12s+32)=32s(s+4)(s+8)Y(s)(s^2 + 12s + 32) = \frac{32}{s} \implies Y(s) = \frac{32}{s(s^2 + 12s + 32)} = \frac{32}{s(s+4)(s+8)}

    • Step 3: Perform Partial Fraction Expansion:         Y(s)=K1s+K2s+4+K3s+8Y(s) = \frac{K_1}{s} + \frac{K_2}{s+4} + \frac{K_3}{s+8}

      • K1=32(s+4)(s+8)∣s→0=3232=1K_1 = \left. \frac{32}{(s+4)(s+8)} \right|_{s \to 0} = \frac{32}{32} = 1

      • K2=32s(s+8)∣s→−4=32−16=−2K_2 = \left. \frac{32}{s(s+8)} \right|_{s \to -4} = \frac{32}{-16} = -2

      • K3=32s(s+4)∣s→−8=3232=1K_3 = \left. \frac{32}{s(s+4)} \right|_{s \to -8} = \frac{32}{32} = 1

    • Step 4: Take Inverse Laplace Transform:         Y(s)=1s−2s+4+1s+8Y(s) = \frac{1}{s} - \frac{2}{s+4} + \frac{1}{s+8}         y(t)=(1−2e−4t+e−8t)u(t)y(t) = (1 - 2e^{-4t} + e^{-8t})u(t)

The Transfer Function

  • Concept and Definition:     

    Block Diagram of a Transfer Function
    • A transfer function is an algebraic model representing the ratio of the Laplace transform of the output variable to the Laplace transform of the input variable, assuming zero initial conditions.

    • Mathematical definition:         G(s)=Output(s)Input(s)=C(s)R(s)G(s) = \frac{\text{Output}(s)}{\text{Input}(s)} = \frac{C(s)}{R(s)}

  • General Derivation for an nn-th Order LTI Differential Equation:

    • Given an nn-th order differential equation with constant coefficients:         andnc(t)dtn+an−1dn−1c(t)dtn−1+⋯+a0c(t)=bmdmr(t)dtm+bm−1dm−1r(t)dtm−1+⋯+b0r(t)a_n \frac{d^n c(t)}{dt^n} + a_{n-1} \frac{d^{n-1} c(t)}{dt^{n-1}} + \dots + a_0 c(t) = b_m \frac{d^m r(t)}{dt^m} + b_{m-1} \frac{d^{m-1} r(t)}{dt^{m-1}} + \dots + b_0 r(t)

    • Taking the Laplace transform of both sides under zero initial conditions:         (ansn+an−1sn−1+⋯+a0)C(s)=(bmsm+bm−1sm−1+⋯+b0)R(s)(a_n s^n + a_{n-1} s^{n-1} + \dots + a_0) C(s) = (b_m s^m + b_{m-1} s^{m-1} + \dots + b_0) R(s)

    • Forming the output-to-input transfer ratio:         G(s)=C(s)R(s)=bmsm+bm−1sm−1+⋯+b0ansn+an−1sn−1+⋯+a0G(s) = \frac{C(s)}{R(s)} = \frac{b_m s^m + b_{m-1} s^{m-1} + \dots + b_0}{a_n s^n + a_{n-1} s^{n-1} + \dots + a_0}

  • Transfer Function Worked Examples:

    • Example 1 (First-Order Equation):         Find G(s)=C(s)R(s)G(s) = \frac{C(s)}{R(s)} for dc(t)dt+2c(t)=r(t)\frac{dc(t)}{dt} + 2c(t) = r(t).         sC(s)+2C(s)=R(s)  ⟹  (s+2)C(s)=R(s)  ⟹  G(s)=1s+2s C(s) + 2C(s) = R(s) \implies (s + 2)C(s) = R(s) \implies G(s) = \frac{1}{s + 2}

    • Practice Question 1 (First-Order System):         Find G(s)=C(s)R(s)G(s) = \frac{C(s)}{R(s)} for 3dc(t)dt+c(t)=5r(t)3\frac{dc(t)}{dt} + c(t) = 5r(t).         (3s+1)C(s)=5R(s)  ⟹  G(s)=53s+1(3s + 1)C(s) = 5R(s) \implies G(s) = \frac{5}{3s + 1}

    • Practice Question 2 (Second-Order Mechanical System):         Find G(s)=C(s)R(s)G(s) = \frac{C(s)}{R(s)} for d2c(t)dt2+4dc(t)dt+6c(t)=2r(t)\frac{d^2 c(t)}{dt^2} + 4\frac{dc(t)}{dt} + 6c(t) = 2r(t).         (s2+4s+6)C(s)=2R(s)  ⟹  G(s)=2s2+4s+6(s^2 + 4s + 6)C(s) = 2R(s) \implies G(s) = \frac{2}{s^2 + 4s + 6}

    • Practice Question 3 (Derivatives on Input Side):         Find G(s)=C(s)R(s)G(s) = \frac{C(s)}{R(s)} for 2dc(t)dt+8c(t)=3dr(t)dt+r(t)2\frac{dc(t)}{dt} + 8c(t) = 3\frac{dr(t)}{dt} + r(t).         (2s+8)C(s)=(3s+1)R(s)  ⟹  G(s)=3s+12s+8(2s + 8)C(s) = (3s + 1)R(s) \implies G(s) = \frac{3s + 1}{2s + 8}

Electrical Network Transfer Functions

  • Passive Component Relationships:     

    Electrical Component Table
    • Capacitor (CC in Farads FF):

      • Voltage-Current relation: v(t)=1C∫0ti(τ) dτv(t) = \frac{1}{C} \int_{0}^{t} i(\tau)\,d\tau

      • Current-Voltage relation: i(t)=Cdv(t)dti(t) = C \frac{dv(t)}{dt}

      • Voltage-Charge relation: v(t)=1Cq(t)v(t) = \frac{1}{C} q(t)

      • ss-Domain Impedance: Z(s)=V(s)I(s)=1CsZ(s) = \frac{V(s)}{I(s)} = \frac{1}{Cs}

      • ss-Domain Admittance: Y(s)=I(s)V(s)=CsY(s) = \frac{I(s)}{V(s)} = Cs

    • Resistor (RR in Ohms Ω\Omega):

      • Voltage-Current relation: v(t)=R i(t)v(t) = R\,i(t)

      • Current-Voltage relation: i(t)=1Rv(t)=G v(t)i(t) = \frac{1}{R} v(t) = G\,v(t)

      • Voltage-Charge relation: v(t)=Rdq(t)dtv(t) = R \frac{dq(t)}{dt}

      • ss-Domain Impedance: Z(s)=RZ(s) = R

      • ss-Domain Admittance: Y(s)=1R=GY(s) = \frac{1}{R} = G

    • Inductor (LL in Henries HH):

      • Voltage-Current relation: v(t)=Ldi(t)dtv(t) = L \frac{di(t)}{dt}

      • Current-Voltage relation: i(t)=1L∫0tv(τ) dτi(t) = \frac{1}{L} \int_{0}^{t} v(\tau)\,d\tau

      • Voltage-Charge relation: v(t)=Ld2q(t)dt2v(t) = L \frac{d^2q(t)}{dt^2}

      • ss-Domain Impedance: Z(s)=LsZ(s) = Ls

      • ss-Domain Admittance: Y(s)=1LsY(s) = \frac{1}{Ls}

  • Single-Loop RLC Circuit Analysis:

    • Apply Kirchhoff's Voltage Law (KVL) around a series RLC mesh containing input voltage source v(t)v(t), inductor LL, resistor RR, and capacitor CC:         Ldi(t)dt+Ri(t)+1C∫0ti(τ) dτ=v(t)L \frac{di(t)}{dt} + R i(t) + \frac{1}{C} \int_{0}^{t} i(\tau)\,d\tau = v(t)

    • Express current in terms of output capacitor voltage vC(t)v_C(t) using i(t)=CdvC(t)dti(t) = C \frac{dv_C(t)}{dt}:         LCd2vC(t)dt2+RCdvC(t)dt+vC(t)=v(t)L C \frac{d^2 v_C(t)}{dt^2} + R C \frac{dv_C(t)}{dt} + v_C(t) = v(t)

    • Transform to ss-domain assuming zero initial conditions:         (LCs2+RCs+1)VC(s)=V(s)(L C s^2 + R C s + 1) V_C(s) = V(s)

    • Form the capacitor voltage transfer function G(s)=VC(s)V(s)G(s) = \frac{V_C(s)}{V(s)}:         G(s)=VC(s)V(s)=1LCs2+RCs+1=1/LCs2+RLs+1LCG(s) = \frac{V_C(s)}{V(s)} = \frac{1}{LCs^2 + RCs + 1} = \frac{1/LC}{s^2 + \frac{R}{L}s + \frac{1}{LC}}

  • Multi-Loop Network Analysis via Mesh Equations & Cramer's Rule:

    • Procedure for Complex Networks:

      • 1. Replace element values with their ss-domain impedances Z(s)Z(s).

      • 2. Replace time-domain sources and variables with their Laplace transforms.

      • 3. Assign loop currents I1(s),I2(s),…,IN(s)I_1(s), I_2(s), \dots, I_N(s) and establish loop directions.

      • 4. Write KVL mesh equations in matrix form:             [Sum of Z in Mesh 1]I1(s)−[Common Z Mesh 1-2]I2(s)=[Applied V Mesh 1]\begin{bmatrix} \text{Sum of } Z \text{ in Mesh 1} \end{bmatrix} I_1(s) - \begin{bmatrix} \text{Common } Z \text{ Mesh 1-2} \end{bmatrix} I_2(s) = \begin{bmatrix} \text{Applied } V \text{ Mesh 1} \end{bmatrix}             −[Common Z Mesh 1-2]I1(s)+[Sum of Z in Mesh 2]I2(s)=[Applied V Mesh 2]-\begin{bmatrix} \text{Common } Z \text{ Mesh 1-2} \end{bmatrix} I_1(s) + \begin{bmatrix} \text{Sum of } Z \text{ in Mesh 2} \end{bmatrix} I_2(s) = \begin{bmatrix} \text{Applied } V \text{ Mesh 2} \end{bmatrix}

      • 5. Solve the system of simultaneous equations using Cramer's rule for the desired output variable.

      • 6. Construct the output-over-input transfer function.

    • Two-Mesh Example Derivation:

      • Network configuration: Mesh 1 contains source V(s)V(s), series resistor R1R_1, and shared inductor LL. Mesh 2 contains shared inductor LL, series resistor R2R_2, and capacitor CC

      • Mesh KVL Equations:             (R1+Ls)I1(s)−LsI2(s)=V(s)(R_1 + Ls) I_1(s) - Ls I_2(s) = V(s)             −LsI1(s)+(Ls+R2+1Cs)I2(s)=0-Ls I_1(s) + \left( Ls + R_2 + \frac{1}{Cs} \right) I_2(s) = 0

      • Solve for Mesh 2 current I2(s)I_2(s) using Cramer's Rule:             I2(s)=∣(R1+Ls)V(s)−Ls0∣Δ=LsV(s)ΔI_2(s) = \frac{\begin{vmatrix} (R_1 + Ls) & V(s) \\ -Ls & 0 \end{vmatrix}}{\Delta} = \frac{Ls V(s)}{\Delta}             where system determinant Δ\Delta is:             Δ=∣(R1+Ls)−Ls−Ls(Ls+R2+1Cs)∣=(R1+Ls)(Ls+R2+1Cs)−(Ls)2\Delta = \begin{vmatrix} (R_1 + Ls) & -Ls \\ -Ls & \left( Ls + R_2 + \frac{1}{Cs} \right) \end{vmatrix} = (R_1 + Ls)\left( Ls + R_2 + \frac{1}{Cs} \right) - (Ls)^2

      • Expand and simplify Δ\Delta:             Δ=R1Ls+R1R2+R1Cs+L2s2+LR2s+LC−L2s2=(R1+R2)Ls+(R1R2+LC)+R1Cs\Delta = R_1 Ls + R_1 R_2 + \frac{R_1}{Cs} + L^2 s^2 + L R_2 s + \frac{L}{C} - L^2 s^2 = (R_1 + R_2)Ls + (R_1 R_2 + \frac{L}{C}) + \frac{R_1}{Cs}             Δ=(R1+R2)LCs2+(R1R2C+L)s+R1Cs\Delta = \frac{(R_1 + R_2)LCs^2 + (R_1 R_2 C + L)s + R_1}{Cs}

      • Form final transfer function G(s)=I2(s)V(s)G(s) = \frac{I_2(s)}{V(s)}:             G(s)=I2(s)V(s)=LsΔ=LCs2(R1+R2)LCs2+(R1R2C+L)s+R1G(s) = \frac{I_2(s)}{V(s)} = \frac{Ls}{\Delta} = \frac{LCs^2}{(R_1 + R_2)LCs^2 + (R_1 R_2 C + L)s + R_1}

Operational Amplifier Transfer Functions

  • Ideal Operational Amplifier Properties:

    • Differential Input: vo(t)=A[v2(t)−v1(t)]v_o(t) = A [v_2(t) - v_1(t)]

    • High Input Impedance: Zi=∞Z_i = \infty (ideal, resulting in zero terminal input currents: Ia(s)=0I_a(s) = 0)

    • Low Output Impedance: Zo=0Z_o = 0 (ideal)

    • High Constant Voltage Gain: A=∞A = \infty (ideal, leading to virtual short circuit between inputs: v1(t)≈v2(t)v_1(t) \approx v_2(t))

  • Inverting Operational Amplifier Circuit:     

    Inverting Operational Amplifier
    • Non-inverting input (+$) is grounded (v_2(t) = 0),creatingavirtualgroundattheinvertinginput(), creating a virtual ground at the inverting input (v_1(t) \approx 0).\n * Input current equals negative feedback current due to infinite input impedance (I_1(s) = -I_2(s)).\n * Current expressions: I_1(s) = \frac{V_i(s)}{Z_1(s)}andand-I_2(s) = -\frac{V_o(s)}{Z_2(s)}.\n * Inverting Transfer Function Equation:\n        \frac{V_o(s)}{V_i(s)} = -\frac{Z_2(s)}{Z_1(s)}\n\n * *Inverting Op-Amp Numerical Example:*\n * Input impedance Z_1(s)composedofparallelcomposed of parallelR_1 = 360\,\text{k}\OmegaandandC_1 = 5.6\,\mu\text{F}:\n            Z_1(s) = \frac{1}{C_1 s + \frac{1}{R_1}} = \frac{1}{5.6 \times 10^{-6} s + \frac{1}{360 \times 10^3}} = \frac{360 \times 10^3}{2.016s + 1}\n * Feedback impedance Z_2(s)composedofseriescomposed of seriesR_2 = 220\,\text{k}\OmegaandandC_2 = 0.1\,\mu\text{F}:\n            Z_2(s) = R_2 + \frac{1}{C_2 s} = 220 \times 10^3 + \frac{10^7}{s}\n * Substitute into inverting equation:\n            \frac{V_o(s)}{V_i(s)} = -\frac{Z_2(s)}{Z_1(s)} = -\frac{220 \times 10^3 + \frac{10^7}{s}}{\frac{360 \times 10^3}{2.016s + 1}} = -1.232 \frac{s^2 + 45.95s + 22.55}{s}\n\n* **Noninverting Operational Amplifier Circuit:**\n    ![Noninverting Operational Amplifier](https://assets.knowt.com/pdf-flow-prod/84ea754f-9700-4323-8266-b39b96172441-figures/24.jpg)\n * Input signal V_i(s)isapplieddirectlytothenon−invertingterminal(is applied directly to the non-inverting terminal (+$).

    • Output voltage equation: Vo(s)=A[Vi(s)−V1(s)]V_o(s) = A [V_i(s) - V_1(s)]

    • Feedback voltage divider equation at inverting terminal (−-):         V1(s)=Z1(s)Z1(s)+Z2(s)Vo(s)V_1(s) = \frac{Z_1(s)}{Z_1(s) + Z_2(s)} V_o(s)

    • Substitute V1(s)V_1(s) into output equation:         Vo(s)=A[Vi(s)−Z1(s)Z1(s)+Z2(s)Vo(s)]V_o(s) = A \left[ V_i(s) - \frac{Z_1(s)}{Z_1(s) + Z_2(s)} V_o(s) \right]         Vo(s)Vi(s)=A1+AZ1(s)Z1(s)+Z2(s)\frac{V_o(s)}{V_i(s)} = \frac{A}{1 + A \frac{Z_1(s)}{Z_1(s) + Z_2(s)}}

    • For ideal/infinite gain A→∞A \to \infty, unity in the denominator is neglected:         Vo(s)Vi(s)=Z1(s)+Z2(s)Z1(s)=1+Z2(s)Z1(s)\frac{V_o(s)}{V_i(s)} = \frac{Z_1(s) + Z_2(s)}{Z_1(s)} = 1 + \frac{Z_2(s)}{Z_1(s)}

    • Noninverting Op-Amp Impedance Example:

      • Impedance Z1(s)Z_1(s) in series branch to ground: Z1(s)=R1+1C1sZ_1(s) = R_1 + \frac{1}{C_1 s}

      • Impedance Z2(s)Z_2(s) in parallel feedback branch: Z2(s)=R2(1/C2s)R2+(1/C2s)=R2R2C2s+1Z_2(s) = \frac{R_2 (1/C_2 s)}{R_2 + (1/C_2 s)} = \frac{R_2}{R_2 C_2 s + 1}

      • Substitute Z1(s)Z_1(s) and Z2(s)Z_2(s) into noninverting transfer function:             Vo(s)Vi(s)=C2C1R2R1s2+(C2R2+C1R2+C1R1)s+1C2C1R2R1s2+(C2R2+C1R1)s+1\frac{V_o(s)}{V_i(s)} = \frac{C_2 C_1 R_2 R_1 s^2 + (C_2 R_2 + C_1 R_2 + C_1 R_1)s + 1}{C_2 C_1 R_2 R_1 s^2 + (C_2 R_2 + C_1 R_1)s + 1}