Sie sind auf Seite 1von 4

FCM2043/EBB2143 - COMPUTATIONAL METHODS

MAY 2013 SEMESTER


MATLAB ASSIGNMENT/TEST QUESTIONS
Q1. Develop an M-file to implement the bisection method. Using this program solve
the following problem.
The velocity of falling parachutist is given as
) 1 ( ) (
) / ( t m c
e
c
gm
t v


.
Where
) (t v
= velocity of parachutist =
s m/ 40
,
g
= gravitational constant =
2
/ 8 . 9 s m ,
m
= the mass of the parachutist =
kg 1 . 68
.
Find the drag coefficient, c at the time 10 t seconds using the initial bracket of
the root as [13, 16] and iterate until
001 . 0
a

%.
Q2. Develop an M-file to implement the falseposition method. Using this program
solve the following problem.
The velocity of falling parachutist is given as
) 1 ( ) (
) / ( t m c
e
c
gm
t v


.
Where
) (t v
= velocity of parachutist =
s m/ 40
,
g
= gravitational constant =
2
/ 8 . 9 s m ,
m
= the mass of the parachutist =
kg 1 . 68
.
Find the drag coefficient, c at the time 10 t seconds using the initial bracket of
the root as [13, 16] and iterate until
001 . 0
a

%.
Q3. Locate the root of x x x f ) sin( 2 ) (
(a) Using the MATLAB function fzero with an initial guess of

2
0
x
.
(b) Using Newton-Raphson method by writing a function M-file. Use an
initial guess of
5 . 0
0
x
and iterate until
001 . 0
a

%.
Q4. Develop an M-file to implement the modified secant method. Using this program
determine the loest positive root of 1 ) sin( 8 ) (
x
e x x f with an initial guess
of
3 . 0
0
x
and 01 . 0 . Iterate until
% 000001 . 0
a

.
Q5. Find the solution of the following set of linear algebraic equations
2 3 3 2
1 4 3 3
1 3 2
+ +
+ +
+ +
z y x
z y x
z y x
(a) Using the left-division \.
(b) Using Gaussian elimination.
(c) Using the LU decomposition.
[Hint: Since [LU]x = b, let [U]x = y, so that [L]y = b. Now, first solve for
y and then for x.]
Q6. Develop a function M-file Tridiag.m to solve the following tridiagonal system
with the Thomas algorithm.
1
1
1
1
1
1
1
1
1
1
1
]
1

1
1
1
1
1
1
1
1
1
1
1
]
1

1
1
1
1
1
1
1
1
1
1
1
]
1


n
n
n
n
n n
n n n
r
r
r
r
r
x
x
x
x
x
f e
g f e
g f e
g f e
g f
1
3
2
1
1
3
2
1
1 1 1
3 3 3
2 2 2
1 1
.
.
.
.
.
.
. . .
. . .
. . .
Thomas Algorithm:
(i) Decomposition:
1

k
k
k
f
e
e
and
1
.


k k k k
g e f f
, where
n k , , 4 , 3 , 2
.
(ii) Forward substitution:
1
.


k k k k
r e r r
, where
n k , , 4 , 3 , 2
.
(iii) Back substitution:
n
n
n
f
r
x

and
k
k k k
k
f
x g r
x
) . (
1 +

, where
1 , 2 , , 2 , 1 n n k
.
Using your program, solve the following tridiagonal system.

1
1
1
1
]
1

01475 . 2 020875 . 0
020875 . 0 01475 . 2 020875 . 0
020875 . 0 01475 . 2 020875 . 0
020875 . 0 01475 . 2

1
1
1
1
]
1

4
3
2
1
x
x
x
x
=
1
1
1
1
]
1

0875 . 2
0
0
175 . 4
Q7. Develop a MATLAB script file to determine the solution of the following system
of linear equations using the Gauss-Seidel iteration method by performing first
seven iterations.
21 10 2 3 2
5 . 12 4 11 2 3
14 3 2 8 2
5 . 54 2 3 2 9
4 3 2 1
4 3 2 1
4 3 2 1
4 3 2 1
+ + +
+ +
+ +
+ +
x x x x
x x x x
x x x x
x x x x
Q8. Develop a script M-file to estimate
) 75 . 2 ( f
using Lagrange interpolating
polynomials of order 1, 2 and 3 for the following data.
x 0 1 2 3 4 5
f(x
)
0 0.5 0.8 0.9 0.941176 0.961538
For each estimate find the true percent relative error if the try function is given by
) 1 (
) (
2
2
x
x
x f
+

.
Q9. The force on a sailboat mast can be represented by the following function:

,
_

H
H z
dz e
z
z
F
0
/ 5 . 2
7
200
where z the elevation above the deck and H the height of the mast.
Compute F for the case where 30 H using
(i) the M-file for Trapezoidal rule with the step size 1 . 0 h .
the MATLAB trapz function.
Q10. Develop an M-file to implement Simpsons 1/3 rule. Using your program solve
the following problem.
The velocity of falling parachutist is given as
) 1 ( ) (
) / ( t m c
e
c
gm
t v


.
Where
) (t v
= velocity of parachutist,
g
= gravitational constant =
2
/ 8 . 9 s m ,
m
= mass of the parachutist =
kg 45
,
c
= the drag coefficient =
s kg / 5 . 32
.
If the distance, d, traveled by the parachutist is given by

6
0
) ( dt t v d
,
find the distance using Simpsons 1/3 rule for the segments 10, 20, 50, and 100.
Q11. Develop an M-file for Eulers method to solve a first order ordinary differential
equation (ODE).
The current around the circuit at time t is governed by the following differential
equation
t
e i
dt
di
2
3 2 3

+
,
2 ) 0 ( i
.
Using your program, solve the above initial value problem over the interval from
0 t to 2 with the step size 1 . 0 h .
Q12. Develop an M-file for Fourth-Order Runge-Kutta method to solve a first order
ordinary differential equation (ODE).
Using your program solve the following initial value problem over the interval
from 0 x to 2 with the step size 2 . 0 h .
8 . 0 ) 0 ( ,
2
+ y y x
dx
dy
.
i(t)
E

Das könnte Ihnen auch gefallen