0% found this document useful (0 votes)
37 views

Lecture 06-20220813

This document provides an overview of a numerical methods course, including information about class timings, course outcomes, course content, textbooks, prerequisites, evaluation structure, and a homework assignment. The class meets twice a week and covers topics like error analysis, curve fitting, root finding, interpolation, integration, solving equations, and numerical solutions to differential equations using computing tools like MATLAB.

Uploaded by

Kundan karn
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
37 views

Lecture 06-20220813

This document provides an overview of a numerical methods course, including information about class timings, course outcomes, course content, textbooks, prerequisites, evaluation structure, and a homework assignment. The class meets twice a week and covers topics like error analysis, curve fitting, root finding, interpolation, integration, solving equations, and numerical solutions to differential equations using computing tools like MATLAB.

Uploaded by

Kundan karn
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

28‐07‐2022

Basic Requirement:
TAKE NOTES
CE‐603 ‐ What is spoken
Numerical Methods ‐ What is shown
Prof. Ravi Sinha
([email protected])

Lecture 01 – Thursday, July 28, 2022

CE‐603 Numerical Methods | Autumn Semester 2022‐23 2

Course Facilitators & Teaching Assistants Course Facilitators & Teaching Assistants

Mr. Awanish Kumar  Mr. Mohammad Rafiq Joo Mr. Ritik Dhalwani Mr. Mudit Agarwal


([email protected]) ([email protected]) ([email protected]) ([email protected])

CE‐603 Numerical Methods | Autumn Semester 2022‐23 3 CE‐603 Numerical Methods | Autumn Semester 2022‐23 4
28‐07‐2022

Class Timings Course Outcomes
As per Slot 12 1. Greater understanding of use of computers:
o Monday 5:30 PM – 6:55 PM o A computer can’t do EVERYTHING
o Thursday 5:30 PM – 6:55 PM o While it can do many things, a computer mostly does them inaccurately

Alternate/Additional Time Slots as per requirement
o At its core, most users of a computer carry out numerical analyses & pattern matching
o Even simple tasks as moving mouse cursor or finger across screen is based on numerical analysis

2. Learn to use a computer to its full capability
o Learn basic principles of making a computer work for you
o Learn limitations of using a computer
o Learn implications of limitations of a computer
o Learn methods to numerically solve common engineering problems taking limitations into account

CE‐603 Numerical Methods | Autumn Semester 2022‐23 5 CE‐603 Numerical Methods | Autumn Semester 2022‐23 6

Course Outcomes ‐ Example Course Content


oIn 1991 during Gulf War, the US first deployed Patriot Missile (anti‐missile interceptor  oIntroduction to fundamentals of programming
system) to defend against missiles fired by Iraq. oError analysis
Speed oCurve fitting and roots of equations of single variable
~ 5000 kmph or 1.4 km per second! oPolynomial interpolation and extrapolation Course Introduction has 
oIn one case, the interception failed  oNumerical differentiation and integration been uploaded on Moodle 
resulting in death of 28 solders.  oSolution of nonlinear algebraic and transcendental equations (moodle.iitb.ac.in)
oThe failure was due to lack of realisation oElements of matrix algebra
that calculations by computers are  oSolution of systems of linear equations
always inaccurate!
oEigenvalue problems
oAll calculations were correct but the oNumerical solution of differential equations
result was not correct! Computer oriented algorithms; Numerical solution of different problems

CE‐603 Numerical Methods | Autumn Semester 2022‐23 7 CE‐603 Numerical Methods | Autumn Semester 2022‐23 8
28‐07‐2022

