Assignment 1
Assignment 1
Tasks
d3 f
shown above.
dx3
(b) Write a computer program to calculate the derivative using the above mentioned schemes
for the following values of x.
(a) Derive the second-order finite difference approximation for
Submission Guidelines
The soft copy of this assignment, along with computer program, should be submitted
latest by 05/10/2013.
To submit your program, include the source code, executable and a description of program.
The description must include the flowchart of the program and the guidelines on how to
run your source code.
Any programming language (Fortran,C/C++, Matlab,... ) can be used for coding.
Programming Guidelines/Tips:
Use arrays to define different x, the three FDA and the three errors. For example the
syntax of defining an array for different x can be written in Matlab as following:
dx=[0.3 0.2 0.1 0.01 0.005 0.001 0.0005 0.00001];
Use a Do loop to calculate the three FDA and the three errors.
Logarithmic axis can be called in Matlab for both x and y axis by using loglog command.
For example the syntax to plot x array vs y array:
loglog(x,y)
hold on can be use in Matlab to plot multiple plots on the same graph.