0% found this document useful (0 votes)
16 views52 pages

Numerical Analysis

Document about 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 PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views52 pages

Numerical Analysis

Document about 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 PDF, TXT or read online on Scribd
You are on page 1/ 52

Curve Fitting

(1) Linear Equation


(2) Non-Linear Equation
(3) Polynomial Equations
(4) Some Laws
(5) RMSE vs R2

Numerical Analysis
‫‪Curve Fitting‬‬
‫‪Linear Equations‬‬

‫خطوات الحل‪:‬‬
‫(‪ )1‬نوجد قيم ‪a, b‬‬
‫عن طريق حل املعادالتني اآلتيتني آن ًيا‪:‬‬

‫(‪ )2‬نعيد كتابة املعادلة بعد معرفة قيم الـ ‪a, b‬‬

‫(‪ )3‬نحسب الـ )‪Root Mean Square Error (RMSE‬‬

‫(‪ )4‬نحسب الصوة النهائية للمعادلة‬

‫‪Numerical Analysis‬‬
Curve Fitting
Dealing with Non-Linear Equations
(case 1)

(case 2)

Numerical Analysis
Curve Fitting
(case 3)

(case 4)

(case 5)

(case 6)

Numerical Analysis
‫‪Curve Fitting‬‬
‫‪Polynomial Equations‬‬
‫(معادلة من الدرجة التانية)‬

‫نوجد قيم ‪a, b, c‬‬


‫عن طريق عمل ثلثة معادالت‪:‬‬

‫لو معادلة من الدرجة الثالثة يبقى نعمل ‪ 4‬معادالت‬


‫لو معادلة من الدرجة الرابعة يبقى نعمل ‪ 5‬معادالت‬
‫هنحل املعادالت وبعد كده نعرف الـ ‪ a, b‬ونحسب ‪RMSE‬‬

‫‪Numerical Analysis‬‬
Curve Fitting
Some Laws
Arithmetic Mean

Standard Deviation

Variance

Coefficient of determination

Correlation Coefficient

Numerical Analysis
‫‪Curve Fitting‬‬
‫‪RMSE vs R2‬‬
‫كل ما كانت قميته صغرية كل ما كان أفضل )‪(RMSE‬‬
‫ملا تكون قيمته بـ ‪ 1‬كل بيكون املنحيان متوافق مع النقاط )‪(R2‬‬

‫‪R2‬‬
‫الفرق بني الـ ‪ y real‬والـ ‪ y‬اليل طالعة من املعادلة‬

‫‪Numerical Analysis‬‬
Roots of Equation

(1) Bracketing Methods


(2) Open Methods

Youssef Hisham
Roots of Equation
Bracketing Methods
There 3 bracketing methods:
1) Graphical Methods
2) Bisection Method
3) False Position Method

Graphical Methods
x ‫بنشوف نقط تقاطع املنحنى مع محور‬

Bisection Method

False Position Method

Youssef Hisham
Roots of Equation
:False Position‫ و‬Bisection ‫خطوات الحل يف‬
:xU‫ و‬xL ‫) نختار‬1(
f(xU) f(xL) < zero
xr ‫) نحسب‬2(
‫) نحسب‬3(
:‫) نشوف‬4(
If: f(xL) f(xr) < zero
Then: xU = xr

If: f(xL) f(xr) > zero


Then: xL = xr
step 2 ‫) نعود لـ‬5(

Youssef Hisham
Roots of Equation
Open Methods
There 3 open methods:
1) Simple Fixed Method
2) Netwon-Rapson Method
3) Secant Method

Simple Fixed Method

Netwon-Rapson Method

Secant Method

