Lecture 06-20220813
Lecture 06-20220813
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
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
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 ) mxg (t ) 4 2
2 p 1 i p0
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
No Yes No Yes
Is a 0? Is a =0?
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 (a0)
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
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.
CE‐603 Numerical Methods | Autumn Semester 2022‐23 27 CE‐603 Numerical Methods | Autumn Semester 2022‐23 28
28‐07‐2022
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