Structural Engineering Dynamics

CHAPTER 2: SOLUTION OF LINEAR EQUATIONS

2.2 SOLUTION OF SYSTEM OF LINEAR EQUATIONS

PAST EXAM QUESTIONS ADDRESSED IN THIS SECTION:

  1. Explain the solution methods of solving a system of linear equations with examples. [8] (2079 Jestha, Q7)
  2. Explain the different solution techniques of linear equations. [3-6] (2075 Bhadra, 2074 Magh, 2072 Ashwin, 2071 Magh)
  3. What are the direct methods and iterative methods of solving linear equations? [2] (2078 Kartik, Q2)
  4. Briefly explain about the different iterative methods used for the solution for given set of equations. [3] (2078 Chaitra, Q2a)

In computational engineering (such as Finite Element Analysis), the physical problem ultimately reduces to solving a large system of simultaneous algebraic linear equations of the form:

$$ [A]\{x\} = \{b\} $$

Where \([A]\) is the known square coefficient matrix (e.g., stiffness matrix), \(\{b\}\) is the known vector of constants (e.g., applied forces), and \(\{x\}\) is the unknown vector to be solved (e.g., nodal displacements). The solution techniques for these equations are broadly classified into two categories: Direct Methods and Iterative Methods.

1. Direct Methods

Direct methods attempt to solve the system of equations by a finite sequence of standard algebraic operations. In the absence of mathematical round-off errors, a direct method will yield the exact analytical solution.

Example of Gauss Elimination concept:
Given \( 2x + y = 5 \) and \( 4x + 3y = 11 \).
Multiply the first equation by 2 and subtract from the second to eliminate \(x\), yielding \( 1y = 1 \). Back-substituting \( y=1 \) into the first equation yields \( x=2 \).

2. Iterative Methods

Iterative methods start with an initial "guess" for the solution vector \(\{x\}^{(0)}\) and successively refine this guess through a looped algorithm until the solution converges within an acceptable tolerance margin (\( \epsilon \)).

[A]{x} = {b} Direct Methods - Finite, fixed steps - Yields "exact" result - High memory usage (e.g., Gauss, LU, Cholesky) Iterative Methods - Infinite looping steps - Yields approximate result - Low memory usage (e.g., Jacobi, Gauss-Seidel)
Figure 2.1: Comparison between Direct and Iterative solution approaches.

2.3 DATA STORAGE AND MEMORY OPTIMIZATION

PAST EXAM QUESTIONS ADDRESSED IN THIS SECTION:

  1. What do you mean by sparse matrix, banded matrix, and memory optimization? [3-5] (2079 Shrawan, 2076 Bhadra, 2074 Magh, 2073 Bhadra)
  2. Explain with suitable example how banded matrix and skyline storage scheme helps in memory optimization. [3-4] (2079 Chaitra, Q6b; 2077 Chaitra, Q2a; 2072 Magh)

Sparse and Banded Matrices

In structural engineering, the resulting global stiffness matrix \([K]\) for a large structure typically contains thousands of rows and columns.

Memory Optimization Techniques

Standard computer storage of an \(n \times n\) matrix requires allocating memory for \(n^2\) elements. For a 10,000-degree-of-freedom system, this requires storing 100,000,000 numbers, which overwhelms RAM, even though 95% of those numbers are just zero. Memory optimization strategies aim to store only the non-zero elements.

1. Banded Matrix Storage

Instead of storing the full \(n \times n\) square, we only store a rectangular array of dimension \(n \times m_B\), where \(m_B\) is the half-bandwidth. All zeroes outside this diagonal band are completely ignored by the computer's memory.

2. Skyline Storage Scheme (Variable Bandwidth)

Even within the diagonal band, there may be many zeros. The skyline storage scheme improves upon banded storage. If there are zeroes at the top of a column, operations and storage are only required for the elements starting from the first non-zero value down to the main diagonal.

The jagged boundary separating the top zeroes from the first non-zero element in each column is visually termed the skyline. Only the numerical values "below the skyline" are stored in a continuous 1D vector array, dramatically minimizing memory consumption.

Zero Elements (Not stored in memory) Stored Elements (Below the Skyline) The "Skyline"
Figure 2.2: Visualization of the Skyline Storage Scheme in a Symmetric Matrix.

2.4 CONJUGATE GRADIENT METHOD

PAST EXAM QUESTIONS ADDRESSED IN THIS SECTION:

  1. Write down the algorithm for Conjugate Gradient Method (for solving a system of linear equations). [3-5] (2080 Chaitra, 2079 Chaitra, 2079 Shrawan, 2073 Bhadra, 2072 Ashwin, 2071 Bhadra)
  2. Write down the algorithm for Conjugate Gradient method and its limitations. [3+2] (2077 Chaitra, Q2b)
  3. Why conjugate gradient method is used in computation over Gaussian methods? [4] (2070 Bhadra, Q4a)

The Conjugate Gradient Method (CGM) is an advanced mathematical algorithm for the numerical solution of particular systems of linear equations, specifically those whose matrix is symmetric and positive-definite. It is an iterative method that finds the exact solution of an \(n \times n\) matrix in at most \(n\) steps, but is typically stopped much earlier when a desired tolerance is reached.

