You are on page 1of 2

Tutorial 3

Question 1

Write a user-defined MATLAB function for the following math function:

4 −0 . 5 x 3 2
y( x )=−0. 2 x +e x +7 x

The input to the function is x and the output is y.


Use the function to calculate y (-2.5) and y (3).

Question 2

Write a function with two sub-functions (nested functions) to calculate the Reynolds number,
Re, for a small spherical particle with a diameter of Dp and a terminal velocity of vt, which is
dropped in a large cylinder filled with water. Assume the density of water is  and its
dynamic viscosity is. Both  and  are functions of temperature. T is the temperature in
degrees Celsius, T0 is the temperature at which water attains its maximum density, . A to F
are constants. It can be noted that in the following equation, Dp is in m and  is in kg/m3 and 
is in Pa.s.

D p vt ρ
Re=
μ

A(T ∘−T ∘0 )2 (T ∘+B)


(
ρ= 1−
(T ∘ +C )
ρ0 )
E

μ=D (10) T +F

T ∘0=3 . 982∘ C

ρ0 =999 . 955 kg / m3

−6 ∘ −1
A=1 . 858×10 ( C )

B=316 . 34∘ C

C=70 .70∘ C

−5
D=2. 414×10 Pa .s
E=247. 8

F=133. 15

Use your developed function to calculate the density and the Reynolds number for T=4C if
the particle diameter is 1 mm and terminal velocity is 0.3 m/s.

You might also like