• No results found

L¨ arare: Ove Edlund

N/A
N/A
Protected

Academic year: 2021

Share "L¨ arare: Ove Edlund"

Copied!
4
0
0

Loading.... (view fulltext now)

Full text

(1)

Tentamen i Numerik Amneskod ¨ MAM208 Tentamensdatum 2007-03-12

Totala antalet uppgifter: 5 Skrivtid 09.00 – 14.00

L¨ arare: Ove Edlund

Jourhavande l¨ arare: Ove Edlund Tel: 070-2828661

Resultatet meddelas: p˚ a studentportalen. P˚ a www.ltu.se/atorget ansl˚ as n¨ ar den r¨ attade skrivningen kan h¨ amtas ut.

Till˚ atna hj¨ alpmedel: Minir¨ aknare, Beta

Till alla uppgifterna ska fullst¨ andiga l¨ osningar l¨ amnas. Resonemang, inf¨ orda beteckningar och utr¨ akningar f˚ ar inte vara s˚ a knapph¨ andigt presenterade att de blir sv˚ ara att f¨ olja. ¨ Aven endast delvis l¨ osta problem kan ge po¨ ang.

Enbart svar ger 0 po¨ ang.

Institutionen f¨ or matematik

1 (3)

(2)

1 (a) Best¨ am en mistakvadratapproximation till det

¨ overbest¨ amda ekvationssystemet

1 2 3

1 2 2

1 −1 0 1 −1 1

 β 1 β 2 β 3

 =

 2 3 2 5

Utnyttja att matrisen har QR-faktorisering

Q = 1 2

1 1 1 1

1 1 −1 −1 1 −1 −1 1 1 −1 1 −1

 R =

 2 1 3 0 3 2 0 0 1 0 0 0

Observera att denna QR-faktorisering inte ¨ ar

”economy size”, utan har en ortogonal Q. (3 p) (b) Bevisa formeln f¨ or minstakvadratapproximatio- nen med QR, som du anv¨ ande ovan. (3 p)

(a) Find a least-squares approximation for the over-determined system om equations

1 2 3

1 2 2

1 −1 0 1 −1 1

 β 1 β 2 β 3

 =

 2 3 2 5

Make use of the QR-factorization of the matrix

Q = 1 2

1 1 1 1

1 1 −1 −1 1 −1 −1 1 1 −1 1 −1

 R =

 2 1 3 0 3 2 0 0 1 0 0 0

Note that this QR-factorization is not economy size, but rather has an orthogonal Q. (3 p) (b) Prove the formula for least-squares approxima- tion using QR, that you used above. (3 p)

2 (a) B˚ ade Newtons metod och IQI ber¨ aknar en l¨ osning till f (x) = 0. Beskriv principerna som de b˚ ada metoderna anv¨ ander f¨ or att ta ett ite-

rationssteg. (4 p)

(b) Newtons metod har kvadratisk konvergens n¨ ara l¨ osningen. Visa det! (2 p)

(a) Both Newton’s method and IQI calculate a so- lution to f (x) = 0. Describe the principles for an iteration step in the two methods. (4 p) (b) Newton’s method has quadratic convergence close to the solution. Prove this! (2 p)

3 Vi betraktar differentialekvationen y 00 + x y 0 + x 2 y = 1 − x 2

(a) Givet begynnelsevillkoren y(0) = 1, y 0 (0) = 0, beskriv hur du l¨ oser begynnel- sev¨ ardesproblemet numeriskt, t.ex. med Heuns metod, f¨ or att f˚ a en god approximation av y(2). Du beh¨ over inte plocka fram det numeriska v¨ ardet av approximationen. (4 p) (b) Givet randvillkoren y(0) = 1, y(2) = 2, be- skriv hur du l¨ oser randv¨ ardesproblemet nume- riskt med finitadifferensapproximation. Struk- turen hos matrisen ska framg˚ a av l¨ osningen.

D¨ aremot beh¨ over du inte plocka fram det nu- meriska v¨ ardet av l¨ osningen. (4 p)

We consider the differential equation y 00 + x y 0 + x 2 y = 1 − x 2

(a) Granted the intitial value conditions y(0) = 1, y 0 (0) = 0, describe how you solve the initial value problem (IVP) numerically, for example with Heuns method, to get a good approxima- tion of y(2). You do not need to find the nume- rical value of the approximation. (4 p) (b) Granted the boundary value conditions y(0) = 1, y(2) = 2, describe how to solve the bounda- ry value problem numerically, using finite dif- ference approximations. The structure of the matrix should be given as a part of your so- lution. But you do not need to calculate the

