Last name Department Computer Name Legi No. Date Total. Always keep your Legi visible on the table.

Size: px
Start display at page:

Download "Last name Department Computer Name Legi No. Date Total. Always keep your Legi visible on the table."

Transcription

1 First name Last name Department Computer Name Legi No. Date Total Grade Fill in this cover sheet first. Always keep your Legi visible on the table. Keep your phones, tablets and computers turned off in your bag. Start each handwritten problem on a new sheet. Put your name on each sheet. Do not write with red/green/pencil. Write your solutions clearly and work carefully. Write all your solutions only in the folder results! Any other location will not be backed-up and will be discarded. Files in resources may be overridden at any time. Make sure to regularly save your solutions. Time spent on restroom breaks is considered examination time. Never turn off or log off from your computer!

2

3 Final exam Numerical Methods for CSE R. Hiptmair, G. Alberti, F. Leonardi February 2, 2016 A CMake file is provided with the templates. To generate a Makefile for all problems, type cmake. in the folder ~/results. Compile your programs with make. For example, in order to compile and run the C++ code related to Problem 3, type cmake., then make (or make problem3 to compile only problem3.cpp) and finally./problem3. If you want to manually compile your code, use: 1 g++ s t d =c ++11 I / u s r / i n c l u d e / e i g e n 3 Wno d e p r e c a t e d d e c l a r a t i o n s f i l e n a m e. cpp o programname or 1 c l a n g ++ s t d =c ++11 I / u s r / i n c l u d e / e i g e n 3 Wno d e p r e c a t e d d e c l a r a t i o n s f i l e n a m e. cpp o programname The flag -Wno-deprecated-declarations suppresses some EIGEN warning. For each problem requiring C++ implementation, a template file named problemx.cpp is provided. For your own convenience, there is a marker TODO in the places where you are supposed to write your own code. 1

4 Problem 1 Complex roots (16 pts.) Given a complex number w = u + iv, u, v R with v 0, its root w = x + iy can be defined by x = ( u 2 + v 2 + u)/2, (1) y = ( u 2 + v 2 u)/2. (2) (1a) For what w C will the direct implementation of (1) and (2) be vulnerable to cancellation? Solution: As u/v or when v = 0 and u < 0, we have u 2 + v 2 u, and so cancellations may arise in u 2 + v 2 + u. Therefore, the implementation of x will be vulnerable to cancellation. Similarly, as u/v + or when v = 0 and u > 0, we have u 2 + v 2 u, and so cancellations may arise in u 2 + v 2 u. Therefore, the implementation of y will be vulnerable to cancellation. In conclusion, the implementation of these formulas will be vulnerable to cancellation when u is much bigger than v. (1b) Compute xy as an expression of u and v. Solution: An immediate calculation shows that xy = v/2. (1c) Implement a function 1 s t d : : complex <double > myroot ( s t d : : complex <double > w ) ; that computes the root of w as given by (1) and (2) without the risk of cancellation. You may use only real arithmetic: for instance, you may not apply the function sqrt with complex arguments. Test your implementation with w = i and with w = i. DEPENDS ON: subproblems (1a) and (1b). Solution: See implementation in problem1_solution.cpp and below. 1 # i n c l u d e < i o s t r e a m > 2 # i n c l u d e <complex > 3 # i n c l u d e <cmath > 4 5 //! \brief Compute complex root 2

5 6 //! \param[in] w complex number with non negative imaginary parts 7 //! \return the square root of w with non negative real and imaginary parts 8 s t d : : complex <double > myroot ( s t d : : complex <double > w ) { 9 double x, y ; 10 double u = w. r e a l ( ) ; 11 double v = w. imag ( ) ; // TODO: problem 1c: construct x and y as functions of u and v i f ( v ==0) return s q r t ( u ) ; i f ( u > 0) { 18 x = s q r t ( ( s q r t ( u*u+v*v ) +u ) / 2. ) ; 19 y = v / (2 *x ) ; 20 } e l s e { 21 y = s q r t ( ( s q r t ( u*u+v*v ) u ) / 2. ) ; 22 x = v / (2 *y ) ; 23 } return s t d : : complex <double > ( x, y ) ; 26 } // Test the implementation 29 i n t main ( ) { 30 s t d : : c o u t << " *** PROBLEM 1, t e s t i n g : " << s t d : : e n d l ; s t d : : complex <double > w(1 e 2 0, 5 ) ; 33 s t d : : c o u t << " The s q u a r e r o o t of " << w << " i s " << myroot (w) << s t d : : e n d l ; 34 s t d : : c o u t << " The c o r r e c t s q u a r e r o o t of " << w << " i s " << s q r t (w) << s t d : : e n d l << s t d : : e n d l ; w= s t d : : complex <double >( 5, 1 e 2 0 ) ; 37 s t d : : c o u t << " The s q u a r e r o o t of " << w << " i s " << myroot (w) << s t d : : e n d l ; 38 s t d : : c o u t << " The c o r r e c t s q u a r e r o o t of " << w << " i s " << s q r t (w) << s t d : : e n d l << s t d : : e n d l ; 39 } 3

6 Problem 2 Ellpack sparse matrix format (24 pts.) The following class (EllpackMat in file problem2.cpp) implements the Ellpack sparse matrix format for a generic matrix A R m,n : 1 using T r i p l e t = Eigen : : T r i p l e t <double >; 2 using T r i p l e t s = s t d : : v e c t o r < T r i p l e t >; 3 using V e c t o r = Eigen : : VectorXd ; 4 using i n d e x _ t = s t d : : s i z e _ t ; 5 6 c l a s s EllpackMat { 7 p u b l i c : 8 EllpackMat ( c o n s t T r i p l e t s & t r i p l e t s, i n d e x _ t m, i n d e x _ t n ) ; 9 10 double operator ( ) ( i n d e x _ t i, i n d e x _ t j ) c o n s t ; void mvmult ( c o n s t V e c tor &x, V ector &y ) c o n s t ; 13 void mtvmult ( c o n s t V ector &x, V ector &y ) c o n s t ; 14 p r i v a t e : 15 s t d : : v e c t o r <double > v a l ; 16 s t d : : v e c t o r < i n d e x _ t > c o l ; i n d e x _ t maxcols ; // Max nnz elements per row 19 i n d e x _ t m,n ; // Number of rows, number of columns 20 } ; Here, maxcols = max{#{(i, j) A i,j 0, j = 1,..., n} i = 1,..., m}. The access operator operator() is implemented as follows: 1 double EllpackMat : : operator ( ) ( i n d e x _ t i, i n d e x _ t j ) c o n s t { 2 a s s e r t (0 <= i && i < m && 0 <= j && j < n 3 && " Index o u t of bounds! " ) ; 4 5 f o r ( i n d e x _ t l = i * m a x c o l s ; l < ( i +1) *maxcols ; ++ l ) { 6 i f ( c o l [ l ] == j ) return v a l [ l ] ; 7 } 8 return 0. ; 4

7 9 } and is well defined for i from 0 to m-1 and for j from 0 to n-1. (2a) Implement an efficient constructor that builds an object of type EllpackMat from the data forming a matrix in triplet format, i.e. implement the constructor with signature 1 EllpackMat ( c o n s t T r i p l e t s & t r i p l e t s, i n d e x _ t m, i n d e x _ t n ) ; where triplets is a std::vector of EIGEN triplets. The arguments m and n represent the number of rows and of columns of the matrix A, respectively. The data in the triplets vector must be compatible with the matrix size provided to the constructor. No assumption is made on the ordering of the triplets. Values belonging to multiple occurrences of index pairs are to be summed up. However, in this sub-problem you may assume that duplicate index pairs do not occur in the triplets vector. HINT: An object of Eigen::Triplets<double> type is a structure representing a triplet (r, c, v). It provides the methods index_t row(), index_t col() and double value() which return r, c and v, respectively. HINT: As first thing, you will have to determine the quantity maxcols. Solution: See implementation in problem2_solution.cpp. (2b) Implement an efficient method 1 void mvmult ( c o n s t V e c t o r &x, V ector &y ) c o n s t ; that, given an input n-vector x and an output m-vector y as arguments, returns the matrixvector product A*x in y, where A is the matrix represented by *this. The implementation must deliver optimal complexity of O(nnz(A)). Solution: See implementation in problem2_solution.cpp. (2c) Implement an efficient method 1 void mtvmult ( c o n s t V e c t o r &x, V ector &y ) c o n s t ; that, given an input m-vector x and an output n-vector y as arguments, returns the matrixvector product A *x in y, where A is the transposed of the matrix represented by *this. The implementation must deliver optimal complexity of O(nnz(A)). Solution: See implementation in problem2_solution.cpp. 5

8 HINT: You can test your implementations of (2a), (2b) and (2c) using the code written in main(). A 3 6 EIGEN-Sparse matrix A (Eigen::SparseMatrix<double> A) is built from the triplets: {(1, 2, 4), (0, 0, 5), (1, 2, 6), (2, 5, 7), (0, 4, 8), (1, 3, 9), (2, 2, 10), (2, 1, 11), (1, 0, 12)}. An equivalent matrix E of Ellpack type is also built. We then use the vectors x = [4, 5, 6, 7, 8, 9], y = [1, 2, 3] and compute the product Ax and Ex. Finally we output the l 2 norm of the difference. We do the same for A y and E y. Solution: 1 # i n c l u d e < i o s t r e a m > 2 3 # i n c l u d e < v e c t o r > 4 5 # i n c l u d e < Eigen/Dense > 6 # i n c l u d e < E i g e n / S p a r s e > 7 8 using T r i p l e t = Eigen : : T r i p l e t <double >; 9 using T r i p l e t s = s t d : : v e c t o r < T r i p l e t >; 10 using V e c t o r = Eigen : : VectorXd ; 11 using i n d e x _ t = s t d : : p t r d i f f _ t ; //! \brief Class representing a sparse matrix in Ellpack format 14 c l a s s EllpackMat { 15 p u b l i c : EllpackMat ( c o n s t T r i p l e t s & t r i p l e t s, i n d e x _ t m, i n d e x _ t n ) ; double operator ( ) ( i n d e x _ t i, i n d e x _ t j ) c o n s t ; void mvmult ( c o n s t V ector &x, V ector &y ) c o n s t ; void mtvmult ( c o n s t V ector &x, V ector &y ) c o n s t ; 24 p r i v a t e : 25 s t d : : v e c t o r <double > v a l ; //!< Vector containing value corresponding to entry in col 26 s t d : : v e c t o r < i n d e x _ t > c o l ; //! Vector containing columns, partitioned into same-size rows 27 6

