Vous êtes sur la page 1sur 2

MATLAB Programming for Numerical Computations Jan–March 2016

Assignment for Module–3


Due on: Tuesday, Feb 9th

INSTRUCTIONS

• Submit your work on the course website ( https://onlinecourses.nptel.ac.in/noc16_ch01/ )


• The assignment deadline is 9th Feb 2016. Please submit your results before the deadline.
• You are required to use the uploaded function file for Problem 2. Do not edit this file.

1. NUMERICAL INTEGRATION USING SIMPSON’S 1/3RD RULE (2 points)

We will use multiple applications of Simpson’s 1/3rd Rule to solve the following integral:
'
#
𝑒 " d𝑥
(

Solve this problem using 𝑛 = 4, 8, 16 and 32 intervals. Report the solutions as described below
1–4. Report the solution using 𝑛 = 4, 8, 16 and 32 intervals, respectively.

2. INTEGRATION USING MATLAB IN-BUILT FUNCTIONS (1.5 point)

You are required to use the function hw3fun.m uploaded on the course website.
Use the MATLAB command quad to compute the following integral:
5
𝑎𝑥 ln 𝑥 ' d𝑥
'

A parameterized function is uploaded to the course website. You are required to use this file to
solve the problem using quad command. This function is called using variable 𝑥 and parameter
𝑎 as the two arguments: Thus, f=hw3fun(x,a) will give 𝑓 𝑥 = 𝑎𝑥 ln 𝑥 ' .
Use the uploaded function to calculate the integral for value of 𝑎 = 5.
5. Please report the value of integral obtained using quad command for 𝑎 = 5.

3. TRAPEZOIDAL RULE (1.5 point)

Use the trapezoidal rule, with step-size of ℎ = 0.2 to obtain the following integral:
5
0.2𝑥 ln 𝑥 ' d𝑥
'

6. Please report the value of integral obtained using trapezoidal rule for h=0.2.
Note: Some of you may realize that this problem is similar to Problem-2 above. Advanced
users may choose to call function hw3fun for this problem as well. Do not edit hw3fun.m.

1
MATLAB Programming for Numerical Computations Jan–March 2016

4. APPLICATION: NEWTON’S LAW OF COOLING (3 points)

The use of template file newtonCooling.m (uploaded) is optional.


A hot body placed in air will lose heat and eventually reach the temperature of air.
According to the Newton’s Law of Cooling, the rate of change in temperature of the body is
given by the following equation:
𝑑𝑇
= −𝑘 𝑇 − 𝑇@
𝑑𝑡
where 𝑇 is the temperature of the hot body and 𝑇@ = 20 °𝐶 is the ambient temperature. The
following data is obtained when a hot ball at 80 °𝐶 was placed in the ambient:
𝑡 min 0 5 10 15 20
𝑇 °𝐶 80.0 44.5 30.0 24.1 21.7

GH
At 𝑡 = 5 𝑚𝑖𝑛, use the central difference formula to find .
GI

Since the temperature at this time is 44.5 °𝐶 and ambient is 20 °𝐶, find the value of 𝑘.
Repeat this at 10 and 15 minutes also. Find the average 𝑘 from these three time.
7. Report dT/dt computed at 5 minutes
8. Report the value of coefficient 𝑘 computed at 5 minutes
9. Report the average value of coefficient 𝑘, as average of values at 5, 10, 15 minutes.

Vous aimerez peut-être aussi