numerical solution. (4 p)

2 (3)

(3)

4 (a) Approximera integralen

2

Z

0

x 2 e −x

2

dx

med en fempunkters, respektive trepunkters

Simpsons formel. (3 p)

(b) Simpsons formel har ett fel med ord- ningstal O(h 4 ). F¨ orb¨ attra ordningstalet p˚ a ber¨ akningen i (a) genom att anv¨ anda Richardson-extrapolation p˚ a resultaten i (a).

(2 p)

(a) Approximate the integral

2

Z

0

x 2 e −x

2

dx

with a five point, and a three point Simpson’s

formula. (3 p)

(b) Simpson’s formula has an error of order O(h 4 ).

Improve the order of the calculations in (a) by using Richardson extrapolation on the results

in (a). (2 p)

5 Skriv en Matlab-funktion som evaluerar polynom mha Horners regel. Fundera sj¨ alv p˚ a l¨ ampliga in-

resp. ut-parametrar. (5 p)

Write a Matlab-function that evaluates polynomials using Horners rule. Figure out suitable input- and

output-parameters. (5 p)

3 (3)

(4)

Answers to exam : MAM208 – 2007-03-12

1. (a)

 β 1 β 2

β 3

 =

 2

−1 1

(b) See lecture notes and answers to other old exams.

2. (a) Newton’s method makes a linear approximation throught the current iteration point, and chooses the next iteration point as the zero of this linear approxi- mation.

IQI fits a degree 2 polynomial throught the last three iteration points, using

”x” as a function of ”y”. The next iteration point is chosen as the zero of this polynomial. I.e. the x that you get by evaluating the polynomial at y = 0.

(b) See lecture notes.

3. (a) The system is described by y(x) =  y 1 (x) y 2 (x)



, y 0 (x) = f (x, y(x)), f (x, y(x)) =

 y 2

1 − x y 2 − x 2 (1 + y 1 )



, y(0) =  1 0



How to use this with e.g. Heuns metod to solve the problem is described in the course book, in the lecture notes, and in the solution of other old exams.

(b)

−4 + 2h 2 x 2 1 2 + hx 1

2 − hx 2 −4 + 2h 2 x 2 2 2 + hx 2

2 − hx 3 −4 + 2h 2 x 2 3 2 + hx 3

. . . . . . . . . 2 − hx n −4 + 2h 2 x 2 n

 y 1

y 2

y 3 .. . y n

=

2h 2 (1 − x 2 1 ) − (2 − h 1) 2h 2 (1 − x 2 2 )

2h 2 (1 − x 2 3 ) .. .

2h 2 (1 − x 2 n ) − (2 + h 2)

4. (a) Five point (h = 0.5) : S 0.5 = 0.422736 Three point (h = 1) : S 1 = 0.514927 (b) 0.416590

5. function y = evalpoly(p, x) y = p(1);

for k = 2:length(p) y = p(k) + x.*y;

end

References

Related documents

empirical context as well as locating the lacuna that this study is attempting to fill. This is split into three smaller sections. The first is the theoretical foundation

This thesis is primarily based on the paper Thinking Fast and Slow with Deep Learning and Tree Search wherein Anthony, Tian, and Barber [3] present both the framework Expert

This project within the textile design field explores the textile technique embroidery. By using design methods based on words and actions the technique was used in another

Resonemang, inf¨ orda beteckningar och utr¨ akningar f˚ ar inte vara s˚ a knapph¨ andigt presenterade att de blir sv˚ ara att f¨ olja.. ¨ Aven endast delvis l¨ osta problem kan

Resonemang, inf¨ orda beteckningar och utr¨ akningar f˚ ar inte vara s˚ a knapph¨ andigt presenterade att de blir sv˚ ara att f¨ olja.. ¨ Aven endast delvis l¨ osta problem kan

A program has been developed which uses our algorithm to solve a com pletely genera l nonlinear discrete time optimal control problem. Both problems that are

According to the asset market model, “the exchange rate between two currencies represents the price that just balances the relative supplies of, and demands for assets denominated

This property i s siutated in the San Juan region, Ouray County, Colorado, about seven miles from Ouray in a southwesterly direction on the southeast slope of