9 28 i n d e x _ t maxcols ; // Max elements per row 29 i n d e x _ t m,n ; // Number of rows, number of columns 30 } ; //! \brief Construct a matrix Ellpack from triplet format 33 //! \param[in] triplets vector of Eigen::Triplets 34 //! \param[in] m rows of matrix 35 //! \param[in] n columns of matrix 36 //! \param[in] maxcols max. number of nonzeros of the matrix 37 EllpackMat : : EllpackMat ( c o n s t T r i p l e t s & t r i p l e t s, i n d e x _ t m, i n d e x _ t n ) 38 : m(m), n ( n ) { 39 // TODO: problem2a: implement constructor building matrix from Eigen Triplet format // Find maxcols, counters denotes number of non-empty columns for each row (assuming all triplets uniquely 42 // define one entry) 43 s t d : : v e c t o r < unsigned i n t > c o u n t e r s (m) ; 44 // Fill counter with 0 45 s t d : : f i l l ( c o u n t e r s. b e g i n ( ), c o u n t e r s. end ( ), 0) ; 46 // maxcols starts with no entry for each row 47 maxcols = 0 ; 48 // Loop over each triplet and increment corresponding counter, update maximum if needed 49 f o r ( c o n s t T r i p l e t& t r : t r i p l e t s ) { 50 i f ( ++ c o u n t e r s [ t r. row ( ) ] > maxcols ) maxcols = c o u n t e r s [ t r. row ( ) ] ; 51 } 52 s t d : : c o u t << " Maxcols : " << maxcols << s t d : : e n d l ; // Reserve space 55 c o l. r e s i z e ( m*maxcols, 1) ; 56 v a l. r e s i z e ( m*maxcols,0 ) ; // Loop over each triplet, then find a column where to put the value 59 f o r ( c o n s t T r i p l e t& t r : t r i p l e t s ) { 60 a s s e r t (0 <= t r. row ( ) && t r. row ( ) < m && 0 <= t r. c o l ( ) && t r. c o l ( ) < n && 61 " Index o u t of bounds! " ) ; 7