Youssef Hisham
Roots of Equation
:Open Method ‫خطوات الحل يف‬
0 ‫ بـ‬xi ‫) نفرض قيمة‬1(
f(xU) f(xL) < zero
xi+1 ‫) نحسب‬2(
‫) نحسب‬3(

Youssef Hisham
Interpolation

(1) Interpolation
(2) Lagrange Interpolating Polynomial
(3) General form of the Lagrange Interpolating Polynomial
(4) Newton’s Interpolating Polynomials
(5) Divided differences and the coefficients

Youssef Hisham
Interpolation
Interpolation
Interpolation produces a function that matches the given data
exactly.
The function then can be utilized to approximate the data values
at intermediate points.

Interpolation may also be used to produce a smooth graph of a


function for which values are known only at discrete points,
either from measurements or calculations.

✓Given data points


✓Obtain a function, P(x)
✓P(x) goes through the data points
✓Use P(x)
✓To estimate values at intermediate points

Youssef Hisham
Interpolation
Lagrange Interpolating Polynomial

General form of the Lagrange Interpolating


Polynomial

Youssef Hisham
Interpolation
Newton’s Interpolating Polynomials
Newton’s equation of a function that passes through two
points (x0, y0), (x1, y1) is:
P(x) = a0 + a1(x-x0)

Newton’s equation of a function that passes through three


points (x0, y0), (x1, y1), (x2, y2) is:
P(x) = a0 + a1(x-x0) + a2(x-x0)

Newton’s equation of a function that passes through four


points (x0, y0), (x1, y1), (x2, y2) is:
P(x) = a0 + a1(x-x0) + a2(x-x0)(x-x1) + a3(x-x0)(x-x1)(x-x2)

Youssef Hisham
Interpolation
Divided differences and the coefficients

The coefficients of Newton’s interpolating polynomial are:


a0 = f[x0]
a1 = f[x0, x1]
a2 = f[x0, x1, x2]
a3 = f[x0, x1, x2, x3]
a4 = f[x0, x1, x2, x3, x4] and so on

Youssef Hisham
Integral

(1) Integral Law


(2) Special Cases
(3) Integration by Substation
(4) Triangular Functions Integration
(5) Exponential Functions Integration
(6) Logarithmic Integration
(7) Integration by Parts

Youssef Hisham
‫‪Integral‬‬
‫‪Integral Rule‬‬
‫)‪(as n ≠ -1‬‬
‫بنزود عىل األس واحد ونقسم عىل األس الجديد‬

‫مثال ‪1‬‬

‫الحل‬

‫مثال ‪2‬‬

‫الحل‬

‫‪Numerical Analysis‬‬
Integral
(Special Cases)
1- Function multiplied by its derivative
‫بنزود أس الدالة ونقسم عىل األس الجديد‬

3 ‫مثال‬

2- Function with a variable from the first degree


‫بنزود أس الدالة ونقسم عىل األس الجديد ومعامل املتغي‬
4 ‫مثال‬

3- 2 Functions with a variable from the first degree


‫بنزود ونطرح أرقام حتى يتساوا‬
5 ‫مثال‬

Numerical Analysis
Integral
Integration by Substation
:‫خطوات الحل‬
:‫ وذلك أحيانًا حسب‬،‫تعويضا مناس ًبا‬
ً ‫) نختار‬1(
IF: The given equation was
Then: We use the substation

IF: The given equation was


Then: We use the substation

du ‫) نوجد‬2(
‫) نعوض‬3(

Numerical Analysis
Integral
6 ‫مثال‬

‫الحل‬

‫حل آخر‬

Numerical Analysis
Integral
7 ‫مثال‬

‫الحل‬

‫حل آخر‬

Numerical Analysis
Integral
Triangular Functions Integration

Numerical Analysis
Integral
8 ‫مثال‬

‫الحل‬

9 ‫مثال‬

‫الحل‬

Numerical Analysis
Integral
) (

9 ‫مثال‬

‫الحل‬

Numerical Analysis
Integral
Exponential Functions Integration

10 ‫مثال‬

‫الحل‬

11 ‫مثال‬

‫الحل‬

Numerical Analysis
Integral
12 ‫مثال‬

‫الحل‬

) )

13 ‫مثال‬

‫الحل‬

Numerical Analysis
Integral
Logarithmic Integration

14 ‫مثال‬

‫الحل‬

15 ‫مثال‬

‫الحل‬

Numerical Analysis
‫‪Integral‬‬
‫مثال ‪16‬‬

‫الحل‬

‫حل آخر‬

‫الحظ أنه ال يوجد اختالف بني الحلني يف قيمتي الثابتني‬