Text/References Prerequisites/Early Learning
1. G. E. Golub and C.F. Van Loan, Matrix Computations, 4th edition, Johns Hopkins  1. Vector Algebra
University Press, Baltimore, 2013.
2. A programming language (C++, Visual Basic, Fortran, etc.)
2. J. H. Wilkinson, The Algebraic Eigenvalue Problem, Revised edition, Clarendon Press, 
1988. 3. Use of MATLAB or another computing environment (Mathematica, Maple, R, etc.)
3. K.E. Atkinson, An Introduction to Numerical Analysis, 2nd edition, Wiley India Private 
Limited, New Delhi, 2008.
4. R.L. Burden and J. D. Faires, Numerical Analysis, 9th edition, Brooks/Cole Cengage 
Learning, Canada, 2011.
5. S. J. Chapman, MATLAB Programming for Engineers, 6th edition, Cengage Learning India 
Private Limited, 2019.
6. Other books on Numerical Methods, Analysis tools such as MATLAB, Mathematica, etc.
CE‐603 Numerical Methods | Autumn Semester 2022‐23 9 CE‐603 Numerical Methods | Autumn Semester 2022‐23 10

Evaluation Structure CE‐603 Moodle Page
Quizzes, Make sure that CE‐603 Moodle page is 
frequently checked
Exams,
Most resource materials will be provided on 
Homework, Moodle
etc. All homework will be assigned on Moodle
All homework will be assigned on Moodle, and must be submitted on Moodle by due  Submission of all homework solutions will 
date. be on Moodle
Homework performance will count towards final grade (10% ‐ 20% weightage).

CE‐603 Numerical Methods | Autumn Semester 2022‐23 11 CE‐603 Numerical Methods | Autumn Semester 2022‐23 12
28‐07‐2022

MATLAB Computing Environment Homework 0
MATLAB stands for MATrix LABoratory 1. Create an input file and give it your chosen name. Type number 1 to 10 in the input file, 
with each number in a new line. 
It consists of many built‐in functions and toolboxes 
that are commonly required for numerical analysis 2. Load MATLAB and associated toolboxes on your computer. Open the input file in 
MATLAB, and read the input file contents one line at a time by using a recursive loop. 
MATLAB will be extensively used during this course Add the number being read from each line to the sum of numbers already read earlier. 
Special sessions will be organized to help the  At the end of the reading from input file and carrying out summation, save the output in 
students learn MATLAB another file with its name as YourRollNo‐Output.

Both group‐wise and individual assistance will be  3. After completing the program, open the output file and verify that it has the correct 
provided by TAs as required answer.

Learning MATLAB through this course will be a  (This Homework does not need to be submitted on Moodle)
tremendous additional asset to you in the future

CE‐603 Numerical Methods | Autumn Semester 2022‐23 13 CE‐603 Numerical Methods | Autumn Semester 2022‐23 14

Purpose of Numerical Methods Video of Structural Vibrations
To solve complex mathematical problems for particular values of variables that are of  Engineers solve important 
interest. Finding the solutions are greatly simplified by the use of appropriate numerical  problems using numerical 
techniques. Solutions should meet accuracy requirement. techniques.
Examples For example, is the situation 
shown in the video predictable 
(a) Structural vibrations due to an dynamic loads (c) Navier‐Stokes equation and thus preventable?
mx(t )  cx (t )  kx(t )   mxg (t )  4  2
 2 p  1  i  p0
 3  c 2
(b) Plate deformations where,
 4 w 4w 4w 
D  4  2 2 2  4   p ( x, y )  =viscosity of fluid
 x x  y y 
 =bulk modulus of fluid
or, D 4 w  p ( x, y )
c =velocity of sound in fluid

CE‐603 Numerical Methods | Autumn Semester 2022‐23 15 CE‐603 Numerical Methods | Autumn Semester 2022‐23 16
28‐07‐2022

1. Algorithms and Flowcharts 1a. Example ‐ Algorithm