10 62 63 i n d e x _ t l ; 64 f o r ( l = t r. row ( ) *maxcols ; l < ( t r. row ( ) +1) *maxcols ; ++ l ) { 65 // If value must be added to existing one 66 i f ( c o l [ l ] == t r. c o l ( ) ) { 67 v a l [ l ] += t r. v a l u e ( ) ; 68 break ; 69 // If value is new (find the next empty place) 70 } e l s e i f ( c o l [ l ] == 1 ) { 71 c o l [ l ] = t r. c o l ( ) ; 72 v a l [ l ] = t r. v a l u e ( ) ; 73 break ; 74 } 75 } 76 a s s e r t ( l < ( t r. row ( ) +1) *maxcols && 77 "You d i d n o t r e s e r v e enough columns! " ) ; 78 } 79 } //! \brief Retrieve value of entry at index (i,j) 82 //! \param[in] i row index i 83 //! \param[in] j column index j 84 //! \return value at (i,j) 85 double EllpackMat : : operator ( ) ( i n d e x _ t i, i n d e x _ t j ) c o n s t { 86 a s s e r t (0 <= i && i < m && 0 <= j && j < n && " Index o u t of bounds! " ) ; f o r ( i n d e x _ t l = i * m a x c o l s ; l < ( i +1) *maxcols ; ++ l ) { 89 i f ( c o l [ l ] == j ) return v a l [ l ] ; 90 } 91 return 0. ; 92 } //! \brief Computes (*this)*x 95 //! \param[in] x vector x for mat-vec mult 96 //! \param[out] y result y = (*this)*x 97 void EllpackMat : : mvmult ( c o n s t V ector &x, V ector &y ) c o n s t { 98 a s s e r t ( x. s i z e ( ) == n && " I n c o m p a t i b l e v e c t o r x s i z e! " ) ; 99 a s s e r t ( y. s i z e ( ) == m && " I n c o m p a t i b l e v e c t o r y s i z e! " ) ; 100 8

11 101 // TODO: problem 2b: implement operation y = this*x f o r ( i n d e x _ t i = 0 ; i < m; ++ i ) { 104 y ( i ) = 0 ; 105 f o r ( i n d e x _ t l = i * m a x c o l s ; l < ( i +1) *maxcols ; ++ l ) { 106 i f ( c o l [ l ] == 1 ) break ; 107 y ( i ) += x ( c o l [ l ] ) * v a l [ l ] ; 108 } 109 } 110 } //! \brief Computes (*this) *x, A is transposed 113 //! \param[in] x vector x for mat-vec mult 114 //! \param[out] y result y = (*this) *x 115 void EllpackMat : : mtvmult ( c o n s t V ector &x, V ector &y ) c o n s t { 116 a s s e r t ( x. s i z e ( ) == m && " I n c o m p a t i b l e v e c t o r x s i z e! " ) ; 117 a s s e r t ( y. s i z e ( ) == n && " I n c o m p a t i b l e v e c t o r y s i z e! " ) ; // TODO: problem 2c: implement operation y = this^t*x y = V e c t o r : : Zero ( n ) ; 122 f o r ( i n d e x _ t i = 0 ; i < m; ++ i ) { 123 f o r ( i n d e x _ t l = i * m a x c o l s ; l < ( i +1) *maxcols ; ++ l ) { 124 i f ( c o l [ l ] == 1 ) break ; 125 y ( c o l [ l ] ) += x ( i ) * v a l [ l ] ; 126 } 127 } 128 } i n t main ( i n t, c h a r * * ) { 131 // Vector of triplets 132 T r i p l e t s t r i p l e t s ; // Data 135 unsigned i n t m = 3, n = 6 ; 136 unsigned i n t n t r i p l e t s = 9 ; // Reserve space for triplets 139 t r i p l e t s. r e s e r v e ( n t r i p l e t s ) ; // Fill in some triplet 9

12 142 t r i p l e t s. push_back ( T r i p l e t (1, 2, 4 ) ) ; 143 t r i p l e t s. push_back ( T r i p l e t (0, 0, 5 ) ) ; 144 t r i p l e t s. push_back ( T r i p l e t (1, 2, 6 ) ) ; 145 t r i p l e t s. push_back ( T r i p l e t (2, 5, 7 ) ) ; 146 t r i p l e t s. push_back ( T r i p l e t (0, 4, 8 ) ) ; 147 t r i p l e t s. push_back ( T r i p l e t (1, 3, 9 ) ) ; 148 t r i p l e t s. push_back ( T r i p l e t (2, 2, 1 0 ) ) ; 149 t r i p l e t s. push_back ( T r i p l e t (2, 1, 1 1 ) ) ; 150 t r i p l e t s. push_back ( T r i p l e t (1, 0, 1 2 ) ) ; // Build matrix (Eigen Sparse) 153 Eigen : : S p a r s e M a t r i x <double > S ( m,n ) ; 154 S. s e t F r o m T r i p l e t s ( t r i p l e t s. b e g i n ( ), t r i p l e t s. end ( ) ) ; // Build Ellpack matrix 157 EllpackMat E ( t r i p l e t s, m, n ) ; //// PROBLEM 2 TEST 160 s t d : : c o u t << " *** PROBLEM 2, t e s t i n g : " << s t d : : e n d l ; 161 s t d : : c o u t << " T e s t of y = A^ t * x " << s t d : : e n d l ; 162 Eigen : : VectorXd x ( 6 ) ; 163 x << 4, 5, 6, 7, 8, 9 ; 164 Eigen : : VectorXd Ex = Eigen : : VectorXd : : Zero (m) ; 165 E. mvmult ( x, Ex ) ; 166 s t d : : c o u t << " S p a r s e S*x =" << s t d : : e n d l << S*x << s t d : : e n d l ; 167 s t d : : c o u t << " E l l p a c k E*x =" << s t d : : e n d l << Ex << s t d : : e n d l ; 168 s t d : : c o u t << " T e s t of x = A*y " << s t d : : e n d l ; 169 Eigen : : VectorXd y ( 3 ) ; 170 y << 1, 2, 3 ; 171 Eigen : : VectorXd Ey = Eigen : : VectorXd : : Zero ( n ) ; 172 E. mtvmult ( y, Ey ) ; 173 s t d : : c o u t << " S p a r s e S^T*y =" << s t d : : e n d l << S. t r a n s p o s e ( ) *y << s t d : : e n d l ; 174 s t d : : c o u t << " E l l p a c k E^T*y =" << s t d : : e n d l << Ey << s t d : : e n d l ; 175 } 10

13 Problem 3 Piecewise cubic Hermite interpolation (24 pts.) We are concerned with piecewise cubic Hermite interpolation of given data points (t j, y j ) R 2, j = 0,..., n, n N. Assume that the nodes are ordered, namely t j < t j+1 for every j = 0,..., n 1. The slopes c j = s (t j ), j = 0,..., n of the interpolant s at the points t j are computed from the data according to the formula: 1 for j = 0, c j = minmod( j, j+1 ) for j = 1,..., n 1, n for j = n, (3) where j = y j y j 1 t j t j 1 and 0 if sgn(x) sgn(y), minmod(x, y) = min( x, y ) sgn(x) otherwise, (4) with the sign function given by 1 if x < 0, sgn(x) = 0 if x = 0, 1 if x > 0. (5) (3a) Implement a C++ function: 1 double minmod ( double x, double y ) ; for the computation of the function minmod as defined in (4). Solution: See implementation in problem3_solution.cpp. (3b) Implement a C++ function 1 using V e c t o r = Eigen : : VectorXd ; 2 V ector d e l t a ( c o n s t V e c t o r & t, c o n s t V ector & y ) ; for the computation of the quantities j, j = 1,..., n, from the data (t j, y j ). The arguments t and y pass the t j and y j, j = 0,..., n. The return vector contains the computed values 1,..., n. Solution: See implementation in problem3_solution.cpp. 11

14 (3c) The template file problem3.cpp contains the declaration of a class mmpchi, reproduced here: 1 //! \brief Class representing a piecewise cubic Hermite interpolant s with minmod-reconstructed slopes 2 c l a s s mmpchi { 3 p u b l i c : 4 //! \brief Construct the slopes c j of the interpolant, from the data (t j, y j ). 5 //! \param[in] t Vector of nodes t j, j = 0,..., n 6 //! \param[in] y Vector of values y j, j = 0,..., n 7 mmpchi( c o n s t V e c t o r & t, c o n s t V ector &y ) ; 8 9 //! \brief Evaluate *this interpolant at the points defined by x and store the result in v 10 //! \param[in] x Vector of points x i, i = 0,..., m 11 //! \return v Vector of values s(x i ), i = 0,..., m 12 V e c t o r e v a l ( c o n s t V ector &x ) c o n s t ; p r i v a t e : 15 c o n s t V e c t o r t, y ; //!< Vectors containing nodes and values 16 V e c t o r c ; //!< Vector containing slopes for the interpolant 17 } ; This class implements a piecewise cubic Hermite interpolant using the minmod slope reconstruction (3). Some class member functions still have to be implemented. Implement an efficient constructor 1 mmpchi : : mmpchi( c o n s t V ector & t, c o n s t V ector &y ) ; The function mmpchi is the constructor of the class, in which you should compute the slopes c j according to (3) and store the value in the corresponding class variable. Solution: See implementation in problem3_solution.cpp. (3d) Implement an efficient method: 1 V ector mmpchi : : e v a l ( c o n s t V ector &x ) c o n s t ; The function eval evaluates the interpolant defined by the class at the points in x and returns the values in a vector of the same length as x. No assumption is made on the ordering of x. 12

15 HINT: An efficient implementation may sort x first. To that end, you can use std::sort, in combination with the data() and size() method of the class Vector. Solution: The implementation computes the value of the interpolant using local Hermite polynomial evaluation. See implementation in problem3_solution.cpp. HINT: You can test your implementation using the code written in the main() function of problem3.cpp. The main() function will perform a convergence study applied to the function f(t) = 1, t [ 5, 5]. (6) 1 + t2 (3e) We use the piecewise cubic Hermite interpolation introduced above for function approximation. Consider interpolation error for the functions 1 f 1 (t) =, t [ 5, 5], (7) 1 + t2 1 f 2 (t) =, t [ 5, 5], (8) 1 + t and sequences of n equidistant interpolation nodes ( 5 = t 0 <... < t n 1 = 5) for n = 2 2, 2 3,..., In the following tables, we measure the interpolation error in the L -norm on [ 5, 5], which is approximated by sampling on a grid of M = 100, 000 nodes on [ 5, 5]. One table represents the error for f 1, the other for f 2. Assign each table to the corresponding function and explain the reasons for your choice. Determine the empirical rate of convergence for each table. Table A Table B n error n error e e e

16 Solution: The experimental rate of convergence is polynomial and limited to secondorder (O(h 2 )) in the case of a regular function (i.e. f 1 ) (table A), and limited to firstorder (O(h)) in case of irregular function (i.e. f 2 ) (table B). See the implementation in problem3_solution.cpp. 1 # i n c l u d e < i o s t r e a m > 2 3 # i n c l u d e < v e c t o r > 4 5 # i n c l u d e < Eigen/Dense > 6 7 using V e c t o r = Eigen : : VectorXd ; 8 using M a t r i x = Eigen : : MatrixXd ; 9 10 //! \brief Function for the evaluation of minmod(x,y) 11 double minmod ( double x, double y ) { 12 //// TODO: problem 3a, implement this function return x*y <= 0.? 0. : ( x >= 0.? s t d : : min ( x, y ) : s t d : : max ( x, y ) ) ; 15 } //! \brief Function for the computation of the values j 18 //! \param[in] t Vector of nodes t j, j = 0,..., n 19 //! \param[in] y Vector of values y j, j = 0,..., n 20 //! \return Vector ( 1,..., n ) relative to (t, y) data 21 V ector d e l t a ( c o n s t V e c t o r & t, c o n s t V ector & y ) { 22 a s s e r t ( t. s i z e ( ) == y. s i z e ( ) ) ; 23 a s s e r t ( t. s i z e ( ) > 1) ; //// TODO: problem 3b, implement this function V e c t o r d l t ( t. s i z e ( ) 1) ; f o r ( unsigned i n t j = 0 ; j < t. s i z e ( ) 1; ++ j ) { 30 d l t ( j ) = ( y ( j +1) y ( j ) ) / ( t ( j +1) t ( j ) ) ; 31 } return d l t ; 34 } 14

17 35 36 //! \brief Class representing a pecevise cubic Hermite interpolant s with minmod-reconstructed slopes 37 c l a s s mmpchi { 38 p u b l i c : 39 //! \brief Construct the slopes c j of the interpolant, from the data (t j, y j ). 40 //! \param[in] t Vector of nodes t j, j = 0,..., n 41 //! \param[in] y Vector of values y j, j = 0,..., n 42 mmpchi( c o n s t V e c t o r & t, c o n s t V ector &y ) ; //! \brief Evaluate interpolant defined by (*this) at the points defined by x and store the result in v 45 //! \param[in] x Vector of points x i, i = 0,..., m 46 //! \return v Vector of values s(x i ), i = 0,..., m 47 V e c t o r e v a l ( c o n s t V ector &x ) c o n s t ; 48 p r i v a t e : 49 c o n s t V e c t o r t, y ; //!< Vectors containing nodes and values 50 V e c t o r c ; //!< Vector containing slopes for the interpolant 51 } ; mmpchi : : mmpchi( c o n s t V ector & t, c o n s t V ector &y ) 54 : t ( t ), y ( y ), c ( t. s i z e ( ) ) { a s s e r t ( t. s i z e ( ) == y. s i z e ( ) ) ; 57 a s s e r t ( t. s i z e ( ) > 1) ; //// TODO: problem 3c, implement this function unsigned i n t n = t. s i z e ( ) 1; V e c t o r D = d e l t a ( t, y ) ; // Reconstruct slopes using minmod 66 c ( 0 ) = D( 0 ) ; 67 f o r ( unsigned i n t i = 1 ; i < n ; ++ i ) { c ( i ) = minmod (D( i ), D( i 1) ) ; 70 } 71 c ( n ) = D( n 1) ; 72 } 15

18 73 74 V ector mmpchi : : e v a l ( c o n s t V ector &x ) c o n s t { 75 V e c t o r v ( x. s i z e ( ) ) ; //// TODO: problem 3d, implement this function 78 V e c t o r xcopy = x ; 79 s t d : : s o r t ( xcopy. d a t a ( ), xcopy. d a t a ( ) +xcopy. s i z e ( ) ) ; unsigned i n t i = 0 ; 82 f o r ( unsigned i n t j = 0 ; j < t. s i z e ( ) 1; ++ j ) { 83 double t 1 = t ( j ) ; 84 double t 2 = t ( j +1) ; 85 double y1 = y ( j ) ; double h = t 2 t 1 ; 88 double a1 = y ( j +1) y1 ; 89 double a2 = a1 h*c ( j ) ; 90 double a3 = h*c ( j +1) a1 a2 ; 91 while ( i < xcopy. s i z e ( ) && xcopy ( i ) <= t 2 ) { 92 double t x = ( xcopy ( i ) t 1 ) / h ; 93 v ( i ) = y1 + ( a1 +( a2+ a 3 * t x ) * ( tx 1. ) ) * t x ; 94 i ++; 95 } 96 } return v ; 99 } i n t main ( i n t, c h a r * * ) { 102 //// PROBLEM 3 TEST auto f = [ ] ( double t ) > double { return 1. / ( 1. + t * t ) ; } ; 105 //auto f = [] (double t) -> double { return 1. / (1. + std::abs(t)); }; // Interval 108 c o n s t double a = 5., b = 5 ; 109 // Number of sampling nodes 110 c o n s t unsigned i n t M = 10000;

19 112 // Sampling nodes and values 113 c o n s t V e c t o r x = V ector : : LinSpaced ( M,a,b ) ; 114 V e c t o r v_ex (M) ; 115 // Fill in exact values of f 116 f o r ( unsigned i n t i = 0 ; i <M; ++ i ) { 117 v_ex ( i ) = f ( x ( i ) ) ; 118 } 119 // Output table with error w.r.t number of nodes 120 s t d : : c o u t << " n " << " \ t " << "L^ i n f e r r. " << s t d : : e n d l ; 121 f o r ( unsigned i n t n = 4 ; n <= 2048; n=n < <1) { 122 V e c t o r t = V e c t o r : : LinSpaced ( n, a, b ) ; 123 V e c t o r y ( n ) ; 124 f o r ( unsigned i n t i = 0 ; i <n ; ++ i ) { 125 y ( i ) = f ( t ( i ) ) ; 126 } mmpchi s ( t, y ) ; 129 c o n s t V e c t o r v = s. e v a l ( x ) ; 130 s t d : : c o u t << n << " \ t \ t " << ( v v_ex ). lpnorm < Eigen : : I n f i n i t y > ( ) << s t d : : e n d l ; 131 } } Problem 4 Quadrature by transformation (16 pts.) For f C([0, 2]) define I(f) = t f(t) dt. t (4a) For n N, derive a family of 2n-point quadrature formulas Q n (f) = 2n j=1 w n j f(c n j ), f C([0, 2]) for which Q n (f) converges to I(f) exponentially as n, if f has an analytic extension to a complex neighborhood of [0, 2]. Solution: We wish to transform the integral in I(f) into an integral of a smooth function 17

20 over a bounded interval. In order to this, write 1 2 t I(f) = f(t) dt + 0 t t f(t) dt. t Performing the substitutions s = t in the first integral and s = 2 t in the second integral we obtain I(f) = s2 f(s 2 ) ds s 2 2 s 2 f(2 s2 ) ds = f 1 (s) ds f 2 (s) ds where f 1 (s) = 2 s 2 f(s 2 ) and f 2 (s) = s 2 2 s 2 f(2 s2 ). With the change of variables t = 2s 1 we finally obtain I(f) = 1 1 f 1 ((t + 1)/2) ds + Applying Gauss quadrature to these integrals, we define Q n (f) = n j=1 1 1 n f 2 ((t + 1)/2) ds. (9) w j n f 1 ((ξj n + 1)/2) + w j n f 2 ((ξj n + 1)/2), where ξj n and w j n are nodes and weights of the Gauss quadrature of order n defined on [ 1, 1]. (Alternatively, it is also possible to use the Clenshaw-Curtis quadrature rule.) By construction, we have that Q n (f) I(f) exponentially as n if f has an analytic extension to a neighborhood of [1, 2], since this implies that the integrands in (9) have an analytic extension to a neighborhood of [ 1, 1]. Define now the nodes c n ((ξj n j = + 1)/2)2 if j = 1,..., n, 2 ((ξj n n + 1)/2)2 if j = n + 1,..., 2n. Therefore, the above expression can be written as j=1 Q n (f) = n j=1 where the weights are given by w j n 2 c n j f(c n j ) + n j=1 w n j 2 c n j+n c n j+n f(c n j+n) = 2n j=1 w n j f(c n j ), w wj n j n 2 c n j if j = 1,..., n, = w j n n 2 c n j c if j = n + 1,..., 2n. n j 18

21 (4b) Given n > 0, determine the maximal d N such that I(p) = Q n (p) for every polynomial p P d 1. DEPENDS ON: subproblem (4a). Solution: The above expression is never exact for polynomials f, because of the presence of the square roots in (9). In other words, d = 0, for which P 1 =. Problem 5 Mono-implicit Runge-Kutta single step method (28 pts.) A so-called s-stage mono-implicit Runge-Kutta single step method (MIRK) for the autonomous ODE ẏ = f(y), f D R d R d, is defined as: i 1 g i = (1 v i )y 0 + v i y 1 + h d i,j f(g j ), i = 1,... s, y 1 = y 0 + h b j f(g j ) s j=1 for suitable coefficients v i, b i, d i,j R. (5a) Single step methods defined by (10) belong to the class of implicit Runge-Kutta methods. Write down the corresponding Butcher scheme in terms of the coefficients v i, b i, d i,j. Solution: Let us define d i,j = 0 for j i. Replacing y 1 in the equation for g i, one obtains: s i 1 s g i = (1 v i )y 0 + v i (y 0 + h b j f(g j )) + h d i,j f(g j ) = y 0 + h (v i b j + d i,j )f(g j ), y 1 = y 0 + h b j f(g j ) s j=1 j=1 = a i,j Set k i = f(g i ). Then, k i = f(y 0 + h s j=1 (v i b j + d i,j ) k j ) and Therefore, the Butcher scheme becomes: j=1 j=1 s j=1 (10) (11) y 1 = y 0 + h b j k j (12) j=1 c D + vb b, where (D) i,j = d i,j, b = [b 1,..., b s ], v = [v 1,..., v s ] and c i = s j=1 a i,j. 19

22 (5b) Compute the stability function of a MIRK scheme defined as in (10) for s = 2. Solution: We apply the MIRK scheme to the ODE y = λy. Denote by g = [g 1, g 2 ] and z = hλ, then: where 1 = [1,..., 1]. Consider Then whence g = (1 v)y 0 + vy 1 + zdg (I zd)g = (1 v)y 0 + vy 1 y 1 = y 0 + zb g = y 0 + zb (I zd) 1 ((1 v)y 0 + vy 1 ). (1 zb (I zd) 1 v)y 1 = (1 + zb (I zd) 1 (1 v))y 0, S(z) = 1 + zb (I zd) 1 (1 v). 1 zb (I zd) 1 v Alternative: use formula from Thm, from the course together with the Butcher scheme derived in the previous sub-problem. (5c) Now, we consider the special case of a scalar ODE (d = 1) and s = 2. Abbreviating z = [g 1, g 2, y 1 ], rewrite (10) as a non-linear system of equations in the form F(z) = 0 for an explicitly specified suitable function F R 3 R 3. Solution: F( g 1 g 2 y 1 g 1 (1 v 1 )y 0 v 1 y 1 ) = g 2 (1 v 2 )y 0 v 2 y 1 hd 2,1 f(g 1 ) y 1 y 0 h 2 j=1 b j f(g j ) (5d) Find the Jacobian DF(z) of the function F (in terms of d i,j, v i, b i and the derivative of f) from the previous sub-problem. DEPENDS ON: subproblem (5c). Solution: DF( g 1 g 2 y v 1 ) = I 3 hd 2,1 f (g 1 ) 0 v 2. hb 1 f (g 1 ) hb 2 f (g 2 ) 0 In the next steps, we will implement the MIRK scheme for d = 1, s = 2. 20

23 (5e) Implement a function 1 using V e c t o r = Eigen : : VectorXd ; 2 template < c l a s s F u n c, c l a s s Jac > 3 void n e w t o n 2 s t e p s ( c o n s t Func & F, c o n s t J a c & DF, 4 V e c t o r & z ) ; that approximates the solution of F(z) = 0 by performing two steps of the Newton method applied to F(z) = 0. Use z to pass the initial guess and to return the approximated solution. Objects of type Func and Jac have to supply suitable evaluation operators operator(). Solution: See implementation in problem5_solution.cpp. (5f) Consider the particular MIRK scheme given by the coefficients: v 1 = 1, v 2 = , d 21 = , b 1 = 37 82, b 2 = (13) Using the function newton2steps, implement a function 1 template < c l a s s F u n c, c l a s s Jac > 2 double MIRKstep ( c o n s t Func & f, c o n s t J a c & d f, 3 double y 0, double h ) ; that realizes one step of the MIRK scheme defined by (10) for s = 2 and a scalar ODE, that is, d = 1. The right hand side function f and its Jacobian are passed through f and df. The solution of the nonlinear system arising from (10) is approximated using two Newton steps, namely by using the function newton2steps. The initial guess has to be chosen appropriately! DEPENDS ON: subproblems (5c) and (5d). Solution: See implementation in problem5_solution.cpp. (5g) Implement a function 1 template < c l a s s F u n c, c l a s s Jac > 2 double MIRKsolve ( c o n s t Func & f, c o n s t J a c & d f, 3 double y 0, double T, unsigned i n t N) ; for the solution of a scalar ODE up to time T, using N equidistant steps of the monoimplicit Runge-Kutta single step method defined by (13). The initial value is passed in y0. 21

24 Solution: See implementation in problem5_solution.cpp. (5h) Apply your implementation to the IVP ẏ = 1 + y 2, y(0) = 0 (14) on [0, 1]. The file problem5.cpp contains a partial template for this sub-problem. The exact solution of (14) is y ex (t) = tan t. Compute the solution y n at T = 1 with a sequence of uniform temporal meshes with n = 4,..., 512 intervals. Compute and output the error y n (1) y ex (1) and determine the rate of convergence of the scheme. DEPENDS ON: subproblems (5c), (5d), (5e), (5f) and (5g). Solution: The experimental rate of convergence of the methods is O(h 2 ). See implementation in problem5_solution.cpp. Solution: 1 # i n c l u d e < i o s t r e a m > 2 3 # i n c l u d e < v e c t o r > 4 5 # i n c l u d e < Eigen/Dense > 6 7 using V e c t o r = Eigen : : VectorXd ; 8 using M a t r i x = Eigen : : MatrixXd ; 9 10 //! \brief Perform 2 steps of newton method applied to F and its jacobian DF 11 //! \tparam Func type for function F 12 //! \tparam Jac type for jacobian DF of F 13 //! \param[in] F function F, for which F(z) = 0 is needed 14 //! \param[in] DF Jacobian DF of the function F 15 //! \param[in,out] z initial guess and final approximation for F(z) = 0 16 template < c l a s s F u n c, c l a s s Jac > 17 void n e w t o n 2 s t e p s ( c o n s t Func & F, c o n s t J a c & DF, Vector & z ) { 18 // TODO: problem 5e: two newton steps V e c t o r znew = z DF( z ). l u ( ). s o l v e ( F ( z ) ) ; 21 z = znew DF( znew ). l u ( ). s o l v e ( F ( znew ) ) ; 22 } 23 22

25 24 //! \brief Perform a single step of the MIRK scheme applied to the scalar ODE y = f(y) 25 //! \tparam Func type for function f 26 //! \tparam Jac type for jacobian df of f 27 //! \param[in] f function f, as in y = f(y) 28 //! \param[in] df Jacobian df of the function f 29 //! \param[in] y0 previous value 30 //! \param[in] h step-size 31 //! \return value y1 at next step 32 template < c l a s s F u n c, c l a s s Jac > 33 double MIRKstep ( c o n s t Func & f, c o n s t J a c & d f, double y 0, double h ) { 34 c o n s t double v1 = 1 ; 35 c o n s t double v2 = /2025. ; 36 c o n s t double d21 = 164. /2025. ; 37 c o n s t double b1 = 3 7. / 8 2. ; 38 c o n s t double b2 = 4 5. / 8 2. ; // TODO: problem 5f: implement MIRK step auto F = [& f, &y 0, &v 1, &v 2, &d 2 1, &b 1, &b 2, &h ] ( c o n s t V e c t o r & z ) > Vector { 43 V e c t o r r e t ( 3 ) ; 44 r e t << z ( 0 ) (1 v1 ) *y0 v1*z ( 2 ), 45 z ( 1 ) (1 v2 ) *y0 v2*z ( 2 ) h*d21*f ( z ( 0 ) ), 46 z ( 2 ) y0 h* ( b1*f ( z ( 0 ) ) + b2*f ( z ( 1 ) ) ) ; 47 return r e t ; 48 } ; 49 auto DF = [& d f, &v 1, &v 2, &d 2 1, &b 1, &b 2, &h ] ( c o n s t V e c t o r & z ) > M atrix { 50 M a t r i x M(3, 3 ) ; 51 M << 0, 0, v 1, 52 h*d21*df ( z ( 0 ) ), 0, v 2, 53 h*b1*df ( z ( 0 ) ), h * b 2 * d f ( z ( 1 ) ), 0 ; 54 return M a trix : : I d e n t i t y (3, 3 ) M; 55 } ; 56 V e c t o r z ( 3 ) ; 57 z << 0, 0, y 0 ; // FIXME: initial data 58 n e w t o n 2 s t e p s ( F, DF, z ) ; return z ( 2 ) ; 23

26 61 } //! \brief Solve an ODE y = f(y) using MIRK scheme on equidistant steps 64 //! \tparam Func type for function f 65 //! \tparam Jac type for jacobian df of f 66 //! \param[in] f function f, as in y = f(y) 67 //! \param[in] df Jacobian df of the function f 68 //! \param[in] y0 initial value 69 //! \param[in] T final time 70 //! \param[in] N number of steps 71 //! \return value approximating y(t) 72 template < c l a s s F u n c, c l a s s Jac > 73 double MIRKsolve ( c o n s t Func & f, c o n s t J a c & d f, double y 0, double T, unsigned i n t N) { 74 // TODO: problem 5g: implement MIRK solver c o n s t double h = T / N; 77 double y n e x t = y0 ; 78 f o r ( unsigned i n t i = 0 ; i < N; ++ i ) { 79 y n e x t = MIRKstep ( f, d f, y n e x t, h ) ; 80 } 81 return y n e x t ; 82 } i n t main ( i n t, c h a r * * ) { auto f = [ ] ( double y ) > double { return 1 + y*y ; } ; 87 auto df = [ ] ( double y ) > double { return 2*y ; } ; c o n s t double y0 = 0. ; 90 c o n s t double T = 1. ; c o n s t double yex = t a n ( 1 ) ; //// PROBLEM 5h TEST 95 s t d : : c o u t << " *** PROBLEM 5h : " << s t d : : e n d l ; 96 // TODO: problem 5h: solve IVP y = f(y) up to T s t d : : c o u t << "N" << " \ t " << " yend " << " \ t " << " e r r " << s t d : : e n d l ; 24

27 99 f o r ( unsigned i n t N = 4 ; N < 512; N=N< <1) { 100 double yend = MIRKsolve ( f, d f, y 0, T, N) ; 101 double e r r = s t d : : abs ( yex yend ) ; 102 s t d : : c o u t << N << " \ t " << yend << " \ t " << e r r << s t d : : e n d l ; 103 } 104 } 25