‫‪Numerical Analysis‬‬
‫‪Integral‬‬
‫‪Integration by Parts‬‬
‫نستخدمه إليجاد تكامل حاصل رضب دالتني ليست أحدهام مشتقة األخرى‬
‫بنشتق دالة ونكامل دالة‬
‫‪u‬‬ ‫‪dv‬‬
‫)‪f(x‬‬ ‫)‪g(x‬‬

‫)‪f\(x‬‬ ‫‪g(x) dx‬‬ ‫ترتيب الدوال التي تشتق‪:‬‬


‫‪ -‬الدالة اللوغاريتمية‬
‫‪ -‬الدالة كثية الحدود‬
‫‪ -‬الدالة األسية‬
‫‪ -‬الدالة املثلثية‬

‫قاعدة عمود التفاضل والتكامل‬


‫عندما تكون الدالة التي سنشتقها دالة كثية حدود‬
‫ف ُيفضل اشتقاقها حتى نصل للصفر ولكن نضيف الثابت يف النهاية‬

‫‪Numerical Analysis‬‬
Integral
17 ‫مثال‬

‫الحل‬
x ex
1 ex

‫حل آخر‬
x ex
1 ex
Zero ex

Numerical Analysis
Integral
18 ‫مثال‬

‫الحل‬
1
x

Numerical Analysis
Integral
19 ‫مثال‬

‫الحل‬
3x+2 sin (x)
3 - cos(x)

20 ‫مثال‬

‫الحل‬
ex cos(x)
ex sin(x)

ex sin(x)
ex - cos(x)

Numerical Analysis
Integral
21 ‫مثال‬

‫الحل‬
x sec2(x)
1 tan(x)

Numerical Analysis
‫‪Integral‬‬
‫)‬ ‫(‬
‫يف التكامل بالتجزئ‪:‬‬
‫دامئًا نفاضل الدالة التي يصعب تكاملها‬

‫مثال ‪22‬‬

‫الحل‬
‫‪x ex‬‬ ‫‪(x+1)-2‬‬
‫‪ex + x ex‬‬ ‫‪-(x+1)-1‬‬
‫)‪= ex(ex + 1‬‬

‫‪Numerical Analysis‬‬
Integral
23 ‫مثال‬

‫الحل‬

tan(x) sec(x) tan(x)


sec2(x) sec(x)

Numerical Analysis
Numerical Integration

(1) Indefinite Integrals & Definite Integrals


(2) Trapezoid Method
(3) Simpson’s Method

Youssef Hisham
Numerical Integration
Indefinite Integrals
Indefinite Integrals of a function are functions that differ from
each other by a constant

Definite Integrals
Definite Integrals are numbers

Youssef Hisham
Numerical Integration
Trapezoid Method

h=∆x

Simpson's Method

Youssef Hisham
Differential Equations

(1) Numerical Solutions


(2) Euler Methods
(3) Runge-Kutta Methods

Youssef Hisham
Differential Equations
Numerical Solutions
Numerical methods are used to obtain a graph or a table of the
unknown function.

Most of the Numerical methods used to solve ODE are based


directly (or indirectly) on truncated Taylor series expansion

The Numerical Solutions are:


- Euler Methods
- Runge-Kutta Methods

Youssef Hisham
Differential Equations
Euler Methods

Runge-Kutta Methods (Motivation)


2nd Order Runge-Kutta

3rd Order Runge-Kutta

Youssef Hisham
Differential Equations
4th Order Runge-Kutta

Youssef Hisham
LU Decomposition

(1) LU Decomposition (Factorization)


(2) Using the LU Decomposition to solve the system of
equations

Numerical Analysis
LU Decomposition
LU Decomposition

(Finding the Upper Matrix)


:‫الخطوات‬

(Finding The Lower Matrix)

Numerical Analysis
LU Decomposition
Solving Equations

:‫نحل املعادالت اليل بالعالقة‬

Numerical Analysis
LU Decomposition
(Forward Substation)

(Backward Substation)

Numerical Analysis
Eigen Values & Eigen Vectors

(1) Finding Eigen Values


(2) Finding Eigen Vectors
(3) Special Cases

Youssef Hisham
Eigen Values & Eigen Vectors
Finding Eigen Values
To find the eigen vectors, we solve the following characteristic
equation:

: Eigen Value

Finding Eigen Vectors


To find the eigen vectors, we compute the non-trivial solution to
the homogeneous linear system:

: Eigen Vector

Special Cases
(1) Transpose of Matrix
(2) Inverse of Matrix
(3) Power of Matrix
(4) Diagonal Matrix

Youssef Hisham
Eigen Values & Eigen Vectors
Transpose of Matrix
AT: has the same eigen values as A
AT: has different eigen vectors than A

Inverse of Matrix
If: A has 𝜆1 , 𝜆2 , 𝜆3 , ……
Then: A-1 has 𝜆1 , 𝜆1 , 𝜆1 , ……
1 2 3

A-1 has the same eigen vectors as A

Power of Matrix
If: A has 𝜆1 , 𝜆2 , 𝜆3 , ……
Then: An has 𝜆1 𝑛 , 𝜆2 𝑛 , 𝜆3 𝑛 , ……
An has the same eigen vectors as A

Youssef Hisham
‫‪Eigen Values & Eigen Vectors‬‬
‫‪Diagonal Matrix‬‬
‫قيم 𝜆 = قيم عنارص القطر الرئييس‬
‫‪Triangular Matrix‬‬
‫قيم 𝜆 = قيم عنارص القطر الرئييس‬

‫(‪)Note‬‬
‫إذا تواجد العنرص صفر يف عنارص القطر الرئييس فال توجد قيم مميزة‬

‫‪Youssef Hisham‬‬

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy