Starting from:

$29

Aerospace Computational Techniques Homework 4



MAE 3150: Aerospace Computational Techniques

Homework 4 


Solving a linear system of equations of the form   is commonplace in aerospace-related numerical methods, particularly in computational fluid dynamics (CFD) or finite element analysis (FEA).

For this assignment, you will need to write two codes.  For the first, you will implement Gaussian Elimination in the manner it was presented in class.  Do no use other formulations.  Your program should accept a matrix, A, either by reading it from a file or from the keyboard at runtime.  Your matrix may not be hardcoded.  Likewise, your code should accept a column vector,  .  Then your matrix must be passed to one or more subroutines that return the solution to  to the main program.  Use your code to solve the two following matrix systems.

8.44    9.79    0.18    8.81    2.67
3.45    1.36    8.53    0.37    2.98
6.16    9.08    6.35    1.51    4.51
6.89    4.97    5.64    4.93    0.28
8.28    5.47    8.06    6.88    6.48
0.80
5.59
2.97
5.91
0.58

9.22    1.90    6.44    5.73    2.17
7.53    8.30    6.19    9.15    1.51
5.03    2.99    2.96    4.52    5.47
9.38    8.73    2.08    3.96    9.77
6.55    4.28    7.00    0.80    8.36
2.24
6.58
1.18
7.53
6.90

    




For your second code, implement Thomas’ algorithm.  This code should function in the same manner as the Gaussian Elimination code, and the algorithm must be in its own subroutine and called from the main program.  Use this code to solve the following systems of equations:

2.90    7.91    0    0    0
9.73    0.58    4.44    0    0
0    2.62    8.31    5.32    0
0    0    5.69    9.97    7.25
0    0    0    5.68    4.57
0.70
6.16
0.19
9.84
0.76

2.06    2.19    0    0    0
1.15    2.53    5.42    0    0
0    7.31    9.25    7.42    0
0    0    6.69    2.63    3.08
0    0    0    9.04    3.01
7.63
1.62
4.13
3.71
2.25

    




All answers must be written to a file and properly formatted with exactly 3 decimal points and with proper alignment.  You may write your code in any language you prefer, but you may not use MATLAB, Excel, or any other software package.  To complete this assignment, turn in your codes and printed solutions both in hardcopy and electronically on Canvas.

For all codes in this assignment, matrices must be read from either input files or the keyboard.

Filenames:    firstname_lastname.gaussian.sp16.ext
        firstname_lastname.thomas.sp16.ext

More products