Last name Department Computer Name Legi No. Date Total. Always keep your Legi visible on the table.

Last name Department Computer Name Legi No. Date Total. Always keep your Legi visible on the table. First name Last name Department Computer Name Legi No. Date 12.08.2016 1 2 3 4 5 Total Grade Fill in this cover sheet first. Always keep your Legi visible on the table. Keep your phones, tablets and computers

More information

Numerical Analysis II. Problem Sheet 12

Numerical Analysis II. Problem Sheet 12 P. Grohs S. Hosseini Ž. Kereta Spring Term 2015 Numerical Analysis II ETH Zürich D-MATH Problem Sheet 12 Problem 12.1 The Exponential Runge-Kutta Method Consider the exponential Runge Kutta single-step

More information

Computational Methods for Engineering Applications II. Homework Problem Sheet 4

Computational Methods for Engineering Applications II. Homework Problem Sheet 4 S. Mishra K. O. Lye L. Scarabosio Autumn Term 2015 Computational Methods for Engineering Applications II ETH Zürich D-MATH Homework Problem Sheet 4 This assignment sheet contains some tasks marked as Core

More information

Numerical Analysis II. Problem Sheet 9

Numerical Analysis II. Problem Sheet 9 H. Ammari W. Wu S. Yu Spring Term 08 Numerical Analysis II ETH Zürich D-MATH Problem Sheet 9 Problem 9. Extrapolation of the Implicit Mid-Point Rule. Taking the implicit mid-point rule as a basis method,

