Ber - PowerPoint PPT Presentation

1 / 25
About This Presentation
Title:

Ber

Description:

Numeriska ber kningar i Naturvetenskap och Teknik Numerical differentiation and quadrature Discrete differentiation and integration ... – PowerPoint PPT presentation

Number of Views:75
Avg rating:3.0/5.0
Slides: 26
Provided by: joak9
Category:

less

Transcript and Presenter's Notes

Title: Ber


1
Numeriska beräkningar i Naturvetenskap och Teknik
  • Numerical differentiation and quadrature
  • Discrete differentiation and integration
  • --------------------------------------------------
    ----------
  • 2. Ordinary differential equations
  • Eulers method, Runge-Kutta methods
  • --------------------------------------------------
    ----------
  • 3. Systems of differential equations
  • --------------------------------------------------
    ----------
  • 4. Initial value and boundary value problem
  • Shooting method

2
Numeriska beräkningar i Naturvetenskap och Teknik
Derivative ---------------------------------------
-------------------
Taylor expansion around x00 gives
Maclaurin
-------------------------------------------------
---------- f in the points x0h
3
Numeriska beräkningar i Naturvetenskap och Teknik
Derivative with Taylor expansion -----------------
--------------------------------------------

Difference
Derivative in point form
Local error
4
Numeriska beräkningar i Naturvetenskap och Teknik
Forward difference -------------------
------------------------------------------

Local error
Compare to the definition of the derivative
In the same way
5
Numeriska beräkningar i Naturvetenskap och Teknik
Ordinary differential equations
An ordinary differential equation is defined
as
First order
Second order
6
Numeriska beräkningar i Naturvetenskap och Teknik
Eulers method, discrete solution of first order
ordinary diff. equations
Based on the forward difference given above
which gives
7
Numeriska beräkningar i Naturvetenskap och Teknik
Runge-Kutta methods
Start by integrating between step n and n1
Taylor approx of f around the central point n1/2
Integrate
8
Numeriska beräkningar i Naturvetenskap och Teknik
i.e.
9
Numeriska beräkningar i Naturvetenskap och Teknik
Now one needs an estimate of fn1/2 in the
expression
Use Euler!
At half way between points
i.e. with
Runge-Kutta of order 2 is given by
10
Numeriska beräkningar i Naturvetenskap och Teknik
Runge-Kutta of order 2
yn1 to order h3 at the cost of calculating
f(x,y) in two points.
Geometrical picture
y
x
11
Numeriska beräkningar i Naturvetenskap och Teknik
Runge-Kutta error of order 4 gt rk3
12
Numeriska beräkningar i Naturvetenskap och Teknik
Runge-Kutta error of order 5 gt rk4
13
Numeriska beräkningar i Naturvetenskap och Teknik
Exemple solve with Eulers method and RK4 and
study precision
Note that the solution is
possibly another function
14
Numeriska beräkningar i Naturvetenskap och Teknik
Higher order ordinary differential equations
Can be solved as a system of first order
equations by substitution
So, an ordinary differential equation of order n
can be solved numerically by e.g. RK4 as defined
for a first order ordinary differential equation.

15
Numeriska beräkningar i Naturvetenskap och Teknik
Conditions
A differential equation of order n is completely
determined only if n conditions are are given
for the solution. Compare to the simple
differential equation
condition on y
condition on y
Initial value problems
Conditions given for the same value of the
independent variable. An example for the case
above is y(0)2, y(0)0. In classical
mechanics this could e.g. correspond to knowing
the position and velocity at a given time.
16
Numeriska beräkningar i Naturvetenskap och Teknik
On the board
Second example on the board Second order
equation transferred to system.
17
Numeriska beräkningar i Naturvetenskap och Teknik
Boundary value problems
In this case one knows the value of the function
(and/or its derivatives) for different values of
the independent variable. An exemple from physics
is the case of a second order differential
equation
There are several ways of solving this problem
numerically. A simple method is to transfer the
problem to become an initial value problem
and find values for ? that gives solutions that
shoot over or under the boundary value in
point b. The value for? which gives a value for
y(b) within a given accuracy from ßis then
solved for. This method is called the shooting
method. See page 329
18
Numeriska beräkningar i Naturvetenskap och Teknik
Boundary value problem
19
Numeriska beräkningar i Naturvetenskap och Teknik
Boundary value problem
dvs
20
Numeriska beräkningar i Naturvetenskap och Teknik
Boundary value problem
21
Numeriska beräkningar i Naturvetenskap och Teknik
Example, boundary value problem
22
Numeriska beräkningar i Naturvetenskap och Teknik
Quadrature Trapetzoidal rule
Linear interpolation
23
Numeriska beräkningar i Naturvetenskap och Teknik
f1
f0
Trapetzoidal rule
f-1
h
h
Area between x-h and xh
24
Numeriska beräkningar i Naturvetenskap och Teknik
Trapetzoidal rule with error estimate
f1
f0
f-1
h
h
25
Numeriska beräkningar i Naturvetenskap och Teknik
Simpsons rule Approximate by Taylor expansion
f1
f0
Integrated over x gives 0
f-1
h
h
Write a Comment
User Comments (0)
About PowerShow.com