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

Numerical Analysis

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views

Numerical Analysis

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 15

Numerical Applications

• Numerical Integration
• Numerical Differentiation
• Systems of Linear Equations
Announcements
• Lab 4 - 29-31 May 2024
• Test 2- 3 June 2024
• Project- 6&7 June 2024
• Course Evaluation on elearning.
Numerical Integration

Integration: calculation of area under


function
• apply trapezoid rule to get area of
each interval
• if n+1 points xj are given, n areas are
calculated

Kong Q., Siauw T., Bayen A.M., Python Programming and Numerical Methods, Elsevier Academic Press, (2021).
Example 1: Numerical
Integration
The following measurements are taken from the speedometer of a car
that is moving forward through a city. How far has the car traveled at
each point in time?
time 0 1 2 3 4 5 6 7 8 9 10
[min]
speed 0 10 50 30 0 10 50 30 40 20 0
[km/h]
Example 2: Numerical
Integration

Determine the area


underneath the Gaussian
distribution with mean of 0
and variance of 1

Wikipedia: https://en.wikipedia.org/wiki/Normal_distribution
Numerical Differentiation
Differentiation: calculating the slope of a function (rate of change)

Kong Q., Siauw T., Bayen A.M., Python Programming and Numerical Methods, Elsevier Academic Press, (2021).
Example 1: Numerical
Differentiation
The following measurements show distance traveled as a function of time.
Determine the speed.

time 0 1 2 3 4 5 6 7 8 9 10
[min]
distance 0 0.1 0.3 0.35 0.35 0.5 0.7 1 1.05 1.1 1.2
[km]
Example 2: Numerical
Differentiation
Determine the derivatives of the following functions:
• f1(x) = cos(x)
• f2(x) = exp(-x)
• f3(x) = 1/(x+1)
Systems of Linear Equations
System of Linear Equations:

Matrix Form:

Kong Q., Siauw T., Bayen A.M., Python Programming and Numerical Methods, Elsevier Academic Press, (2021).
Example 1:
• Check if unique solution exists:
• determinant of A must not be zero

• Calculate A-1, the inverse matrix of A

• Multiply equation with A-1 from left to


obtain x
Ax=y
A-1 A x = A-1 y = x • Test result by calculating A x
Numerical Applications in Python
• Module: scipy, sympy
• Case 1, Symbolic case
• Know the function eg, f(x)= sin(x)
• Case 2: Numerical case
• Area under the graph with cummulative trapezoid method
• Modules: MAtplot
Numerical Applications in Matlab
• Trapz method
• For loop
References
• Kong Q., Siauw T., Bayen A.M., Python Programming and Numerical
Methods:
• Chapter 14: Linear Algebra and Systems of Linear Equations
• Chapter 20: Numerical Differentiation
• Chapter 21: Numerical Integration

• MATLAB Documentation: https://www.mathworks.com/help/matlab/

You might also like