More information

Numerical Analysis II. Problem Sheet 8

Numerical Analysis II. Problem Sheet 8 P. Grohs S. Hosseini Ž. Kereta Spring Term 15 Numerical Analysis II ETH Zürich D-MATH Problem Sheet 8 Problem 8.1 The dierential equation Autonomisation and Strang-Splitting ẏ = A(t)y, y(t ) = y, A(t)

More information

MecE 390 Final examination, Winter 2014

MecE 390 Final examination, Winter 2014 MecE 390 Final examination, Winter 2014 Directions: (i) a double-sided 8.5 11 formula sheet is permitted, (ii) no calculators are permitted, (iii) the exam is 80 minutes in duration; please turn your paper

More information

Numerical Methods for Differential Equations

Numerical Methods for Differential Equations Numerical Methods for Differential Equations Chapter 2: Runge Kutta and Linear Multistep methods Gustaf Söderlind and Carmen Arévalo Numerical Analysis, Lund University Textbooks: A First Course in the

More information

The Direct Transcription Method For Optimal Control. Part 2: Optimal Control

The Direct Transcription Method For Optimal Control. Part 2: Optimal Control The Direct Transcription Method For Optimal Control Part 2: Optimal Control John T Betts Partner, Applied Mathematical Analysis, LLC 1 Fundamental Principle of Transcription Methods Transcription Method

More information

Numerical Methods for CSE. Examination - Solutions

Numerical Methods for CSE. Examination - Solutions R. Hiptmair A. Moiola Fall term 2010 Numerical Methods for CSE ETH Zürich D-MATH Examination - Solutions February 10th, 2011 Total points: 65 = 8+14+16+16+11 (These are not master solutions but just a

More information

MAT 275 Laboratory 4 MATLAB solvers for First-Order IVP

MAT 275 Laboratory 4 MATLAB solvers for First-Order IVP MAT 75 Laboratory 4 MATLAB solvers for First-Order IVP In this laboratory session we will learn how to. Use MATLAB solvers for solving scalar IVP. Use MATLAB solvers for solving higher order ODEs and systems

More information

Lecture Notes to Accompany. Scientific Computing An Introductory Survey. by Michael T. Heath. Chapter 9

Lecture Notes to Accompany. Scientific Computing An Introductory Survey. by Michael T. Heath. Chapter 9 Lecture Notes to Accompany Scientific Computing An Introductory Survey Second Edition by Michael T. Heath Chapter 9 Initial Value Problems for Ordinary Differential Equations Copyright c 2001. Reproduction

More information

CS 257: Numerical Methods

CS 257: Numerical Methods CS 57: Numerical Methods Final Exam Study Guide Version 1.00 Created by Charles Feng http://www.fenguin.net CS 57: Numerical Methods Final Exam Study Guide 1 Contents 1 Introductory Matter 3 1.1 Calculus

More information

MAT 275 Laboratory 4 MATLAB solvers for First-Order IVP

MAT 275 Laboratory 4 MATLAB solvers for First-Order IVP MAT 275 Laboratory 4 MATLAB solvers for First-Order IVP In this laboratory session we will learn how to. Use MATLAB solvers for solving scalar IVP 2. Use MATLAB solvers for solving higher order ODEs and

More information

NUMERICAL ANALYSIS 2 - FINAL EXAM Summer Term 2006 Matrikelnummer:

NUMERICAL ANALYSIS 2 - FINAL EXAM Summer Term 2006 Matrikelnummer: Prof. Dr. O. Junge, T. März Scientific Computing - M3 Center for Mathematical Sciences Munich University of Technology Name: NUMERICAL ANALYSIS 2 - FINAL EXAM Summer Term 2006 Matrikelnummer: I agree to

More information

Numerical Methods for CSE. Examination

Numerical Methods for CSE. Examination R. Hiptmair A. Moiola Fall term 2010 Numerical Methods for CSE ETH Zürich D-MATH Examination August 11th, 2011 Instructions. Duration of examination: 180 minutes. Total points: 90. Concise answers are

More information

Multistep Methods for IVPs. t 0 < t < T

Multistep Methods for IVPs. t 0 < t < T Multistep Methods for IVPs We are still considering the IVP dy dt = f(t,y) t 0 < t < T y(t 0 ) = y 0 So far we have looked at Euler s method, which was a first order method and Runge Kutta (RK) methods

More information

Numerical Analysis Exam with Solutions

Numerical Analysis Exam with Solutions Numerical Analysis Exam with Solutions Richard T. Bumby Fall 000 June 13, 001 You are expected to have books, notes and calculators available, but computers of telephones are not to be used during the

More information

you expect to encounter difficulties when trying to solve A x = b? 4. A composite quadrature rule has error associated with it in the following form

you expect to encounter difficulties when trying to solve A x = b? 4. A composite quadrature rule has error associated with it in the following form Qualifying exam for numerical analysis (Spring 2017) Show your work for full credit. If you are unable to solve some part, attempt the subsequent parts. 1. Consider the following finite difference: f (0)

More information

Graded Project #1. Part 1. Explicit Runge Kutta methods. Goals Differential Equations FMN130 Gustaf Söderlind and Carmen Arévalo

Graded Project #1. Part 1. Explicit Runge Kutta methods. Goals Differential Equations FMN130 Gustaf Söderlind and Carmen Arévalo 2008-11-07 Graded Project #1 Differential Equations FMN130 Gustaf Söderlind and Carmen Arévalo This homework is due to be handed in on Wednesday 12 November 2008 before 13:00 in the post box of the numerical

More information

An Overly Simplified and Brief Review of Differential Equation Solution Methods. 1. Some Common Exact Solution Methods for Differential Equations

An Overly Simplified and Brief Review of Differential Equation Solution Methods. 1. Some Common Exact Solution Methods for Differential Equations An Overly Simplified and Brief Review of Differential Equation Solution Methods We will be dealing with initial or boundary value problems. A typical initial value problem has the form y y 0 y(0) 1 A typical

More information

Ordinary differential equations - Initial value problems

Ordinary differential equations - Initial value problems Education has produced a vast population able to read but unable to distinguish what is worth reading. G.M. TREVELYAN Chapter 6 Ordinary differential equations - Initial value problems In this chapter

More information

MAT 275 Laboratory 4 MATLAB solvers for First-Order IVP

MAT 275 Laboratory 4 MATLAB solvers for First-Order IVP MATLAB sessions: Laboratory 4 MAT 275 Laboratory 4 MATLAB solvers for First-Order IVP In this laboratory session we will learn how to. Use MATLAB solvers for solving scalar IVP 2. Use MATLAB solvers for

More information

Scientific Computing: An Introductory Survey

Scientific Computing: An Introductory Survey Scientific Computing: An Introductory Survey Chapter 9 Initial Value Problems for Ordinary Differential Equations Prof. Michael T. Heath Department of Computer Science University of Illinois at Urbana-Champaign

More information

LECTURE NOTES ELEMENTARY NUMERICAL METHODS. Eusebius Doedel

LECTURE NOTES ELEMENTARY NUMERICAL METHODS. Eusebius Doedel LECTURE NOTES on ELEMENTARY NUMERICAL METHODS Eusebius Doedel TABLE OF CONTENTS Vector and Matrix Norms 1 Banach Lemma 20 The Numerical Solution of Linear Systems 25 Gauss Elimination 25 Operation Count

More information

On linear and non-linear equations.(sect. 2.4).

On linear and non-linear equations.(sect. 2.4). On linear and non-linear equations.sect. 2.4). Review: Linear differential equations. Non-linear differential equations. Properties of solutions to non-linear ODE. The Bernoulli equation. Review: Linear

