0% found this document useful (0 votes)
34 views5 pages

Open Ended Lab mt-471

The document presents solutions to two numerical methods problems. The first uses the Chebyshev method in MATLAB to solve the Manning equation for a depth value (H) of approximately 0.7036. The second applies LU decomposition in MATLAB to solve a system of equations modeling a spring-mass system, estimating the displacement values (x1-x4) as 40, 80, 106.66, and 115.55 respectively.

Uploaded by

Muhammad Mawiz
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
34 views5 pages

Open Ended Lab mt-471

The document presents solutions to two numerical methods problems. The first uses the Chebyshev method in MATLAB to solve the Manning equation for a depth value (H) of approximately 0.7036. The second applies LU decomposition in MATLAB to solve a system of equations modeling a spring-mass system, estimating the displacement values (x1-x4) as 40, 80, 106.66, and 115.55 respectively.

Uploaded by

Muhammad Mawiz
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

MAWIZ

PP-048

DEPARTMENT OF POLYMER & PETROCHEMICAL ENGINEERING.

NED UNIVERSITY OF ENGINEERING & TECHNOLOGY, KARACHI.

This report is related to

The formulation of MATLAB code for solving manning equation


through Chebyshev method and estimating the value of x in a spring
mass system through LU decomposition method

submitted to

DR FAHIM RAEES
SIR UMER SIDDIQUI

Submitted by

STUDENT NAME SEAT NO

MUHAMMAD MAWIZ PP-048

Of Course
Applied Numerical Methods
(Mt-471)
MAWIZ
PP-048

Open Ended Lab


Applied Numerical Methods (MT – 471)

Q1). The Manning equation can be written for a rectangular open channel as

√ s (BH )5/ 3
Q= 2/ 3
n( B+2 H )

Where Q = flow (m3/s), S = slope, H = depth, and n = Manning roughness


coefficient. Formulate a Chebyshev method on MATLAB to solve the above
equation for H. Given that Q = 5, S = 0.0002, B = 20, and n = 0.03.

Solution:

Chebyshev iterative scheme

2 ''
( f ( xn )) f ( xn ) f ( x n)
x n+1=x n − 3

2( f ( xn))
' f ' (x n)

Calculations

√ s (BH )5/ 3
Q= 2/ 3
n( B+2 H )

√ 0.0002(20 H )5/ 3
5=
0.03(20+2 H)2 /3

f ( H ) =H 5/ 2−0.3879−0.03879 H

3/ 2
' 5H 3879
f ( H )= −
2 100000
1/ 2
'' 15(H )
f ( H )=
4

MATLAB Code
MAWIZ
PP-048

xo=10; % initial guess


f=@(h)(h.^2.5)-0.03879*h-0.3879; % function
df=@(h)(5*h^(3/2))/2 - 3879/100000; % 1st derivative
dff=@(h)(15*h^(1/2))/4; % 2nd derivative
n=10;
epi=10^-4; % Stoping criteria
for i=1:n
% chebyshev iterative method
x(i) = xo- (f(xo)/df(xo)) - (0.5*(f(xo)).^2 )/ (df(xo).^3 )*(dff(xo));
if abs (x(i)-xo)<epi
break
end
xo=x(i);
end
chebyshev_values = double(x)'

Command window

chebyshev_values =

4.8120
2.3392
1.2004
0.7698
0.7040
0.7036
0.7036

Result and discussion

The Manning equation is a formula used to estimate the flow rate of water in an
open channel based on the cross-sectional area of the channel, the slope of the
channel, and a coefficient of roughness. The Manning equation is a formula used
to estimate the flow rate of water in an open channel based on the cross-sectional
area of the channel, the slope of the channel, and a coefficient of roughness. From
the given data in the problem, we conclude that ‘H’ depth is approximately equal
to 0.7036

Q2). Idealized spring-mass systems have numerous applications throughout engineering.


The arrangement of four springs in series being depressed with a force of 2000 N. At
MAWIZ
PP-048

equilibrium, force-balance equations can be developed defining the interrelationships


between the springs
k 2 ( x 2−x 1 )=k 1 x 1
k 3 ( x 3−x 2 )=k 2 ( x 2−x 1 )
k 4 ( x 4−x 3 )=k 3 ( x3 −x2 )
F ¿ k 4 ( x 4−x 3 )
Where the k’s are spring constants. If k1 through k4 are 50, 50, 75, and 225 N m
Respectively, Estimate the values of x’s by applying LU Factorization method
on MATLAB.
Solution
50 ( x 2−x 1 )=50 x 1
75 ( x 3−x 2 )=50 ( x 2−x 1 )
225 ( x 4− x3 ) =75 ( x3 −x 2)
2000=225 ( x 4−x 3 )

[ ][ ] [ ]
−2 1 0 0 x1 0
2 −5 3 0 . x2 = 0
0 1 −4 3 x3 0
0 0 1 −1 x 4 −80/9

A . X=B
∵ A=LU
∵ L=Lower triangular ¿
∵ U=Upper triangular ¿
L U X=B
∵ U X=Y
L Y =B
MATLAB Code

%LU-decomposition
clc;clear all
A=[2 -1 0 0;2 -5 3 0;0 1 -4 3;0 0 1 -1]
B=[0;0;0;-80/9]
[L,U]=lu(sym(A))%command for decomposition of matrix
Y=L\B
X=U\Y;
X=double(X)
Actual = A\B
MAWIZ
PP-048

Command window

A=
2 -1 0 0 Y=
2 -5 3 0 0
0 1 -4 3 0
0 0 1 -1 0
-80/9

B=
0 X=
0 40.0000
0 80.0000
-8.8889 106.6667
115.5556

L=
[ 1, 0, 0, 0] Actual =
[ 1, 1, 0, 0] 40.0000
[ 0, -1/4, 1, 0] 80.0000
[ 0, 0, -4/13, 1] 106.6667
115.5556

U=
[ 2, -1, 0, 0]
[ 0, -4, 3, 0]
[ 0, 0, -13/4, 3]
[ 0, 0, 0, -1/13]

Result and discussion:

LU decomposition is a mathematical method that can be used to solve systems of linear


equations, including those that represent a spring mass system. It decomposes a matrix into
the product of a lower triangular matrix and an upper triangular matrix, and can be more
efficient and stable than other methods for solving such systems. it is utilized to predict the 'x'
distances in a spring mass system.
The results are found to be
X1=40.00
X2=80.00
X3=106.66
X4=115.55

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy