Numeriska berkningar i Naturvetenskap och Teknik - PowerPoint PPT Presentation

1 / 36
About This Presentation
Title:

Numeriska berkningar i Naturvetenskap och Teknik

Description:

Why do the measured values deviate from the mode if the measurement is correct? ... fulfills certain conditions is called a Hilbert space, cmp. quant. mech) ... – PowerPoint PPT presentation

Number of Views:44
Avg rating:3.0/5.0
Slides: 37
Provided by: Joa89
Category:

less

Transcript and Presenter's Notes

Title: Numeriska berkningar i Naturvetenskap och Teknik


1
Numeriska berÀkningar i Naturvetenskap och Teknik
Todays topic
Approximations Least square
method Interpolations Fit of
polynomials Splines
2
Numeriska berÀkningar i Naturvetenskap och Teknik
An exemple
Modell
Why do the measured values deviate from the mode
if the measurement is correct?
3
Numeriska berÀkningar i Naturvetenskap och Teknik
How determine the best straight line?
Model
4
Numeriska berÀkningar i Naturvetenskap och Teknik
Distance between line and measurements points...
5
Numeriska berÀkningar i Naturvetenskap och Teknik
Norm
How to define the distance between the line and
the measurement points?
Largest deviation at minimum
Approximation in maximum norm
Sum of deviations squared as small as possible

Approximation in Euclidian norm
Easier to calculate!
6
Numeriska berÀkningar i Naturvetenskap och Teknik
Matrix formulation An example
More equations than unknowns!
with
7
Numeriska berÀkningar i Naturvetenskap och Teknik
Matrix formulation An exampe
8
Numeriska berÀkningar i Naturvetenskap och Teknik
Matrix formulation An example
9
Numeriska berÀkningar i Naturvetenskap och Teknik
Matrix formulation An example
10
Numeriska berÀkningar i Naturvetenskap och Teknik
General Statement of the Problem
Depending on the model, the measurement data can
of course be described by other expressions than
the straight line.
In general terms one seeks a function f that
approximates fs given values as good as possible
in euclidian norm.
Specifically, above we looked for a solution
expressed as
but we could as well have looked for a solution
given by another function (possibly then for
different data)
etc...
11
Numeriska berÀkningar i Naturvetenskap och Teknik
Generally one can thus write
f(x) is in other words a linear combination of
given functions
Where the coefficients
are sought
One can in accordande with a vector space look at
it so that
Spans a function space (a space of this kind
which fulfills certain conditions is called a
Hilbert space, cmp. quant. mech)
12
Numeriska berÀkningar i Naturvetenskap och Teknik
In the case of the straight line we have
In a geometrical comparision these two functions,
which can be seen as two vectors in the function
space, span a plane U
sought function
vector 0
Approximating function
vector 1
The smallest distance from the plane is given by
a normal. The smallest deviation between f och
f is for f-f orthogonal to the plane U!
13
Numeriska berÀkningar i Naturvetenskap och Teknik
Normal equations
Since we are interested in fitting m measured
values we leave the picture of the continuous
function space and view f(x) as an
m-dimensional vector with values
That should be expressed by
and
For the straight line
14
Numeriska berÀkningar i Naturvetenskap och Teknik
The orthogonality condition now gives the
equations
where
Which gives
the equations for the normal
15
Numeriska berÀkningar i Naturvetenskap och Teknik
The equations for the normal
16
Numeriska berÀkningar i Naturvetenskap och Teknik
Back to the exemple
Model
Data
17
Numeriska berÀkningar i Naturvetenskap och Teknik
Conclusion
Assuming the model
Given data
the minimum of
is orthogonal to the basis vectors
is obtained when
The coefficienterna c1, c2, c3, cn are determined
from
18
Numeriska berÀkningar i Naturvetenskap och Teknik
The equations
or
Where the colomuns in A are
19
Numeriska berÀkningar i Naturvetenskap och Teknik
Note 1
The funcs
Have to be linearly independent
(cmp vectors in a vector space)
Note 2
Assume our problem would have been (x koord -996)
cmp to
20
Numeriska berÀkningar i Naturvetenskap och Teknik
Gauss elimination method
21
Numeriska berÀkningar i Naturvetenskap och Teknik
Gauss elimination method
22
Numeriska berÀkningar i Naturvetenskap och Teknik
Error sources
1. MĂ€tdata, Ef
23
Numeriska berÀkningar i Naturvetenskap och Teknik
Error sources
2. Truncation error
These would be zero for a first degree polynomial
24
Numeriska berÀkningar i Naturvetenskap och Teknik
Interpolation
The approximation to data assumes to pass through
the data points, i.e. one assumes the errors are
small.
Linear interpolation
Alt for equidistant data
25
Numeriska berÀkningar i Naturvetenskap och Teknik
Quadratic interpolation
Ansatz
1
2
3
26
Numeriska berÀkningar i Naturvetenskap och Teknik
Quadratic interpolation
3
27
Numeriska berÀkningar i Naturvetenskap och Teknik
Quadratic interpolation
Newtons ansatz
Uniqueness There is only one polynomial of order
m that passes through m1 points.
28
Numeriska berÀkningar i Naturvetenskap och Teknik
Error interpolation
Linear interpolation
29
Numeriska berÀkningar i Naturvetenskap och Teknik
Exemple
Interpolation of polynomial of order 4,8,16 in
equidistant points
Fit of polynomial of order 6 to 9 equidistant
points
30
Numeriska berÀkningar i Naturvetenskap och Teknik
4th order
8th order
16th order
6th order in 9 points
31
Numeriska berÀkningar i Naturvetenskap och Teknik
Runges phenomenon
Interpolation in equidistant points by a
polynomal of high order tends to reproduce a
curve better in the central parts of the
interval but gives considerable oscillations
close to the end-points of the interval!
Chebychev polynomials and Chebychev abscissa
If one can select the points in which data is
known (this can be hard if the measurement
values are already given ) then the data points
should be closer close to the end-points of the
interval. An optimal choice is given by the zeros
of the Chebychev polynomial of order m which
minimizes the residue above.
32
Numeriska berÀkningar i Naturvetenskap och Teknik
Splines
An alternative is to use a polynomial piece wise
between the points. One can e.g. set the
condition that the functions values, its
derivative and second derivative is equal in the
end points of each short interval for
polynomials that meet in these points. This
approach gives so-called cubic splines. In the
extreme end-points one can e.g. demand the curve
to be straight.
33
Numeriska berÀkningar i Naturvetenskap och Teknik
Cubic splines
Function
Derivative
Second derivative
34
Numeriska berÀkningar i Naturvetenskap och Teknik
Insertion
Function
Derivative
Second derivative
35
Numeriska berÀkningar i Naturvetenskap och Teknik
The condtions
and
give
36
Numeriska berÀkningar i Naturvetenskap och Teknik
the following system in matrix form
Easy to solve! Try out MATLABs spline function on
your own!
Write a Comment
User Comments (0)
About PowerShow.com