More information

Jim Lambers MAT 460/560 Fall Semester Practice Final Exam

Jim Lambers MAT 460/560 Fall Semester Practice Final Exam Jim Lambers MAT 460/560 Fall Semester 2009-10 Practice Final Exam 1. Let f(x) = sin 2x + cos 2x. (a) Write down the 2nd Taylor polynomial P 2 (x) of f(x) centered around x 0 = 0. (b) Write down the corresponding

More information

Defect-based a-posteriori error estimation for implicit ODEs and DAEs

Defect-based a-posteriori error estimation for implicit ODEs and DAEs 1 / 24 Defect-based a-posteriori error estimation for implicit ODEs and DAEs W. Auzinger Institute for Analysis and Scientific Computing Vienna University of Technology Workshop on Innovative Integrators

More information

Interpolation. Chapter Interpolation. 7.2 Existence, Uniqueness and conditioning

Interpolation. Chapter Interpolation. 7.2 Existence, Uniqueness and conditioning 76 Chapter 7 Interpolation 7.1 Interpolation Definition 7.1.1. Interpolation of a given function f defined on an interval [a,b] by a polynomial p: Given a set of specified points {(t i,y i } n with {t

More information

Do not turn over until you are told to do so by the Invigilator.

Do not turn over until you are told to do so by the Invigilator. UNIVERSITY OF EAST ANGLIA School of Mathematics Main Series UG Examination 216 17 INTRODUCTION TO NUMERICAL ANALYSIS MTHE612B Time allowed: 3 Hours Attempt QUESTIONS 1 and 2, and THREE other questions.

More information

Matrix Arithmetic. a 11 a. A + B = + a m1 a mn. + b. a 11 + b 11 a 1n + b 1n = a m1. b m1 b mn. and scalar multiplication for matrices via.

Matrix Arithmetic. a 11 a. A + B = + a m1 a mn. + b. a 11 + b 11 a 1n + b 1n = a m1. b m1 b mn. and scalar multiplication for matrices via. Matrix Arithmetic There is an arithmetic for matrices that can be viewed as extending the arithmetic we have developed for vectors to the more general setting of rectangular arrays: if A and B are m n

More information

Numerical Methods - Initial Value Problems for ODEs

Numerical Methods - Initial Value Problems for ODEs Numerical Methods - Initial Value Problems for ODEs Y. K. Goh Universiti Tunku Abdul Rahman 2013 Y. K. Goh (UTAR) Numerical Methods - Initial Value Problems for ODEs 2013 1 / 43 Outline 1 Initial Value

More information

Bindel, Fall 2011 Intro to Scientific Computing (CS 3220) Week 12: Monday, Apr 18. HW 7 is posted, and will be due in class on 4/25.

Bindel, Fall 2011 Intro to Scientific Computing (CS 3220) Week 12: Monday, Apr 18. HW 7 is posted, and will be due in class on 4/25. Logistics Week 12: Monday, Apr 18 HW 6 is due at 11:59 tonight. HW 7 is posted, and will be due in class on 4/25. The prelim is graded. An analysis and rubric are on CMS. Problem du jour For implicit methods

More information

Practical Information

Practical Information MA2501 Numerical Methods Spring 2018 Norwegian University of Science and Technology Department of Mathematical Sciences Semester Project Practical Information This project counts for 30 % of the final

More information

Exam in TMA4215 December 7th 2012

Exam in TMA4215 December 7th 2012 Norwegian University of Science and Technology Department of Mathematical Sciences Page of 9 Contact during the exam: Elena Celledoni, tlf. 7359354, cell phone 48238584 Exam in TMA425 December 7th 22 Allowed

More information

Chapter 5 Exercises. (a) Determine the best possible Lipschitz constant for this function over 2 u <. u (t) = log(u(t)), u(0) = 2.

Chapter 5 Exercises. (a) Determine the best possible Lipschitz constant for this function over 2 u <. u (t) = log(u(t)), u(0) = 2. Chapter 5 Exercises From: Finite Difference Methods for Ordinary and Partial Differential Equations by R. J. LeVeque, SIAM, 2007. http://www.amath.washington.edu/ rjl/fdmbook Exercise 5. (Uniqueness for

More information

INTRODUCTION TO COMPUTER METHODS FOR O.D.E.

INTRODUCTION TO COMPUTER METHODS FOR O.D.E. INTRODUCTION TO COMPUTER METHODS FOR O.D.E. 0. Introduction. The goal of this handout is to introduce some of the ideas behind the basic computer algorithms to approximate solutions to differential equations.

More information

Qualifying Examination

Qualifying Examination Summer 24 Day. Monday, September 5, 24 You have three hours to complete this exam. Work all problems. Start each problem on a All problems are 2 points. Please email any electronic files in support of

More information

Companion. Jeffrey E. Jones

Companion. Jeffrey E. Jones MATLAB7 Companion 1O11OO1O1O1OOOO1O1OO1111O1O1OO 1O1O1OO1OO1O11OOO1O111O1O1O1O1 O11O1O1O11O1O1O1O1OO1O11O1O1O1 O1O1O1111O11O1O1OO1O1O1O1OOOOO O1111O1O1O1O1O1O1OO1OO1OO1OOO1 O1O11111O1O1O1O1O Jeffrey E.

More information

CS 450 Numerical Analysis. Chapter 9: Initial Value Problems for Ordinary Differential Equations

CS 450 Numerical Analysis. Chapter 9: Initial Value Problems for Ordinary Differential Equations Lecture slides based on the textbook Scientific Computing: An Introductory Survey by Michael T. Heath, copyright c 2018 by the Society for Industrial and Applied Mathematics. http://www.siam.org/books/cl80

More information

Numerical Methods - Boundary Value Problems for ODEs

Numerical Methods - Boundary Value Problems for ODEs Numerical Methods - Boundary Value Problems for ODEs Y. K. Goh Universiti Tunku Abdul Rahman 2013 Y. K. Goh (UTAR) Numerical Methods - Boundary Value Problems for ODEs 2013 1 / 14 Outline 1 Boundary Value

More information

Numerical Analysis Preliminary Exam 10 am to 1 pm, August 20, 2018

Numerical Analysis Preliminary Exam 10 am to 1 pm, August 20, 2018 Numerical Analysis Preliminary Exam 1 am to 1 pm, August 2, 218 Instructions. You have three hours to complete this exam. Submit solutions to four (and no more) of the following six problems. Please start

More information

Numerical solution of Least Squares Problems 1/32

Numerical solution of Least Squares Problems 1/32 Numerical solution of Least Squares Problems 1/32 Linear Least Squares Problems Suppose that we have a matrix A of the size m n and the vector b of the size m 1. The linear least square problem is to find

More information

Linear Multistep Methods I: Adams and BDF Methods

Linear Multistep Methods I: Adams and BDF Methods Linear Multistep Methods I: Adams and BDF Methods Varun Shankar January 1, 016 1 Introduction In our review of 5610 material, we have discussed polynomial interpolation and its application to generating

More information

Nonlinear Control Systems

Nonlinear Control Systems Nonlinear Control Systems António Pedro Aguiar pedro@isr.ist.utl.pt 3. Fundamental properties IST-DEEC PhD Course http://users.isr.ist.utl.pt/%7epedro/ncs2012/ 2012 1 Example Consider the system ẋ = f

More information

Butcher tableau Can summarize an s + 1 stage Runge Kutta method using a triangular grid of coefficients

Butcher tableau Can summarize an s + 1 stage Runge Kutta method using a triangular grid of coefficients AM 205: lecture 13 Last time: ODE convergence and stability, Runge Kutta methods Today: the Butcher tableau, multi-step methods, boundary value problems Butcher tableau Can summarize an s + 1 stage Runge

More information

Numerical Methods for Differential Equations

Numerical Methods for Differential Equations Numerical Methods for Differential Equations Chapter 2: Runge Kutta and Multistep Methods Gustaf Söderlind Numerical Analysis, Lund University Contents V4.16 1. Runge Kutta methods 2. Embedded RK methods

More information

The Plan. Initial value problems (ivps) for ordinary differential equations (odes) Review of basic methods You are here: Hamiltonian systems

The Plan. Initial value problems (ivps) for ordinary differential equations (odes) Review of basic methods You are here: Hamiltonian systems Scientific Computing with Case Studies SIAM Press, 2009 http://www.cs.umd.edu/users/oleary/sccswebpage Lecture Notes for Unit V Solution of Differential Equations Part 2 Dianne P. O Leary c 2008 The Plan

More information

CS 450 Numerical Analysis. Chapter 8: Numerical Integration and Differentiation

CS 450 Numerical Analysis. Chapter 8: Numerical Integration and Differentiation Lecture slides based on the textbook Scientific Computing: An Introductory Survey by Michael T. Heath, copyright c 2018 by the Society for Industrial and Applied Mathematics. http://www.siam.org/books/cl80

More information

MAT Linear Algebra Collection of sample exams

MAT Linear Algebra Collection of sample exams MAT 342 - Linear Algebra Collection of sample exams A-x. (0 pts Give the precise definition of the row echelon form. 2. ( 0 pts After performing row reductions on the augmented matrix for a certain system

More information

Review Problems for Exam 2

Review Problems for Exam 2 Review Problems for Exam 2 This is a list of problems to help you review the material which will be covered in the final. Go over the problem carefully. Keep in mind that I am going to put some problems

More information

CMU CS 462/662 (INTRO TO COMPUTER GRAPHICS) HOMEWORK 0.0 MATH REVIEW/PREVIEW LINEAR ALGEBRA

CMU CS 462/662 (INTRO TO COMPUTER GRAPHICS) HOMEWORK 0.0 MATH REVIEW/PREVIEW LINEAR ALGEBRA CMU CS 462/662 (INTRO TO COMPUTER GRAPHICS) HOMEWORK 0.0 MATH REVIEW/PREVIEW LINEAR ALGEBRA Andrew ID: ljelenak August 25, 2018 This assignment reviews basic mathematical tools you will use throughout

More information

MECH : a Primer for Matlab s ode suite of functions

MECH : a Primer for Matlab s ode suite of functions Objectives MECH 4-563: a Primer for Matlab s ode suite of functions. Review the fundamentals of initial value problems and why numerical integration methods are needed.. Introduce the ode suite of numerical

More information

Chapter 6 - Ordinary Differential Equations

Chapter 6 - Ordinary Differential Equations Chapter 6 - Ordinary Differential Equations 7.1 Solving Initial-Value Problems In this chapter, we will be interested in the solution of ordinary differential equations. Ordinary differential equations

More information

APPLICATIONS OF FD APPROXIMATIONS FOR SOLVING ORDINARY DIFFERENTIAL EQUATIONS

APPLICATIONS OF FD APPROXIMATIONS FOR SOLVING ORDINARY DIFFERENTIAL EQUATIONS LECTURE 10 APPLICATIONS OF FD APPROXIMATIONS FOR SOLVING ORDINARY DIFFERENTIAL EQUATIONS Ordinary Differential Equations Initial Value Problems For Initial Value problems (IVP s), conditions are specified

More information

Department of Applied Mathematics and Theoretical Physics. AMA 204 Numerical analysis. Exam Winter 2004

Department of Applied Mathematics and Theoretical Physics. AMA 204 Numerical analysis. Exam Winter 2004 Department of Applied Mathematics and Theoretical Physics AMA 204 Numerical analysis Exam Winter 2004 The best six answers will be credited All questions carry equal marks Answer all parts of each question

More information

We consider the problem of finding a polynomial that interpolates a given set of values:

We consider the problem of finding a polynomial that interpolates a given set of values: Chapter 5 Interpolation 5. Polynomial Interpolation We consider the problem of finding a polynomial that interpolates a given set of values: x x 0 x... x n y y 0 y... y n where the x i are all distinct.

More information

SOLUTIONS TO THE FINAL EXAM. December 14, 2010, 9:00am-12:00 (3 hours)

SOLUTIONS TO THE FINAL EXAM. December 14, 2010, 9:00am-12:00 (3 hours) SOLUTIONS TO THE 18.02 FINAL EXAM BJORN POONEN December 14, 2010, 9:00am-12:00 (3 hours) 1) For each of (a)-(e) below: If the statement is true, write TRUE. If the statement is false, write FALSE. (Please

More information

ORBIT 14 The propagator. A. Milani et al. Dipmat, Pisa, Italy

ORBIT 14 The propagator. A. Milani et al. Dipmat, Pisa, Italy ORBIT 14 The propagator A. Milani et al. Dipmat, Pisa, Italy Orbit 14 Propagator manual 1 Contents 1 Propagator - Interpolator 2 1.1 Propagation and interpolation............................ 2 1.1.1 Introduction..................................

More information

Lecture 4: Numerical solution of ordinary differential equations

Lecture 4: Numerical solution of ordinary differential equations Lecture 4: Numerical solution of ordinary differential equations Department of Mathematics, ETH Zürich General explicit one-step method: Consistency; Stability; Convergence. High-order methods: Taylor

More information

A 2. =... = c c N. 's arise from the three types of elementary row operations. If rref A = I its determinant is 1, and A = c 1

A 2. =... = c c N. 's arise from the three types of elementary row operations. If rref A = I its determinant is 1, and A = c 1 Theorem: Let A n n Then A 1 exists if and only if det A 0 proof: We already know that A 1 exists if and only if the reduced row echelon form of A is the identity matrix Now, consider reducing A to its

More information

(f(x) P 3 (x)) dx. (a) The Lagrange formula for the error is given by

(f(x) P 3 (x)) dx. (a) The Lagrange formula for the error is given by 1. QUESTION (a) Given a nth degree Taylor polynomial P n (x) of a function f(x), expanded about x = x 0, write down the Lagrange formula for the truncation error, carefully defining all its elements. How

More information

Final Examination. CS 205A: Mathematical Methods for Robotics, Vision, and Graphics (Fall 2013), Stanford University

Final Examination. CS 205A: Mathematical Methods for Robotics, Vision, and Graphics (Fall 2013), Stanford University Final Examination CS 205A: Mathematical Methods for Robotics, Vision, and Graphics (Fall 2013), Stanford University The exam runs for 3 hours. The exam contains eight problems. You must complete the first

More information

Accuracy, Precision and Efficiency in Sparse Grids

Accuracy, Precision and Efficiency in Sparse Grids John, Information Technology Department, Virginia Tech.... http://people.sc.fsu.edu/ jburkardt/presentations/ sandia 2009.pdf... Computer Science Research Institute, Sandia National Laboratory, 23 July

More information

Table 1 Principle Matlab operators and functions Name Description Page reference

Table 1 Principle Matlab operators and functions Name Description Page reference Matlab Index Table 1 summarises the Matlab supplied operators and functions to which we have referred. In most cases only a few of the options available to the individual functions have been fully utilised.

More information

APPM 2360: Final Exam 10:30am 1:00pm, May 6, 2015.

APPM 2360: Final Exam 10:30am 1:00pm, May 6, 2015. APPM 23: Final Exam :3am :pm, May, 25. ON THE FRONT OF YOUR BLUEBOOK write: ) your name, 2) your student ID number, 3) lecture section, 4) your instructor s name, and 5) a grading table for eight questions.