To being solving numerical problems, we need to prepare the step‐by‐step procedure  Algorithm to solve of roots of quadratic equation ax 2  bx  c  0, a  0
required to solve the problem.
Steps: 1. Check to ensure that a  0. If True,
Algorithm – Step‐by‐step procedure to solve a problem
2. t1  b2  4ac   (Introduce a temporary variable)
Flowchart – Graphical/diagrammatic representation of an algorithm 3. Check whether t1  0. If True,
Example: 4. t 2  t1 / 2a   (Introduce a temporary variable)
o Solve the quadratic equation for a given value of real constants
5. t 3  b / 2a   (Introduce a temporary variable)
ax 2  bx  c  0, a  0
6. x1  t 3  t 2
o Solution is given by: 7. x2  t 3  t 2
x
b  b 2  4ac 8. If t1  0 is False, x1  b / 2a is a multiple root (both x1 & x2)
2a 9. If a  0 is False, Equation is not Quadratic and x1  c / b
CE‐603 Numerical Methods | Autumn Semester 2022‐23 17 CE‐603 Numerical Methods | Autumn Semester 2022‐23 18

1b. Example ‐ Flowchart 1b. Example ‐ Flowchart


Read Constants a, b, c Read Constants a, b, c

No Yes No Yes
Is a  0? Is a =0?

t1 = b2 – 4ac t3  b/2a t1 = b2 – 4ac t3 = b/2a


x1 = – c/b x1 = – c/b

No
Is t1 ≠ 0?
Yes Note: No
Is t1 ≠ 0?
Yes Note:
1. Variables must be suitably defined 5. Evaluation of t1 and t3 are parallel branches, 
2. Constants are real‐valued and either can be computed first
t2 = Sqrt[t1]/2a t2 = Sqrt[t1]/2a
3. Roots may be real or complex 6. Flowchart also covers case of linear equation 
4. Intermediate variables may be real or complex (a0)
x1 = – b/2a x1 = – t3 + t2 x1 = – b/2a x1 = – t3 + t2 7. Flowchart also shows control statements
x2 = – t3 – t2 x2 = – t3 – t2

CE‐603 Numerical Methods | Autumn Semester 2022‐23 19 CE‐603 Numerical Methods | Autumn Semester 2022‐23 20
28‐07‐2022

