Assignment 3
Assignment 3
INSTRUCTIONS
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.
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.
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
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.