More information

10. Linear Systems of ODEs, Matrix multiplication, superposition principle (parts of sections )

10. Linear Systems of ODEs, Matrix multiplication, superposition principle (parts of sections ) c Dr. Igor Zelenko, Fall 2017 1 10. Linear Systems of ODEs, Matrix multiplication, superposition principle (parts of sections 7.2-7.4) 1. When each of the functions F 1, F 2,..., F n in right-hand side

More information

Final Examination. CS 205A: Mathematical Methods for Robotics, Vision, and Graphics (Spring 2016), Stanford University

Final Examination. CS 205A: Mathematical Methods for Robotics, Vision, and Graphics (Spring 2016), Stanford University Final Examination CS 205A: Mathematical Methods for Robotics, Vision, and Graphics (Spring 2016), Stanford University The exam runs for 3 hours. The exam contains seven problems. You must complete the

More information

I. Numerical Computing

I. Numerical Computing I. Numerical Computing A. Lectures 1-3: Foundations of Numerical Computing Lecture 1 Intro to numerical computing Understand difference and pros/cons of analytical versus numerical solutions Lecture 2

More information

Simple Examples on Rectangular Domains

Simple Examples on Rectangular Domains 84 Chapter 5 Simple Examples on Rectangular Domains In this chapter we consider simple elliptic boundary value problems in rectangular domains in R 2 or R 3 ; our prototype example is the Poisson equation

More information

Initial value problems for ordinary differential equations

Initial value problems for ordinary differential equations Initial value problems for ordinary differential equations Xiaojing Ye, Math & Stat, Georgia State University Spring 2019 Numerical Analysis II Xiaojing Ye, Math & Stat, Georgia State University 1 IVP

More information

Math 365 Homework 5 Due April 6, 2018 Grady Wright

Math 365 Homework 5 Due April 6, 2018 Grady Wright Math 365 Homework 5 Due April 6, 018 Grady Wright 1. (Polynomial interpolation, 10pts) Consider the following three samples of some function f(x): x f(x) -1/ -1 1 1 1/ (a) Determine the unique second degree

More information

Numerical Analysis Preliminary Exam 10.00am 1.00pm, January 19, 2018