2. Time Required to Solve a Numerical 
1b. Flowchart Control Statements Problem
The time required to solve a numerical problem is a very important parameter. The time 
required generally depends on the following factors:
1. Computer hardware system Critical Applications:
2. Representation of abstract data types (data structure) 1. Defence
2. Security
3. Efficiency of compiler 3. Weather prediction
4. Quality of programming (software code quality) 4. Navigation 
(autonomous vehicle)
5. Complexity of algorithm
etc.
6. Size of inputs/data
For large sized problems, the last two (5 & 6) are generally the most important
(https://www.lucidchart.com)

CE‐603 Numerical Methods | Autumn Semester 2022‐23 21 CE‐603 Numerical Methods | Autumn Semester 2022‐23 22

3. Complexity of Algorithms 3. Complexity of Algorithms
oThe complexity of a particular algorithm is the order of number of numerical operations,  Example 1
required to solve a specific type of problem.
For a particular algorithm, let us say that the number of basic numerical operations for n
oComplexity of an algorithm is a very important property – An important parameter to  unknowns are (they can be counted from the algorithm):
decide whether a problem should be solved using a computer. t ( n)  23n 2  40n log n  105n
oHere, the algorithm is analysed rather than a piece of software code – Number of times 
that the basic numerical operations are performed in the algorithm is considered.  In evaluating complexity of algorithms, we normalize by the coefficient of leading term as:
40 105
t ( n)  n 2  n log n  n
oBasic numerical operations consist of addition, subtraction, multiplication and division.  23 23
o It is assumed that all these operations take equal CPU time. The “Order of Complexity” of an algorithm is the way in which the algorithm is dependent 
on the number of input variables, for very large number of input variables.
oComplexity of algorithms is generally represented as function of the size of the problem, 
i.e., the number of unknowns, n.

CE‐603 Numerical Methods | Autumn Semester 2022‐23 23 CE‐603 Numerical Methods | Autumn Semester 2022‐23 24
28‐07‐2022

3. Complexity of Algorithms 3. Complexity of Algorithms
Example 1 (contd.) Example 2
40 105
Examine the behaviour of terms of t(n) closely: t (n)  n 2  n log n  n It was be discussed later that it takes n3 basic numerical operations to solve a system of n
23 23
[t(n) is shown in blue colour and n2 in red colour, respectively] independent linear equations in n variables when using Gauss elimination
Gauss elimination is therefore O(n3) algorithm

n = {1, 5} n = {1, 20} n = {1, 1000}


The complexity of the algorithm is therefore “Order of n2”, or “Big‐Oh of n2” or “O(n2)”
CE‐603 Numerical Methods | Autumn Semester 2022‐23 25 CE‐603 Numerical Methods | Autumn Semester 2022‐23 26

3. Complexity of Algorithms 3. Complexity of Algorithms
If an algorithm is such that a problem can be solved in O(nk) operations, then it is a  P Time versus NP Time algorithms
Polynomial (P) time algorithm
Example
If the number of operations increase as an exponential or factorial function of n, then it is a 
Non‐Polynomial (NP) time algorithm Let us say, there are 4 algorithms (A, B, C & D) to solve a problem of size n.

Problem Classes: A  O(n), B  O(n3), C  O(2n) & D  O(n!)

1. P Time – These can be solved by using a polynomial algorithm, i.e., an algorithm of order  Algorithms A & B are P Time, while algorithms C & D are NP Time.


nk How much CPU time is required to solve a problem using each algorithm?
Example – Solution of simultaneous equations
Consider two cases: n & n
2. NP Time – These can’t be solved by using a polynomial algorithm
Example – Linear programming problems

CE‐603 Numerical Methods | Autumn Semester 2022‐23 27 CE‐603 Numerical Methods | Autumn Semester 2022‐23 28
28‐07‐2022

3. Complexity of Algorithms Surprise – Agorize Innovation Challenge!


Example (contd.) oExciting semester‐long global challenge to learn 
If each basic numerical operation takes 1x106 s (or 1 s), the number of operations and time  to solve a global problem
required will be as given below.
oWorld‐class mentoring by Bayer
n A  O(n) B  O(n3) C  O(2n) D  O(n!)
oLearn about innovation & teamwork
# Operations 10 1x103 1.024x103 3.63x106
10
Time 1x105 s 1x103 s 1.024x103 s 3.63 s oGet exposure to world‐class methods & systems
# Operations 50 1.25x105 1.13x1015 3.04x1064 oWill be conducted as a in‐class group activity
50 1.13x109 s 3.04x1058 s
Time 5x105 s 1.25x101 s
(35.7 years) (0.96 Million years) oParticipation is voluntary but must be decided 
at the start of the program
Tremendous effort is made to create algorithms that are P Time, and possess lowest possible 
complexity. oMore details will be share during subsequent 
Topics discussed during this course will help to analyse these aspects to take decisions. lectures

CE‐603 Numerical Methods | Autumn Semester 2022‐23 29 CE‐603 Numerical Methods | Autumn Semester 2022‐23 30

Summary of Today’s Discussions Next Lecture
oCourse outline, text books, evaluation system, etc. The next lecture on Monday, August 1, 2022 will be to start getting you acquainted with 
MATLAB
oCourse objectives & outcomes
1. Today, you will receive detailed instructions on how to install MATLAB on your computer. 
oMATLAB introduction
2. You are expected to have installed MATLAB on your systems by Sunday.
oBasic features – Algorithms & Flowcharts
3. In case you face any difficulty during installation on your own, please contact the TAs 
oTime required to solve a problem on a computer and seek their assistance to complete this task by Wednesday. During Thursday’s lecture, 
oComplexity of algorithms all students are expected to have MATLAB installed on their systems.
oAgorize Innovation Challenge

CE‐603 Numerical Methods | Autumn Semester 2022‐23 31 CE‐603 Numerical Methods | Autumn Semester 2022‐23 32
28‐07‐2022

End of Lecture 01

CE‐603 Numerical Methods | Autumn Semester 2022‐23 33

You might also like