CM Handout Lab
CM Handout Lab
BATCH – 2022-26
SEMESTER – III
● CREDITS: 1
1 | Page
1. COURSE OBJECTIVES:
To understand numerical methods to find roots of functions and first-
order unconstrained minimization of functions.
To introduce concept of interpolation methods and numerical
integration.
To understand numerical methods to solve systems of algebraic
equations and curve fitting by splines.
To understand numerical methods for the solution of Ordinary and
partial differential equations.
2. COURSE OUTCOMES
CO 1 Ability to develop mathematical models of low-level engineering
problems
CO 2 Ability to apply interpolation methods and numerical integration.
CO 3 Ability to solve simultaneous linear equations and curve fitting by
splines
CO 4 Ability to numerically solve ordinary differential equations that are
initial value or boundary value problems
3. CO-PO MAPPING
4. LIST OF EXPERIMENTS
Implementation to be done on C/C++
1.
a) Write a program to print all odd positive integers less than 100,
omitting those divisible by 7.
b) Write a program to determine the number of integers between 1 and
2000 that are not divisible by 2, 3 or 5 but are divisible by 7.
2 | Page
c) Write a program to add and multiply any two matrices.
2. Write a program to find a root of the equation 𝒙𝟑 − 𝟐𝒙 − 𝟏 = 𝟎 using
Bisection method. Run the program for the initial interval provided by the
user.
𝟐
3. Write a program to solve for a root of the equation 𝒆−𝒙 = 𝒄𝒐𝒔 𝒙 + 𝟏 using
Newton-Raphson method in the interval [0 4]. Run the program for the
initial approximations 0 and 1.
4. Write a program to solve for a root of the equation 𝒙𝟓 + 𝒙𝟑 + 𝟑 = 𝟎 using
Secant method. Run the program for the initial approximations -1 and 1.
5. Write a program to predict this year's rainfall using the Lagrange
Interpolation method. Use the annual rainfall data for the last 10 years in
your city. Is the answer obtained reasonable?
6. Using 21 equally spaced nodes on the interval [-5 5], find the interpolating
𝟏
polynomial 𝒑(𝒙) of degree 20 for the function 𝒇(𝒙) = 𝟏+𝒙𝟐 . Print the values
of 𝒑(𝒙) and 𝒇(𝒙) at 41 equally spaced points, including the nodes. What do
you observe?
7. Write a program to verify that 59 subintervals are required to evaluate
𝟏 𝟐 𝟏
∫𝟎 𝒆−𝒙 𝒅𝒙 with atmost error of 𝟐 ∗ 𝟏𝟎−𝟒 for the composite Trapezoidal Rule.
3 | Page