Numerical Analysis Preliminary Exam 10.00am 1.00pm, January 19, 2018 Numerical Analysis Preliminary Exam 0.00am.00pm, January 9, 208 Instructions. You have three hours to complete this exam. Submit solutions to four (and no more) of the following six problems. Please start

More information

AIMS Exercise Set # 1

AIMS Exercise Set # 1 AIMS Exercise Set #. Determine the form of the single precision floating point arithmetic used in the computers at AIMS. What is the largest number that can be accurately represented? What is the smallest

More information

Lecture XI. Approximating the Invariant Distribution

Lecture XI. Approximating the Invariant Distribution Lecture XI Approximating the Invariant Distribution Gianluca Violante New York University Quantitative Macroeconomics G. Violante, Invariant Distribution p. 1 /24 SS Equilibrium in the Aiyagari model G.

More information

The family of Runge Kutta methods with two intermediate evaluations is defined by

The family of Runge Kutta methods with two intermediate evaluations is defined by AM 205: lecture 13 Last time: Numerical solution of ordinary differential equations Today: Additional ODE methods, boundary value problems Thursday s lecture will be given by Thomas Fai Assignment 3 will

More information

Math 291-2: Final Exam Solutions Northwestern University, Winter 2016

Math 291-2: Final Exam Solutions Northwestern University, Winter 2016 Math 29-2: Final Exam Solutions Northwestern University, Winter 206 Determine whether each of the following statements is true or false f it is true, explain why; if it is false, give a counterexample

More information

2 Numerical Methods for Initial Value Problems

2 Numerical Methods for Initial Value Problems Numerical Analysis of Differential Equations 44 2 Numerical Methods for Initial Value Problems Contents 2.1 Some Simple Methods 2.2 One-Step Methods Definition and Properties 2.3 Runge-Kutta-Methods 2.4

More information

Initial value problems for ordinary differential equations

Initial value problems for ordinary differential equations AMSC/CMSC 660 Scientific Computing I Fall 2008 UNIT 5: Numerical Solution of Ordinary Differential Equations Part 1 Dianne P. O Leary c 2008 The Plan Initial value problems (ivps) for ordinary differential

More information

Integration, differentiation, and root finding. Phys 420/580 Lecture 7

Integration, differentiation, and root finding. Phys 420/580 Lecture 7 Integration, differentiation, and root finding Phys 420/580 Lecture 7 Numerical integration Compute an approximation to the definite integral I = b Find area under the curve in the interval Trapezoid Rule:

More information

Global polynomial interpolants suffer from the Runge Phenomenon if the data sites (nodes) are not chosen correctly.

Global polynomial interpolants suffer from the Runge Phenomenon if the data sites (nodes) are not chosen correctly. Piecewise polynomial interpolation Global polynomial interpolants suffer from the Runge Phenomenon if the data sites (nodes) are not chosen correctly. In many applications, one does not have the freedom

More information

Solutions to Dynamical Systems 2010 exam. Each question is worth 25 marks.

Solutions to Dynamical Systems 2010 exam. Each question is worth 25 marks. Solutions to Dynamical Systems exam Each question is worth marks [Unseen] Consider the following st order differential equation: dy dt Xy yy 4 a Find and classify all the fixed points of Hence draw the

More information

MATHEMATICAL METHODS INTERPOLATION

MATHEMATICAL METHODS INTERPOLATION MATHEMATICAL METHODS INTERPOLATION I YEAR BTech By Mr Y Prabhaker Reddy Asst Professor of Mathematics Guru Nanak Engineering College Ibrahimpatnam, Hyderabad SYLLABUS OF MATHEMATICAL METHODS (as per JNTU

More information

ACM/CMS 107 Linear Analysis & Applications Fall 2016 Assignment 4: Linear ODEs and Control Theory Due: 5th December 2016

ACM/CMS 107 Linear Analysis & Applications Fall 2016 Assignment 4: Linear ODEs and Control Theory Due: 5th December 2016 ACM/CMS 17 Linear Analysis & Applications Fall 216 Assignment 4: Linear ODEs and Control Theory Due: 5th December 216 Introduction Systems of ordinary differential equations (ODEs) can be used to describe

More information

Ordinary Differential Equations

Ordinary Differential Equations Ordinary Differential Equations Professor Dr. E F Toro Laboratory of Applied Mathematics University of Trento, Italy eleuterio.toro@unitn.it http://www.ing.unitn.it/toro September 19, 2014 1 / 55 Motivation

More information

Consistency and Convergence

Consistency and Convergence Jim Lambers MAT 77 Fall Semester 010-11 Lecture 0 Notes These notes correspond to Sections 1.3, 1.4 and 1.5 in the text. Consistency and Convergence We have learned that the numerical solution obtained

More information

2D Plotting with Matlab

2D Plotting with Matlab GEEN 1300 Introduction to Engineering Computing Class Meeting #22 Monday, Nov. 9 th Engineering Computing and Problem Solving with Matlab 2-D plotting with Matlab Script files User-defined functions Matlab

More information

Numerical solution of ODEs

Numerical solution of ODEs Numerical solution of ODEs Arne Morten Kvarving Department of Mathematical Sciences Norwegian University of Science and Technology November 5 2007 Problem and solution strategy We want to find an approximation

More information

Pascal s Triangle on a Budget. Accuracy, Precision and Efficiency in Sparse Grids

Pascal s Triangle on a Budget. Accuracy, Precision and Efficiency in Sparse Grids Covering : Accuracy, Precision and Efficiency in Sparse Grids https://people.sc.fsu.edu/ jburkardt/presentations/auburn 2009.pdf... John Interdisciplinary Center for Applied Mathematics & Information Technology

More information

1 Review of Interpolation using Cubic Splines

1 Review of Interpolation using Cubic Splines cs412: introduction to numerical analysis 10/10/06 Lecture 12: Instructor: Professor Amos Ron Cubic Hermite Spline Interpolation Scribes: Yunpeng Li, Mark Cowlishaw 1 Review of Interpolation using Cubic

More information

PARTIAL DIFFERENTIAL EQUATIONS

PARTIAL DIFFERENTIAL EQUATIONS MATHEMATICAL METHODS PARTIAL DIFFERENTIAL EQUATIONS I YEAR B.Tech By Mr. Y. Prabhaker Reddy Asst. Professor of Mathematics Guru Nanak Engineering College Ibrahimpatnam, Hyderabad. SYLLABUS OF MATHEMATICAL

More information

Theory, Solution Techniques and Applications of Singular Boundary Value Problems

Theory, Solution Techniques and Applications of Singular Boundary Value Problems Theory, Solution Techniques and Applications of Singular Boundary Value Problems W. Auzinger O. Koch E. Weinmüller Vienna University of Technology, Austria Problem Class z (t) = M(t) z(t) + f(t, z(t)),

More information

Homework #6 Solutions

Homework #6 Solutions Problems Section.1: 6, 4, 40, 46 Section.:, 8, 10, 14, 18, 4, 0 Homework #6 Solutions.1.6. Determine whether the functions f (x) = cos x + sin x and g(x) = cos x sin x are linearly dependent or linearly

More information

Linear Algebra Review (Course Notes for Math 308H - Spring 2016)

Linear Algebra Review (Course Notes for Math 308H - Spring 2016) Linear Algebra Review (Course Notes for Math 308H - Spring 2016) Dr. Michael S. Pilant February 12, 2016 1 Background: We begin with one of the most fundamental notions in R 2, distance. Letting (x 1,

More information

MATH 205C: STATIONARY PHASE LEMMA

MATH 205C: STATIONARY PHASE LEMMA MATH 205C: STATIONARY PHASE LEMMA For ω, consider an integral of the form I(ω) = e iωf(x) u(x) dx, where u Cc (R n ) complex valued, with support in a compact set K, and f C (R n ) real valued. Thus, I(ω)

More information

Jim Lambers MAT 610 Summer Session Lecture 1 Notes

Jim Lambers MAT 610 Summer Session Lecture 1 Notes Jim Lambers MAT 60 Summer Session 2009-0 Lecture Notes Introduction This course is about numerical linear algebra, which is the study of the approximate solution of fundamental problems from linear algebra

More information

Math-3315 & CSE-3365, exam 2 answer sheet

Math-3315 & CSE-3365, exam 2 answer sheet Math-3315 & CSE-3365, exam 2 answer sheet Oct. 23, 2012 Problem 1. (20 points) Given a vector z that contains all distinct elements z 1,z 2,,z n. The first task is to generate an n n Vandermonde-type matrix

More information

ODE Homework 1. Due Wed. 19 August 2009; At the beginning of the class

ODE Homework 1. Due Wed. 19 August 2009; At the beginning of the class ODE Homework Due Wed. 9 August 2009; At the beginning of the class. (a) Solve Lẏ + Ry = E sin(ωt) with y(0) = k () L, R, E, ω are positive constants. (b) What is the limit of the solution as ω 0? (c) Is

More information

Deferred correction based on exponentially-fitted mono-implicit Runge-Kutta methods

Deferred correction based on exponentially-fitted mono-implicit Runge-Kutta methods Deferred correction based on exponentially-fitted mono-implicit Runge-Kutta methods M. Van Daele Department of Applied Mathematics, Computer Science and Statistics Ghent University 3th International Conference

More information

Ordinary Differential Equations

Ordinary Differential Equations Chapter 13 Ordinary Differential Equations We motivated the problem of interpolation in Chapter 11 by transitioning from analzying to finding functions. That is, in problems like interpolation and regression,

More information

Differential Equations FMNN10 Graded Project #1 c G Söderlind 2017

Differential Equations FMNN10 Graded Project #1 c G Söderlind 2017 Differential Equations FMNN10 Graded Project #1 c G Söderlind 2017 Published 2017-10-30. Instruction in computer lab 2017-11-02/08/09. Project report due date: Monday 2017-11-13 at 10:00. Goals. The goal

More information