0% found this document useful (0 votes)
2 views

Matlab-Exercise2

The document outlines a Matlab exercise focused on numerical solutions to civil engineering problems using the Gauss Elimination and Doolittle’s Decomposition methods. It includes instructions for coding in Matlab to solve various systems of linear equations and an engineering problem involving material requirements from different pits. Additionally, it suggests creating functions for the Gauss-Jordan process and Crout's method.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Matlab-Exercise2

The document outlines a Matlab exercise focused on numerical solutions to civil engineering problems using the Gauss Elimination and Doolittle’s Decomposition methods. It includes instructions for coding in Matlab to solve various systems of linear equations and an engineering problem involving material requirements from different pits. Additionally, it suggests creating functions for the Gauss-Jordan process and Crout's method.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

Name: John Kirby F.

Gamaya

ENG’G MATH 124: Numerical Solution to CE Problems

Matlab Exercise no. 2

A. Gauss Elimination Method


1. Open Matlab, create a new script, and encode the code.
2. Save the code using its function name “gauss.m”
3. Apply the program to solve the following system of linear equations:
a. 80x-20y-20z=20
-20x+40y-20z=20
-20x-20y+130z=20

b. 3w+2x+z=9 2w+3x+y+2z=15 w+x+5y+3z=18


4w+3x+2y+4z=24
c. 𝑥1 = 0
𝑥2 = 10
2𝑥3 − 10𝑥5 + 3𝑥6 = 5
3𝑥4 − 2𝑥5 + 2𝑥6 − 3𝑥7 = 2
𝑥5 + 5𝑥6 + 𝑥7 = 14
3𝑥6 − 4𝑥7 = 17
2𝑥7 = −4
2𝑥8 = 10
𝑥9 = 1
4. Apply the program to solve this engineering problem.
A. civil engineer involved in construction requires 4800, 5800, and 5700m^3
of sand, fine gravel, and coarse gravel, respectively, for a building project.
There are three pits from which these materials can be obtained. The
compoxition of these pits is

Fine Coarse
Sand Gravel Gravel
% % %

Pit 1 52 30 18
Pit 2 20 50 30

Pit 3 25 20 55
5. Utilizing the Gauss program illustrated above, create another function
that would illustrate the Gauss-Jordan process.

A. Doolottle’s Decomposition Method

1. Open Matlab, create a new script, and encode the code.


2. Save the code using its function name “Doolittle.m”
3. Apply the program to solve the following system of linear equations:

a. 2w+4x-4y=12 w+5x-5y-3z=18 2w+3x+y+3z=8


w+4x-2y+2z=8
b. w+2x-z=9
2w+3x-y=9
4x+2y-5y-5z=26
5w+5x+2y-4z=32
4. Create another function that would illustrate the crout’s method.

You might also like