Lecture 08-20220822
Lecture 08-20220822
Quiz ‐ 1
CE‐603 Quiz – 1:
Thursday, August 25, 2022
Numerical Methods For 1 hour during class hours
Mohammad Rafiq ([email protected])
oExam will be conducted in class room.
Prof. Ravi Sinha ([email protected])
oExam will be closed‐book.
Lecture 08 – Monday, August 22, 2022 oQuestion paper may include a mix of theoretical and numerical questions.
CE‐603 Numerical Methods | Autumn Semester 2022‐23 2
Quiz ‐ 1
Exam Topics:
oMathematical Background
oComputer Representation of Numbers
oErrors in Numerical Computations
Review of Homework &
oStability of Algorithms
oRoots of Nonlinear Equations
Problem Session
o Single equation
o Simultaneous equations
CE‐603 Numerical Methods | Autumn Semester 2022‐23 3 CE‐603 Numerical Methods | Autumn Semester 2022‐23 4
29‐08‐2022
Homework 1 Homework 2
oProblem Statement oProblem Statement
o Let’s go through the model solution together! o Let’s go through the model solution together!
CE‐603 Numerical Methods | Autumn Semester 2022‐23 5 CE‐603 Numerical Methods | Autumn Semester 2022‐23 6
Some Common Mistakes in Your Homework Recommendations
o You calculate everything but don’t present your results or presented results are not o Go through the model solutions available on Moodle. Compare your solutions and scripts
explanatory and note down where you could have done much better.
o Hard‐coding: Don’t worry, you will get over this with time o Feel free to fiddle around with these codes and exploit them to improve your skills.
o Zero or insufficient commenting in the program. o Use standard naming conventions.
o Involving too much user intervention o Documentation of results.
o Program does not execute, either you make changes in the program and do not retest the o Code should do what is asked for and be easy to test, extend and reuse.
program or make the file name invalid for submission
o Try interpretation of results (whatever you get) and making sense out of it.
o Insufficient observations and comments from the results of your homework
CE‐603 Numerical Methods | Autumn Semester 2022‐23 7 CE‐603 Numerical Methods | Autumn Semester 2022‐23 8
29‐08‐2022
Bisection Method – A Review
f(x) is continuous on a given interval [a, b] and it also satisfies f(a) f(b) < 0, then f(x) must
have at least one root in the interval [a, b].
Roots of Nonlinear Algorithm for Bisection:
Step (1) Define c=(a+b)/2
Equations
a c1
c2 b Step (2) If (bc) , accept root = c and exit
Step (3) If sign[f(b)] sign[f(c)] 0, then a =
c;
otherwise b = c
Step (4) Return to Step (1)
CE‐603 Numerical Methods | Autumn Semester 2022‐23 9 CE‐603 Numerical Methods | Autumn Semester 2022‐23 10
o Time allotted = 5 minutes
f (xn )
x n 1 x n n0
o Let’s solve the problem together on board f (xn )
x2 x1 x0
CE‐603 Numerical Methods | Autumn Semester 2022‐23 11 CE‐603 Numerical Methods | Autumn Semester 2022‐23 12
29‐08‐2022
oTake initial guesses as
w f [ x2 , x1 ] (x2 x1 ) f [ x2 , x1 , x0 ]
f [ x2 , x1 ] f [ x2 , x0 ] f [ x0 , x1 ]
The sign in 2nd term is chosen to maximize the magnitude of denominator.
CE‐603 Numerical Methods | Autumn Semester 2022‐23 15 CE‐603 Numerical Methods | Autumn Semester 2022‐23 16
29‐08‐2022
Homework Queries Summary
o HW3 – Ritik Dhalwani oReview of Homework solutions
o HW4 – Naqeeb ul Islam oProblem solving session
oHW5 – Mohammad Rafiq oQuiz 1 Reminder (August 25, 2022 @ 5:30 PM)
o HW6 – Mudit Agarwal
CE‐603 Numerical Methods | Autumn Semester 2022‐23 17 CE‐603 Numerical Methods | Autumn Semester 2022‐23 18
Next Lecture (L‐09)
The next lecture on Thursday, August 25, 2022 (Quiz 1).
End of Lecture 08
CE‐603 Numerical Methods | Autumn Semester 2022‐23 19 CE‐603 Numerical Methods | Autumn Semester 2022‐23 20