Algorithm for Conjugate Gradient Method

To solve the system \( [A]\{x\} = \{b\} \):

  1. Initialization:
    • Choose an initial guess vector \( \{x\}_{0} \) (often just a vector of zeros).
    • Compute the initial residual vector: \( \{r\}_{0} = \{b\} - [A]\{x\}_{0} \).
    • Set the initial search direction vector equal to the residual: \( \{d\}_{0} = \{r\}_{0} \).
  2. Iterative Loop: For \( k = 0, 1, 2, \dots \) until convergence:
    1. Compute the optimal step size \( \alpha_k \) along the search direction:
      $$ \alpha_k = \frac{\{r\}_k^T \{r\}_k}{\{d\}_k^T [A] \{d\}_k} $$
    2. Update the solution vector:
      $$ \{x\}_{k+1} = \{x\}_k + \alpha_k \{d\}_k $$
    3. Update the residual vector:
      $$ \{r\}_{k+1} = \{r\}_k - \alpha_k [A] \{d\}_k $$
    4. Convergence Check: If the magnitude of the residual \( ||\{r\}_{k+1}|| \) is less than a specified tolerance \( \epsilon \), exit the loop.
    5. Compute the improvement factor \( \beta_k \) to find the new conjugate direction:
      $$ \beta_k = \frac{\{r\}_{k+1}^T \{r\}_{k+1}}{\{r\}_k^T \{r\}_k} $$
    6. Update the search direction vector (ensuring it is \(A\)-conjugate to previous directions):
      $$ \{d\}_{k+1} = \{r\}_{k+1} + \beta_k \{d\}_k $$
x (Exact Solution) x_0 x_1 x_2
Figure 2.3: Conjugate Gradient optimization path towards the exact solution minimum.

Why use Conjugate Gradient over Gaussian Methods?

Gaussian elimination (a direct method) requires \(O(n^3)\) mathematical operations and structurally alters the matrix \([A]\) via row operations, a phenomenon known as "fill-in." This fill-in completely destroys the sparse nature of the matrix, requiring massive amounts of computer memory.

The Conjugate Gradient Method is vastly superior for massive, sparse systems because:

Limitations of the Conjugate Gradient Method

2.5 FOURIER TRANSFORM

PAST EXAM QUESTIONS ADDRESSED IN THIS SECTION:

  1. Describe briefly about the Discrete Fourier Transform (DFT) and Fast Fourier Transform (FFT). [4] (2074 Bhadra, Q6)
  2. Write an algorithm and a program (C/Fortran/Matlab) for fast Fourier transform. With a suitable example explain what parameters can be identified with the help of time domain and frequency domain. [12] (2070 Magh, Q2)

Time Domain vs. Frequency Domain

In civil engineering dynamics (like earthquake engineering or wind vibrations), structural responses are recorded via sensors.

Time Domain t FFT Frequency Domain f
Figure 2.4: Transformation from Time Domain (raw signal) to Frequency Domain (spectra).

Discrete Fourier Transform (DFT) and Fast Fourier Transform (FFT)

The Discrete Fourier Transform (DFT) is the mathematical algorithm used to convert a finite sequence of equally-spaced discrete time-domain samples into a same-length sequence of frequency-domain complex numbers. The formula is:

$$ X_k = \sum_{n=0}^{N-1} x_n \cdot e^{-i 2\pi k n / N} $$

Computing the DFT directly takes \(O(N^2)\) operations, which is prohibitively slow for long sensor data files.

The Fast Fourier Transform (FFT), commonly implementing the Cooley-Tukey algorithm, is a highly optimized computational technique that computes the exact same result as the DFT but factorizes the matrix mathematically to reduce the computation time to \(O(N \log N)\). This makes real-time digital signal processing possible.

MATLAB Program for Fast Fourier Transform

Below is a standard algorithm implemented via a MATLAB script to perform an FFT on a given time-domain signal and plot the frequency spectrum.

% MATLAB Script for Fast Fourier Transform (FFT) % 1. Define Time Specifications Fs = 100; % Sampling frequency (Hz) dt = 1/Fs; % Sampling period (seconds) L = 1000; % Length of signal (number of samples) t = (0:L-1)*dt; % Time vector % 2. Generate a Sample Signal (e.g., combination of 15 Hz and 40 Hz waves) x = 0.7*sin(2*pi*15*t) + 1.2*sin(2*pi*40*t); % 3. Execute the Fast Fourier Transform algorithm Y = fft(x); % 4. Compute the Two-Sided and Single-Sided Spectrum P2 = abs(Y/L); % Two-sided spectrum magnitude P1 = P2(1:L/2+1); % Single-sided spectrum P1(2:end-1) = 2*P1(2:end-1); % Double the amplitude (except for DC) % 5. Define Frequency Domain Vector f = Fs*(0:(L/2))/L; % 6. Plotting the results plot(f, P1) title('Single-Sided Amplitude Spectrum of x(t)') xlabel('Frequency (f) in Hz') ylabel('Amplitude |P1(f)|')