Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

CHE 306 (NUMERICAL METHODS IN ENGINEERING) ASSIGNMENT 1

PROBLEM 1.
A simple electric circuit consisting of a resistor, a capacitor, and an inductor is depicted in
Fig. 1.1. The charge on the capacitor q(t) as a function of time can be computed as
 
 1  R  
q(t ) = qoe− Rt /(2L) cos 
2

−  t  (1.1)
 LC  2 L  
 

Figure 1.1
where t = time, q0 = the initial charge, R = the resistance, L = inductance, and C = capacitance.
Use MATLAB to generate a plot of this function from t = 0 to 0.8, given that
q0 = 10, R = 60, L = 9, and C = 0.00005.

PROBLEM 2.
The standard normal probability density function is a bell-shaped curve that can be
represented as
1 − z2 /2
f ( z) = e (2.1)
2
Use MATLAB to generate a plot of this function from z = −5 to 5. Label the ordinate as
frequency and the abscissa as z.

PROBLEM 3.
If a force F (N) is applied to compress a spring, its displacement x (m) can often be modeled
by Hooke’s law:
F = kx (3.1)
where k = the spring constant (N/m). The potential energy stored in the spring U (J) can then
be computed as
1
U = kx2 (3.2)
2
Five springs are tested, and the following data compiled:

(a) Use MATLAB to store F and x as vectors and then compute vectors of the spring
constants and the potential energies.
(b) Use the max function to determine the maximum potential energy.

PROBLEM 4.
The density of freshwater can be computed as a function of temperature with the following
cubic equation:

 = 5.5289x10−8T 3 − 8.5016x10−6T 2 + 6.5622x10−5T + 0.99987 (4.1)


C C C
where ρ = density (g/cm3) and TC = temperature (°C).
(a) Use MATLAB to generate a vector of temperatures ranging from 32 °F to 93.2 °F
using increments of 3.6 °F.
(b) Convert this vector to degrees Celsius and then compute a vector of densities based on
the cubic formula. Create a plot of ρ versus TC. Recall that TC = 5/9(TF − 32).

You might also like