From the output we see that the largest eigenvalue of B is about (ii) Use the inverse power method to find the smallest eigenvalue.

Size: px
Start display at page:

Download "From the output we see that the largest eigenvalue of B is about (ii) Use the inverse power method to find the smallest eigenvalue."

Transcription

1 . Let B be the matrix given by (i) Use the power method to find the largest eigenvalue. The following Matlab script clear all; getb; 3 v=ones(5,); 4 disp(sprintf("%0s %5s","iteration","lambda")); 5 for i=:8 6 w=b*v; 7 lambda=(v *w)/(v *v); 8 disp(sprintf("%0d %5.0f",i,lambda)); 9 [y,i]=max(abs(w)); 0 alpha=w(i); v=w/alpha; end along with the file getb.m given by B=[ ; ; ; ; ]; implements the power method and produces the output iteration lambda From the output we see that the largest eigenvalue of B is about (ii) Use the inverse power method to find the smallest eigenvalue. A slight modification of the above code to implement the inverse power method gives clear all

2 getb; 3 v=ones(5,); 4 disp(sprintf("%0s %5s","iteration","lambda")); 5 for i=:8 6 w=b\v; 7 lambda=(v *v)/(v *w); 8 disp(sprintf("%0d %5.0f",i,lambda)); 9 [y,i]=max(abs(w)); 0 alpha=w(i); v=w/alpha; end with output iteration lambda From the output we see that the smallest eigenvalue of B is about (iii) [ ] Use the shifted inverse power method to find one more eigenvalue. We decide to shift by s = to find another eigenvalue. A modification of the above code to implement the shifted inverse power method gives clear all getb; 3 v=ones(5,); 4 disp(sprintf("%0s %5s","iteration","lambda")); 5 s=; 6 BS=B-s*eye(5); 7 for i=:5 8 w=bs\v; 9 lambda=(v *v)/(v *w)+s; 0 disp(sprintf("%0d %5.0f",i,lambda)); [y,i]=max(abs(w)); alpha=w(i); 3 v=w/alpha; 4 end with output iteration lambda

3 From the output we see that another eigenvalue of B is about For reference note that the complete set of eigenvalue of B may be found using the built-in Matlab command eig and are given by >> eig(b) ans =

4 . Consider the two-point linear boundary problem { y + cos(x)y (x + )y = y( ) = y() =. (i) Solve the above boundary problem for grid sizes of h = 4/n where n = 4, 8, 6, 3,..., 56. Plot your solutions. The Matlab code for this consisted of the script clear all p=@(x) -cos(x); 3 q=@(x) x.*x+; 4 r=@(x) +0*x; 5 6 dataout=fopen("data.dat","w"); 7 for N=.^[:8] 8 fprintf(dataout,"# n=%d\n",n); 9 [xn,yn]=solvebvp(p,q,r,-,,n,,); 0 for j=:length(xn) fprintf(dataout,"%.5e %.5e\n",xn(j),yn(j)); end 3 fprintf(dataout,"\n\n"); 4 end 5 fclose(dataout); along with solvebvp.m for solving for the two-point boundary value problem %solvebvp.m -- Solve boundary value problem % y =py +qy+r 3 % y(a)=g, y(b)=g 4 function [xn,yn]=solvebvp(p,q,r,a,b,n,g,g) 5 h=(b-a)/n; 6 xn=[a:h:b] ; 7 Aa=-(+h/*p(xn(3:N))); 8 Ab=+h^*q(xn(:N)); 9 Ac=(+h/*p(xn(:N))); 0 f=-h^*r(xn(:n)); f()=f()+(+h/*p(xn()))*g; f(n)=f(n)+(-h/*p(xn(n)))*g; 3 ym=tridiag(aa,ab,ac,f); 4 yn=[g; ym; g]; and the tridiagonal solver tridiag.m developed in class function f=tridiag(a,b,c,f) n=length(b); 3 for i=:n 4

5 4 a(i)=a(i)/b(i); 5 b(i+)=b(i+)-a(i)*c(i); 6 end 7 for i=:n 8 f(i+)=f(i+)-a(i)*f(i); 9 end 0 f(n)=f(n)/b(n); for i=n:: f(i)=(/b(i))*(f(i)-c(i)*f(i+)); 3 end 4 end This code creates a data file data.dat consisting of the solution for each resolution separated by two blank lines. We plot the data file using the plotting program gnuplot along with the script data.gnu which contains the commands set terminal pstex set style data lines 3 set size 0.8,0.8 4 set key spacing. 5 set key bottom 6 set output "data-0.tex" 7 plot [:] [.35:-0.85] "data.dat" index 0 ti "$n=4$" 8 set output "data.tex" 9 plot [:] [.35:-0.85] "data.dat" index ti "$n=8$" 0 set output "data-.tex" plot [:] [.35:-0.85] "data.dat" index ti "$n=6$" set output "data-3.tex" 3 plot [:] [.35:-0.85] "data.dat" index 3 ti "$n=3$" 4 set output "data-4.tex" 5 plot [:] [.35:-0.85] "data.dat" index 4 ti "$n=64$" 6 set output "data-5.tex" 7 plot [:] [.35:-0.85] "data.dat" index 5 ti "$n=8$" 8 set output "data-6.tex" 9 plot [:] [.35:-0.85] "data.dat" index 6 ti "$n=56$" The resulting output was 5

6 n = n = n =

7 n = n = n =

8 n = (ii) Calculate the value of y() to 5 significant digits. The following Matlab code uses the relationship that y j y() for j = + 3n/4. Note that 0.05 is added in the code and the integer part is taken to ensure correct rounding. clear all p=@(x) -cos(x); 3 q=@(x) x.*x+; 4 r=@(x) +0*x; 5 6 disp(sprintf("%5s %5s %8s %5s","n","j","xj","yj")); 7 for N=.^[5:] 8 [xn,yn]=solvebvp(p,q,r,-,,n,,); 9 j=floor(3/4*n+.05); 0 disp(sprintf("%5d %5d %8.4g %5.0g",N,j,xn(j),yn(j))); end The output is n j xj yj It is clear that y().006 to 5 significant digits. (iii) [ ] Numerically verify the order of convergence of your solution with theoretical expectations. 8

9 Since this ordinary differential equation two-point boundary value problem solver employs a nd order method, theoretical expectations are that the error decreases by a factor of 4 every time n is doubled. The following Matlab program computes an approximation for the exact answer using n = 5 and then checks from n = 6,3,...,04 that the error decreases by a factor of 4 each time. clear all p=@(x) -cos(x); 3 q=@(x) x.*x+; 4 r=@(x) +0*x; 5 6 N=[.^[4:0],^5]; 7 M=length(N); 8 for i=:m 9 [xn,yn]=solvebvp(p,q,r,-,,n(i),,); 0 j=floor(3/4*n(i)+.05); y(i)=yn(j); end 3 e=y-y(m); 4 5 disp(sprintf("%5s %6s %0s %6s","n","y","error","ratio")); 6 for i=:m 7 disp(sprintf("%5d %6.f %0.e %6.f",... 8 N(i),y(i),e(i),e(i)/e(i))); 9 end; The output is n y error ratio e e e e e e The fact that the list of ratios given in the last column of the above table is close to 4 verifies the method is converging with second order. 9

10 3. Consider the initial value problem { y = cos(y) + cos(x) y(0) = 0. (i) Construct a 3rd-order Taylor method for solving this problem. In general, a third order Taylor method has the update rule where y n+ = y n + hf 0 (x n,y n ) + h f (x n,y n ) + h3 3! f (x n,y n ) f i (x,y) = di dx i f(x,y). The following Maple script creates C and Matlab code for a Taylor method with order N and forcing function f. #Build a Taylor method for y =f of order N restart; 3 with(codegen): 4 N:=3; 5 f:=cos(y(x))+cos(x); 6 s:=[seq(diff(y(x),x$(n-i+))=f (N-i),i=..N),y(x)=yn,x=xn]; 7 r[]:=f; 8 for i from to N 9 do 0 r[i]:=diff(r[i],x); end; jet:=seq(f (i)=subs(s,r[i]),i=..n); 3 t:=yn; 4 for i from to N 5 do 6 t:=t+h^i/i!*f (i); 7 end; 8 t:=horner(t,h); 9 jeto:=optimize([jet,yn=t]); 0 C([jeto]); The output of this script is t = cos(yn); t3 = cos(xn); F0 = t+t3; t4 = sin(yn); t6 = sin(xn); F = -t4*f0-t6; t7 = F0*F0; F = -t*t7-t4*f-t3; 0

11 yn = yn+(f0+(f/.0+f*h/6.0)*h)*h; which we embed into Matlab to make the Taylor integrator function yn=taylor3a(x0,y0,xn,n) h=(xn-x0)/n; 3 xn=x0; 4 yn=y0; 5 for n=:n 6 7 % The following Taylor time step was generated by Maple 8 t = cos(yn); 9 t3 = cos(xn); 0 F0 = t+t3; t4 = sin(yn); t6 = sin(xn); 3 F = -t4*f0-t6; 4 t7 = F0*F0; 5 F = -t*t7-t4*f-t3; 6 yn = yn+(f0+(f/.0+f*h/6.0)*h)*h; 7 8 xn=x0+h*n; 9 end; (ii) Compute y(0) to 5 significant digits using your 3rd-order Taylor method. The script for computing y(0) is given by clear all disp(sprintf("%5s %6s","n","y")); 3 for N=.^[3:8]; 4 y=taylor3a(0,0,0,n); 5 disp(sprintf("%5d %6.f",N,y)); 6 end with output n y It is clear that y(0) to 5 significant digits. (iii) [ ] Numerically verify the order of convergence of your code to be 3rd order.

12 Since this is a 3nd order method, theoretical expectations are that the error decreases by a factor of 3 = 8 every time n is doubled. The following Matlab program computes an approximation for the exact answer using n = 5 and then checks from n = 6,3,...,04 that the error decreases by a factor of 8 each time. N=[.^[3:0],^5]; M=length(N); 3 for i=:m 4 y(i)=taylor3a(0,0,0,n(i)); 5 end 6 e=y-y(m); 7 8 disp(sprintf("%5s %6s %0s %6s","n","y","error","ratio")); 9 for i=:m 0 disp(sprintf("%5d %6.f %0.e %6.f",... N(i),y(i),e(i),e(i)/e(i))); end; The output is n y error ratio e e e e e e e The fact that the list of ratios given in the last column of the above table is close to 8 verifies the method is converging with third order.

13 4. Consider the general initial value problem { y = f(x,y) y(x 0 ) = y 0. (i) Starting with Euler s explicit method, use Richardson extrapolation with step sizes h and 3h to create a method that is nd-order convergent. Since Euler s explicit method is first order, it has an asymptotic error formula of the form y(x) y h (x) = hd(x) + h E(x) + O(h 3 ) where y(x) is the exact solution and y h is the approximation obtained by Euler s method. It may be assumed that D(x) and E(x) do not depend greatly on h. Therefore and y(x) y h (x) = hd(x) + 4h E(x) + O(h 3 ) y(x) y 3h (x) = 3hD(x) + 9h E(x) + O(h 3 ). Multiplying the first equation by 3, the second by and subtracting eliminates D(x) and obtains y(x) 3y h (x) + y 3h (x) = 6h E(x) + O(h 3 ). Therefore, the method given by y(x) 3y h (x) y 3h (x) is second order. Starting with (ii) Starting with Euler s explicit method, use Richardson extrapolation with step sizes h, h and 3h to create a method that is 3rd-order convergent. and y(x) y h (x) = hd(x) + h E(x) + O(h 3 ) y(x) y h (x) = hd(x) + 4h E(x) + O(h 3 ). multiply the first equation by and subtract to obtain y(x) y h (x) + y h (x) = h E(x) + O(h 3 ). Now, multiply this result by 3 and subtract from the answer to the previous part to obtain y(x) + 6y h (x) 6y h (x) + y 3h (x) = O(h 3 ). Therefore, the method given by y(x) 3y h (x) 3y h (x) + y 3h (x) is third order. (iii) [ ] Use the 3rd-order method created above to compute y() to 5 significant digits when f(x,y) = xy + (4x/y), x 0 = 0 and y 0 =. 3

14 The extrapolation method may be coded as function yn=richard4c(x0,y0,xn,f,n) h=(xn-x0)/n; 3 xn=x0; 4 yn=y0; 5 for n=:n 6 y=euler4c(xn,yn,xn+h,f,6); 7 y=euler4c(xn,yn,xn+h,f,3); 8 y3=euler4c(xn,yn,xn+h,f,); 9 yn=3*(y-y)+y3; 0 xn=x0+h*n; end; where the Euler method is given by function yn=euler4c(x0,y0,xn,f,n) h=(xn-x0)/n; 3 xn=x0; 4 yn=y0; 5 for n=:n 6 yn=yn+h*f(xn,yn); 7 xn=x0+h*n; 8 end; Test this method using the script clear all f=@(x,y) -x*y+(4*x/y); 3 N=[.^[3:0],^5]; 4 M=length(N); 5 for i=:m 6 y(i)=richard4c(0,,,f,n(i)); 7 end 8 e=y-y(m); 9 0 disp(sprintf("%5s %6s %0s %6s","n","y","error","ratio")); for i=:m disp(sprintf("%5d %6.f %0.e %6.f",... 3 N(i),y(i),e(i),e(i)/e(i))); 4 end; 4

15 which produces the output n y error ratio e e e e e e e Therefore y().986 to 5 significant digits. Moreover, the fact that the list of ratios given in the last column of the above table is close to 8 verifies the method is converging with third order. 5

Application 2.4 Implementing Euler's Method

Application 2.4 Implementing Euler's Method Application 2.4 Implementing Euler's Method One's understanding of a numerical algorithm is sharpened by considering its implementation in the form of a calculator or computer program. Figure 2.4.13 in

More information

x n x n stepnumber k order r error constant C r+1 1/2 5/12 3/8 251/720 abs. stab. interval (α,0) /11-3/10

x n x n stepnumber k order r error constant C r+1 1/2 5/12 3/8 251/720 abs. stab. interval (α,0) /11-3/10 MATH 573 LECTURE NOTES 77 13.8. Predictor-corrector methods. We consider the Adams methods, obtained from the formula xn+1 xn+1 y(x n+1 y(x n ) = y (x)dx = f(x,y(x))dx x n x n by replacing f by an interpolating

More information

Mathematics for chemical engineers

Mathematics for chemical engineers Mathematics for chemical engineers Drahoslava Janovská Department of mathematics Winter semester 2013-2014 Numerical solution of ordinary differential equations Initial value problem Outline 1 Introduction

More information

Direction Fields; Euler s Method

Direction Fields; Euler s Method Direction Fields; Euler s Method It frequently happens that we cannot solve first order systems dy (, ) dx = f xy or corresponding initial value problems in terms of formulas. Remarkably, however, this

More information

over The idea is to construct an algorithm to solve the IVP ODE (9.1)

over The idea is to construct an algorithm to solve the IVP ODE (9.1) Runge- Ku(a Methods Review of Heun s Method (Deriva:on from Integra:on) The idea is to construct an algorithm to solve the IVP ODE (9.1) over To obtain the solution point we can use the fundamental theorem

More information

Module1: Numerical Solution of Ordinary Differential Equations. Lecture 6. Higher order Runge Kutta Methods

Module1: Numerical Solution of Ordinary Differential Equations. Lecture 6. Higher order Runge Kutta Methods Module1: Numerical Solution of Ordinary Differential Equations Lecture 6 Higher order Runge Kutta Methods Keywords: higher order methods, functional evaluations, accuracy Higher order Runge Kutta Methods

More information

ODEs occur quite often in physics and astrophysics: Wave Equation in 1-D stellar structure equations hydrostatic equation in atmospheres orbits

ODEs occur quite often in physics and astrophysics: Wave Equation in 1-D stellar structure equations hydrostatic equation in atmospheres orbits Solving ODEs General Stuff ODEs occur quite often in physics and astrophysics: Wave Equation in 1-D stellar structure equations hydrostatic equation in atmospheres orbits need workhorse solvers to deal

More information

Euler s Methods (a family of Runge- Ku9a methods)

Euler s Methods (a family of Runge- Ku9a methods) Euler s Methods (a family of Runge- Ku9a methods) ODE IVP An Ordinary Differential Equation (ODE) is an equation that contains a function having one independent variable: The equation is coupled with an

More information

Maxima CAS presentation Chelton Evans

Maxima CAS presentation Chelton Evans Maxima CAS presentation 2015-12-01 Chelton Evans Abstract Maxima is a popular copyleft CAS (Computer Algebra System) which can be used for both symbolic and numerical calculation. Chelton Evans will present

More information

SYSTEMS OF NONLINEAR EQUATIONS

SYSTEMS OF NONLINEAR EQUATIONS SYSTEMS OF NONLINEAR EQUATIONS Widely used in the mathematical modeling of real world phenomena. We introduce some numerical methods for their solution. For better intuition, we examine systems of two

More information

Interpolation. TANA09 Lecture 7. Error analysis for linear interpolation. Linear Interpolation. Suppose we have a table x x 1 x 2...

Interpolation. TANA09 Lecture 7. Error analysis for linear interpolation. Linear Interpolation. Suppose we have a table x x 1 x 2... TANA9 Lecture 7 Interpolation Suppose we have a table x x x... x n+ Interpolation Introduction. Polynomials. Error estimates. Runge s phenomena. Application - Equation solving. Spline functions and interpolation.

More information

Discontinuous Galerkin Sparse Grid method for Maxwell s equations

Discontinuous Galerkin Sparse Grid method for Maxwell s equations Discontinuous Galerkin Sparse Grid method for Maxwell s equations Student: Tianyang Wang Mentor: Dr. Lin Mu, Dr. David L.Green, Dr. Ed D Azevedo, Dr. Kwai Wong Motivation u We consider the Maxwell s equations,

More information

Unit #22 - The Chain Rule, Higher Partial Derivatives & Optimization Section 14.7

Unit #22 - The Chain Rule, Higher Partial Derivatives & Optimization Section 14.7 Unit #22 - The Chain Rule, Higher Partial Derivatives & Optimization Section 14.7 Some material from Calculus, Single and MultiVariable by Hughes-Hallett, Gleason, McCallum et. al. Copyright 2005 by John

More information

Math Homework 3

Math Homework 3 Math 0 - Homework 3 Due: Friday Feb. in class. Write on your paper the lab section you have registered for.. Staple the sheets together.. Solve exercise 8. of the textbook : Consider the following data:

More information

A Study on Numerical Exact Solution of Euler, Improved Euler and Runge - Kutta Method

A Study on Numerical Exact Solution of Euler, Improved Euler and Runge - Kutta Method A Study on Numerical Exact Solution of Euler, Improved Euler and Runge - Kutta Method Mrs. P. Sampoornam P.K.R Arts College for Women, Gobichettipalayam Abstract: In this paper, I will discuss the Runge

More information

1.2 Round-off Errors and Computer Arithmetic

1.2 Round-off Errors and Computer Arithmetic 1.2 Round-off Errors and Computer Arithmetic 1 In a computer model, a memory storage unit word is used to store a number. A word has only a finite number of bits. These facts imply: 1. Only a small set

More information

Lecture 3.3 Robust estimation with RANSAC. Thomas Opsahl

Lecture 3.3 Robust estimation with RANSAC. Thomas Opsahl Lecture 3.3 Robust estimation with RANSAC Thomas Opsahl Motivation If two perspective cameras captures an image of a planar scene, their images are related by a homography HH 2 Motivation If two perspective

More information

MAT 275 Laboratory 2 Matrix Computations and Programming in MATLAB

MAT 275 Laboratory 2 Matrix Computations and Programming in MATLAB MATLAB sessions: Laboratory MAT 75 Laboratory Matrix Computations and Programming in MATLAB In this laboratory session we will learn how to. Create and manipulate matrices and vectors.. Write simple programs

More information

f xx + f yy = F (x, y)

f xx + f yy = F (x, y) Application of the 2D finite element method to Laplace (Poisson) equation; f xx + f yy = F (x, y) M. R. Hadizadeh Computer Club, Department of Physics and Astronomy, Ohio University 4 Nov. 2013 Domain

More information

Matlab Notes for Calculus 3. Lia Vas

Matlab Notes for Calculus 3. Lia Vas Matlab Notes for Calculus 3 Lia Vas Content 0. Review of Matlab. Representing Functions. Solving Equations. Basic Graphing. Differentiation and Integration. 1. Vectors. 2. Differentiation of Multi-variable

More information

(Part - 1) P. Sam Johnson. April 14, Numerical Solution of. Ordinary Differential Equations. (Part - 1) Sam Johnson. NIT Karnataka.

(Part - 1) P. Sam Johnson. April 14, Numerical Solution of. Ordinary Differential Equations. (Part - 1) Sam Johnson. NIT Karnataka. P. April 14, 2015 1/51 Overview We discuss the following important methods of solving ordinary differential equations of first / second order. Picard s method of successive approximations (Method of successive

More information

Section 1.1 The Distance and Midpoint Formulas; Graphing Utilities; Introduction to Graphing Equations

Section 1.1 The Distance and Midpoint Formulas; Graphing Utilities; Introduction to Graphing Equations Section 1.1 The Distance and Midpoint Formulas; Graphing Utilities; Introduction to Graphing Equations origin (x, y) Ordered pair (x-coordinate, y-coordinate) (abscissa, ordinate) x axis Rectangular or

More information

Module 2: Single Step Methods Lecture 4: The Euler Method. The Lecture Contains: The Euler Method. Euler's Method (Analytical Interpretations)

Module 2: Single Step Methods Lecture 4: The Euler Method. The Lecture Contains: The Euler Method. Euler's Method (Analytical Interpretations) The Lecture Contains: The Euler Method Euler's Method (Analytical Interpretations) An Analytical Example file:///g /Numerical_solutions/lecture4/4_1.htm[8/26/2011 11:14:40 AM] We shall now describe methods

More information

Application 7.6A The Runge-Kutta Method for 2-Dimensional Systems

Application 7.6A The Runge-Kutta Method for 2-Dimensional Systems Application 7.6A The Runge-Kutta Method for -Dimensional Systems Figure 7.6. in the text lists TI-85 and BASIC versions of the program RKDIM that implements the Runge-Kutta iteration k (,, ) = f tn xn

More information

ODE IVP. An Ordinary Differential Equation (ODE) is an equation that contains a function having one independent variable:

ODE IVP. An Ordinary Differential Equation (ODE) is an equation that contains a function having one independent variable: Euler s Methods ODE IVP An Ordinary Differential Equation (ODE) is an equation that contains a function having one independent variable: The equation is coupled with an initial value/condition (i.e., value

More information

Homework 14 solutions

Homework 14 solutions Section 9.1: Ex 1,5,10,15,16 Section 9.: Ex 1,8,9; AP 1-5,9 Section 9.3: AP 1-5 Section 9.1 Homework 14 solutions 1. (a) Show that y( is a solution to the differential equation by substitution. (b) Find

More information

Ch 09 Multidimensional arrays & Linear Systems. Andrea Mignone Physics Department, University of Torino AA

Ch 09 Multidimensional arrays & Linear Systems. Andrea Mignone Physics Department, University of Torino AA Ch 09 Multidimensional arrays & Linear Systems Andrea Mignone Physics Department, University of Torino AA 2017-2018 Multidimensional Arrays A multidimensional array is an array containing one or more arrays.

More information

Introduction to Computer Programming with MATLAB Calculation and Programming Errors. Selis Önel, PhD

Introduction to Computer Programming with MATLAB Calculation and Programming Errors. Selis Önel, PhD Introduction to Computer Programming with MATLAB Calculation and Programming Errors Selis Önel, PhD Today you will learn Numbers, Significant figures Error analysis Absolute error Relative error Chopping

More information

Homework Set #2-3, Math 475B

Homework Set #2-3, Math 475B Homework Set #2-3, Math 475B Part I: Matlab In the last semester you learned a number of essential features of MATLAB. 1. In this instance, you will learn to make 3D plots and contour plots of z = f(x,

More information

Math/CS 467/667 Combined Programming 2 and Homework 2. The Shu Oscher Method

Math/CS 467/667 Combined Programming 2 and Homework 2. The Shu Oscher Method The Shu Oscher Method Your work should be presented in the form of a typed report using clear and properly punctuated English. Where appropriate include full program listing and output. If you choose to

More information

Answer sheet: Second Midterm for Math 2339

Answer sheet: Second Midterm for Math 2339 Answer sheet: Second Midterm for Math 2339 October 26, 2010 Problem 1. True or false: (check one of the box, and briefly explain why) (1) If a twice differentiable f(x,y) satisfies f x (a,b) = f y (a,b)

More information

PowerPoints organized by Dr. Michael R. Gustafson II, Duke University

PowerPoints organized by Dr. Michael R. Gustafson II, Duke University Part 5 Chapter 19 Numerical Differentiation PowerPoints organized by Dr. Michael R. Gustafson II, Duke University All images copyright The McGraw-Hill Companies, Inc. Permission required for reproduction

More information

Analyzing Fractals SURFACE. Syracuse University. Kara Mesznik. Syracuse University Honors Program Capstone Projects

Analyzing Fractals SURFACE. Syracuse University. Kara Mesznik. Syracuse University Honors Program Capstone Projects Syracuse University SURFACE Syracuse University Honors Program Capstone Projects Syracuse University Honors Program Capstone Projects Spring 5-- Analyzing Fractals Kara Mesznik Follow this and additional

More information

A Quick Guide to Gnuplot. Andrea Mignone Physics Department, University of Torino AA

A Quick Guide to Gnuplot. Andrea Mignone Physics Department, University of Torino AA A Quick Guide to Gnuplot Andrea Mignone Physics Department, University of Torino AA 2017-2018 What is Gnuplot? Gnuplot is a free, command-driven, interactive, function and data plotting program, providing

More information

3.1 Iterated Partial Derivatives

3.1 Iterated Partial Derivatives 3.1 Iterated Partial Derivatives Prof. Tesler Math 20C Fall 2018 Prof. Tesler 3.1 Iterated Partial Derivatives Math 20C / Fall 2018 1 / 19 Higher Derivatives Take the partial derivative of f (x, y) = x

More information

Teaching Manual Math 2131

Teaching Manual Math 2131 Math 2131 Linear Algebra Labs with MATLAB Math 2131 Linear algebra with Matlab Teaching Manual Math 2131 Contents Week 1 3 1 MATLAB Course Introduction 5 1.1 The MATLAB user interface...........................

More information

AMS527: Numerical Analysis II

AMS527: Numerical Analysis II AMS527: Numerical Analysis II A Brief Overview of Finite Element Methods Xiangmin Jiao SUNY Stony Brook Xiangmin Jiao SUNY Stony Brook AMS527: Numerical Analysis II 1 / 25 Overview Basic concepts Mathematical

More information

MATLAB primer for CHE 225

MATLAB primer for CHE 225 MATLAB primer for CHE 225 The following pages contain a brief description of the MATLAB features are used in CHE 225. This document is best used in conjunction with the MATLAB codes posted on Vista. Find

More information

f(0.2) < 0 and f(0.3) > 0 f(1.2) > 0 and f(1.3) < 0 f(1) = 1 > 0 and f(2) 0.

f(0.2) < 0 and f(0.3) > 0 f(1.2) > 0 and f(1.3) < 0 f(1) = 1 > 0 and f(2) 0. 1. [Burden and Faires, Section 1.1 Problem 1]. Show that the following equations have at least one solution in the given intervals. a. xcosx 2x 2 +3x 1 = 0 on [0.2,0.3] and [1.2,1.3]. Let f(x) = xcosx

More information

USING SPREADSHEETS AND DERIVE TO TEACH DIFFERENTIAL EQUATIONS

USING SPREADSHEETS AND DERIVE TO TEACH DIFFERENTIAL EQUATIONS USING SPREADSHEETS AND DERIVE TO TEACH DIFFERENTIAL EQUATIONS Kathleen Shannon, Ph.D. Salisbury State University Department of Mathematics and Computer Science Salisbury, MD 21801 KMSHANNON@SAE.SSU.UMD.EDU

More information

MATH2071: LAB 2: Explicit ODE methods

MATH2071: LAB 2: Explicit ODE methods MATH2071: LAB 2: Explicit ODE methods 1 Introduction Introduction Exercise 1 Euler s method review Exercise 2 The Euler Halfstep (RK2) Method Exercise 3 Runge-Kutta Methods Exercise 4 The Midpoint Method

More information

Numerical Methods Lecture 1

Numerical Methods Lecture 1 Numerical Methods Lecture 1 Basics of MATLAB by Pavel Ludvík The recommended textbook: Numerical Methods Lecture 1 by Pavel Ludvík 2 / 30 The recommended textbook: Title: Numerical methods with worked

More information

MAT 275 Laboratory 3 Numerical Solutions by Euler and Improved Euler Methods (scalar equations)

MAT 275 Laboratory 3 Numerical Solutions by Euler and Improved Euler Methods (scalar equations) MATLAB sessions: Laboratory 3 1 MAT 275 Laboratory 3 Numerical Solutions by Euler and Improved Euler Methods (scalar equations) In this session we look at basic numerical methods to help us understand

More information

22. LECTURE 22. I can define critical points. I know the difference between local and absolute minimums/maximums.

22. LECTURE 22. I can define critical points. I know the difference between local and absolute minimums/maximums. . LECTURE Objectives I can define critical points. I know the difference between local and absolute minimums/maximums. In many physical problems, we re interested in finding the values (x, y) that maximize

More information

MAT 275 Laboratory 2 Matrix Computations and Programming in MATLAB

MAT 275 Laboratory 2 Matrix Computations and Programming in MATLAB MATLAB sessions: Laboratory MAT 75 Laboratory Matrix Computations and Programming in MATLAB In this laboratory session we will learn how to. Create and manipulate matrices and vectors.. Write simple programs

More information

Introduction to Mathcad

Introduction to Mathcad CHAPTER 1 Introduction to Mathcad Mathcad is a product of MathSoft inc. The Mathcad can help us to calculate, graph, and communicate technical ideas. It lets us work with mathematical expressions using

More information

Matlab Notes for Mathematical Modeling. Lia Vas

Matlab Notes for Mathematical Modeling. Lia Vas Matlab Notes for Mathematical Modeling Lia Vas Content 1. Review of Matlab in Calculus 1 1.1 Basic arithmetic 1.2 Solving equations using solve 1.3 Representing functions 1.4 Graphics 1.5 Solving equations

More information

over The idea is to construct an algorithm to solve the IVP ODE (8.1)

over The idea is to construct an algorithm to solve the IVP ODE (8.1) Runge- Ku(a Methods Review of Heun s Method (Deriva:on from Integra:on) The idea is to construct an algorithm to solve the IVP ODE (8.1) over To obtain the solution point we can use the fundamental theorem

More information

Summer 2009 REU: Introduction to Matlab

Summer 2009 REU: Introduction to Matlab Summer 2009 REU: Introduction to Matlab Moysey Brio & Paul Dostert June 29, 2009 1 / 19 Using Matlab for the First Time Click on Matlab icon (Windows) or type >> matlab & in the terminal in Linux. Many

More information

Learning Packet. Lesson 6 Exponents and Rational Functions THIS BOX FOR INSTRUCTOR GRADING USE ONLY

Learning Packet. Lesson 6 Exponents and Rational Functions THIS BOX FOR INSTRUCTOR GRADING USE ONLY Learning Packet Student Name Due Date Class Time/Day Submission Date THIS BOX FOR INSTRUCTOR GRADING USE ONLY Mini-Lesson is complete and information presented is as found on media links (0 5 pts) Comments:

More information

Introduction to numerical algorithms

Introduction to numerical algorithms Introduction to numerical algorithms Given an algebraic equation or formula, we may want to approximate the value, and while in calculus, we deal with equations or formulas that are well defined at each

More information

ECON 502 INTRODUCTION TO MATLAB Nov 9, 2007 TA: Murat Koyuncu

ECON 502 INTRODUCTION TO MATLAB Nov 9, 2007 TA: Murat Koyuncu ECON 502 INTRODUCTION TO MATLAB Nov 9, 2007 TA: Murat Koyuncu 0. What is MATLAB? 1 MATLAB stands for matrix laboratory and is one of the most popular software for numerical computation. MATLAB s basic

More information

Objectives Graph and Analyze Rational Functions Find the Domain, Asymptotes, Holes, and Intercepts of a Rational Function

Objectives Graph and Analyze Rational Functions Find the Domain, Asymptotes, Holes, and Intercepts of a Rational Function SECTIONS 3.5: Rational Functions Objectives Graph and Analyze Rational Functions Find the Domain, Asymptotes, Holes, and Intercepts of a Rational Function I. Rational Functions A rational function is a

More information

Homework Set 5 (Sections )

Homework Set 5 (Sections ) Homework Set 5 (Sections.4-.6) 1. Consider the initial value problem (IVP): = 8xx yy, yy(1) = 3 a. Do 10 steps of Euler s Method, using a step size of 0.1. Write the details in the table below. Work to

More information

Daily WeBWorK, #1. This means the two planes normal vectors must be multiples of each other.

Daily WeBWorK, #1. This means the two planes normal vectors must be multiples of each other. Daily WeBWorK, #1 Consider the ellipsoid x 2 + 3y 2 + z 2 = 11. Find all the points where the tangent plane to this ellipsoid is parallel to the plane 2x + 3y + 2z = 0. In order for the plane tangent to

More information

Natasha S. Sharma, PhD

Natasha S. Sharma, PhD Revisiting the function evaluation problem Most functions cannot be evaluated exactly: 2 x, e x, ln x, trigonometric functions since by using a computer we are limited to the use of elementary arithmetic

More information

Mathematical Methods and Modeling Laboratory class. Numerical Integration of Ordinary Differential Equations

Mathematical Methods and Modeling Laboratory class. Numerical Integration of Ordinary Differential Equations Mathematical Methods and Modeling Laboratory class Numerical Integration of Ordinary Differential Equations Exact Solutions of ODEs Cauchy s Initial Value Problem in normal form: Recall: if f is locally

More information

1) Generate a vector of the even numbers between 5 and 50.

1) Generate a vector of the even numbers between 5 and 50. MATLAB Sheet 1) Generate a vector of the even numbers between 5 and 50. 2) Let x = [3 5 4 2 8 9]. a) Add 20 to each element. b) Subtract 2 from each element. c) Add 3 to just the odd index elements. d)

More information

MAT 275 Laboratory 2 Matrix Computations and Programming in MATLAB

MAT 275 Laboratory 2 Matrix Computations and Programming in MATLAB MAT 75 Laboratory Matrix Computations and Programming in MATLAB In this laboratory session we will learn how to. Create and manipulate matrices and vectors.. Write simple programs in MATLAB NOTE: For your

More information

Precomposing Equations

Precomposing Equations Precomposing Equations Let s precompose the function f(x) = x 3 2x + 9 with the function g(x) = 4 x. (Precompose f with g means that we ll look at f g. We would call g f postcomposing f with g.) f g(x)

More information

3.3 Here are VBA and MATLAB implementations of the algorithm:

3.3 Here are VBA and MATLAB implementations of the algorithm: 1 CHAPTER 3 3.1 (a) (b) (c) (101101) (101.101) (0.01101) 5 (1 ) (0 ) (1 ) (1 ) (0 ) (1 ) 3 8 4 1 45 4 1 0.5 0.15 5.65 4 1 (1 ) (0 ) (1 ) (1 (0 1 ) (1 ) (1 0.5 0.15 0.0315 0.4065 3 0 3 ) (0 1 4 1 ) (0 )

More information

Solving Algebraic Equations

Solving Algebraic Equations Lesson 4. Solving Algebraic Equations 3 3 3 3 3 8 8 4 Add 3 to both sides. Divide both sides by. 4 gives the solution of the equation 3. Check: Substitute 4 for x into the original equation. 3 4 3 When

More information

LECTURE 18 - OPTIMIZATION

LECTURE 18 - OPTIMIZATION LECTURE 18 - OPTIMIZATION CHRIS JOHNSON Abstract. In this lecture we ll describe extend the optimization techniques you learned in your first semester calculus class to optimize functions of multiple variables.

More information

Assignment Assignment for Lesson 9.1

Assignment Assignment for Lesson 9.1 Assignment Assignment for Lesson.1 Name Date Shifting Away Vertical and Horizontal Translations 1. Graph each cubic function on the grid. a. y x 3 b. y x 3 3 c. y x 3 3 2. Graph each square root function

More information

What is log a a equal to?

What is log a a equal to? How would you differentiate a function like y = sin ax? What is log a a equal to? How do you prove three 3-D points are collinear? What is the general equation of a straight line passing through (a,b)

More information

Bindel, Spring 2015 Numerical Analysis (CS 4220) Figure 1: A blurred mystery photo taken at the Ithaca SPCA. Proj 2: Where Are My Glasses?

Bindel, Spring 2015 Numerical Analysis (CS 4220) Figure 1: A blurred mystery photo taken at the Ithaca SPCA. Proj 2: Where Are My Glasses? Figure 1: A blurred mystery photo taken at the Ithaca SPCA. Proj 2: Where Are My Glasses? 1 Introduction The image in Figure 1 is a blurred version of a picture that I took at the local SPCA. Your mission

More information

A Quick Tutorial on MATLAB. Zeeshan Ali

A Quick Tutorial on MATLAB. Zeeshan Ali A Quick Tutorial on MATLAB Zeeshan Ali MATLAB MATLAB is a software package for doing numerical computation. It was originally designed for solving linear algebra type problems using matrices. It's name

More information

Introduction to MATLAB Programming

Introduction to MATLAB Programming July 23, 2017 Appendix D Introduction to MATLAB Programming Contents D.1 Getting Started............................. 2 D.2 Basic m-file................................ 3 D.2.1 Printing..................................

More information

Minima, Maxima, Saddle points

Minima, Maxima, Saddle points Minima, Maxima, Saddle points Levent Kandiller Industrial Engineering Department Çankaya University, Turkey Minima, Maxima, Saddle points p./9 Scalar Functions Let us remember the properties for maxima,

More information

Ordinary differential equations solving methods

Ordinary differential equations solving methods Radim Hošek, A07237 radhost@students.zcu.cz Ordinary differential equations solving methods Problem: y = y2 (1) y = x y (2) y = sin ( + y 2 ) (3) Where it is possible we try to solve the equations analytically,

More information

-t:ma. u V:. 1! *VV; jf >*4: t i f n - v i ' ONABI E :VISITd:Rs ; 8 A EASTBOURNE, SAT. 5? -tesiste- COLLEGE. D ressm aker.

-t:ma. u V:. 1! *VV; jf >*4: t i f n - v i ' ONABI E :VISITd:Rs ; 8 A EASTBOURNE, SAT. 5? -tesiste- COLLEGE. D ressm aker. \ [ «* 33 3 5 «*» \ *? ^V- *VV >*4 J & & V! V Q Y x - X 8 - - 5 ( J 8 V Y X^ * V * V * ( ) ( --------- x () x J ( * -) V - V Y Y 8! -) Y Y Y8 ( - ) > Y - 8 Y - x x -- x ( ) 7 6 3 - Q V 4 6 8 V

More information

Regularization by multigrid-type algorithms

Regularization by multigrid-type algorithms Regularization by multigrid-type algorithms Marco Donatelli Department of Physics and Mathematics University of Insubria Joint work with S. Serra-Capizzano Outline 1 Restoration of blurred and noisy images

More information

Adding and subtracting rational expressions is quite similar to adding and subtracting rational numbers (fractions).

Adding and subtracting rational expressions is quite similar to adding and subtracting rational numbers (fractions). 7.2: Adding and Subtracting Rational Expressions, Simplifying Complex Fractions Adding and subtracting rational expressions is quite similar to adding and subtracting rational numbers (fractions). Adding

More information

MAT 275 Laboratory 3 Numerical Solutions by Euler and Improved Euler Methods (scalar equations)

MAT 275 Laboratory 3 Numerical Solutions by Euler and Improved Euler Methods (scalar equations) MAT 275 Laboratory 3 Numerical Solutions by Euler and Improved Euler Methods (scalar equations) In this session we look at basic numerical methods to help us understand the fundamentals of numerical approximations.

More information

= f (a, b) + (hf x + kf y ) (a,b) +

= f (a, b) + (hf x + kf y ) (a,b) + Chapter 14 Multiple Integrals 1 Double Integrals, Iterated Integrals, Cross-sections 2 Double Integrals over more general regions, Definition, Evaluation of Double Integrals, Properties of Double Integrals

More information

MATLAB QUICK START TUTORIAL

MATLAB QUICK START TUTORIAL MATLAB QUICK START TUTORIAL This tutorial is a brief introduction to MATLAB which is considered one of the most powerful languages of technical computing. In the following sections, the basic knowledge

More information

An Investigation into Iterative Methods for Solving Elliptic PDE s Andrew M Brown Computer Science/Maths Session (2000/2001)

An Investigation into Iterative Methods for Solving Elliptic PDE s Andrew M Brown Computer Science/Maths Session (2000/2001) An Investigation into Iterative Methods for Solving Elliptic PDE s Andrew M Brown Computer Science/Maths Session (000/001) Summary The objectives of this project were as follows: 1) Investigate iterative

More information

2-3 Graphing Rational Functions

2-3 Graphing Rational Functions 2-3 Graphing Rational Functions Factor What are the end behaviors of the Graph? Sketch a graph How to identify the intercepts, asymptotes and end behavior of a rational function. How to sketch the graph

More information

Numerical Solutions of Differential Equations (1)

Numerical Solutions of Differential Equations (1) Numerical Solutions of Differential Equations (1) Euler method Sources of error Truncation Round-off error Error balance in numerical integration Euler Method Many differential equations don't have an

More information

MATH2071: LAB 1(b): Selected topics in Matlab. This version of the first lab is intended only for students who have already taken Math 2070.

MATH2071: LAB 1(b): Selected topics in Matlab. This version of the first lab is intended only for students who have already taken Math 2070. MATH2071: LAB 1(b): Selected topics in Matlab 1 Introduction Introduction Exercise 1 Adaptive Quadrature Exercise 2 Roundoff errors Exercise 3 Extra Credit Exercise 4 Exercise 5 Exercise 6 Exercise 7 Exercise

More information

Numerical Methods for Differential Equations Contents Review of numerical integration methods Rectangular Rule Trapezoidal Rule Simpson s Rule How to

Numerical Methods for Differential Equations Contents Review of numerical integration methods Rectangular Rule Trapezoidal Rule Simpson s Rule How to Numerical Methods for Differential Equations Contents Review of numerical integration methods Rectangular Rule Trapezoidal Rule Simpson s Rule How to make a connect-the-dots graphic Numerical Methods for

More information

Introduction to Matlab

Introduction to Matlab Technische Universität München WT 21/11 Institut für Informatik Prof Dr H-J Bungartz Dipl-Tech Math S Schraufstetter Benjamin Peherstorfer, MSc October 22nd, 21 Introduction to Matlab Engineering Informatics

More information

College Algebra. Quadratic Functions and their Graphs. Dr. Nguyen October 12, Department of Mathematics UK

College Algebra. Quadratic Functions and their Graphs. Dr. Nguyen October 12, Department of Mathematics UK College Algebra Quadratic Functions and their Graphs Dr. Nguyen nicholas.nguyen@uky.edu Department of Mathematics UK October 12, 2018 Agenda Quadratic functions and their graphs Parabolas and vertices

More information

3.2 Recursions One-term recursion, searching for a first occurrence, two-term recursion. 2 sin.

3.2 Recursions One-term recursion, searching for a first occurrence, two-term recursion. 2 sin. Chapter 3 Sequences 3.1 Summation Nested loops, while-loops with compound termination criteria 3.2 Recursions One-term recursion, searching for a first occurrence, two-term recursion. In Chapter 2 we played

More information

2-4 Graphing Rational Functions

2-4 Graphing Rational Functions 2-4 Graphing Rational Functions Factor What are the zeros? What are the end behaviors? How to identify the intercepts, asymptotes, and end behavior of a rational function. How to sketch the graph of a

More information

Computer Simulations

Computer Simulations Computer Simulations A practical approach to simulation Semra Gündüç gunduc@ankara.edu.tr Ankara University Faculty of Engineering, Department of Computer Engineering 2014-2015 Spring Term Ankara University

More information

On the regularizing power of multigrid-type algorithms

On the regularizing power of multigrid-type algorithms On the regularizing power of multigrid-type algorithms Marco Donatelli Dipartimento di Fisica e Matematica Università dell Insubria www.mat.unimi.it/user/donatel Outline 1 Restoration of blurred and noisy

More information

Simulation of Mechatronic Systems

Simulation of Mechatronic Systems Examination WS 2002/2003 Simulation of Mechatronic Systems Prof. Dr.-Ing. K. Wöllhaf Remarks: Check if the examination is complete (9 pages) Put your name and Matr.Nr. on any sheet of paper You must not

More information

A method to speedily pairwise compare in AHP and ANP

A method to speedily pairwise compare in AHP and ANP ISAHP 2005, Honolulu, Hawaii, July 8-10, 2005 A method to speedily pairwise compare in AHP and ANP Kazutomo Nishizawa Department of Mathematical Information Engineering, College of Industrial Technology,

More information

7.1 INVERSE FUNCTIONS

7.1 INVERSE FUNCTIONS 1 7.1 INVERSE FUNCTIONS One to one functions are important because their equations, f(x) = k, have (at most) a single solution. One to one functions are also important because they are the functions that

More information

Introduction to Programming for Engineers Spring Final Examination. May 10, Questions, 170 minutes

Introduction to Programming for Engineers Spring Final Examination. May 10, Questions, 170 minutes Final Examination May 10, 2011 75 Questions, 170 minutes Notes: 1. Before you begin, please check that your exam has 28 pages (including this one). 2. Write your name and student ID number clearly on your

More information

Jason Yalim. Here we perform a few tasks to ensure a clean working environment for our script.

Jason Yalim. Here we perform a few tasks to ensure a clean working environment for our script. Table of Contents Initialization... 1 Part One -- Computation... 1 Part Two -- Plotting... 5 Part Three -- Plotting Incorrectly... 7 Part Four -- Showing Output Adjacent to Code... 8 Part Five -- Creating

More information

Things to Know for the Algebra I Regents

Things to Know for the Algebra I Regents Types of Numbers: Real Number: any number you can think of (integers, rational, irrational) Imaginary Number: square root of a negative number Integers: whole numbers (positive, negative, zero) Things

More information

Introduction to MATLAB

Introduction to MATLAB Introduction to MATLAB Anthony J. O Connor School of Science, Griffith University, Brisbane, Australia 1. What is MATLAB? MATLAB started as an interactive program for doing matrix calculations and has

More information

A Random Variable Shape Parameter Strategy for Radial Basis Function Approximation Methods

A Random Variable Shape Parameter Strategy for Radial Basis Function Approximation Methods A Random Variable Shape Parameter Strategy for Radial Basis Function Approximation Methods Scott A. Sarra, Derek Sturgill Marshall University, Department of Mathematics, One John Marshall Drive, Huntington

More information

1 of 34 7/9/2018, 8:08 AM

1 of 34 7/9/2018, 8:08 AM of 34 7/9/08, 8:08 AM Student: Date: Instructor: Alfredo Alvarez Course: Math 040 Spring 08 Assignment: Math 040 Homework3bbbbtsilittle. Graph each integer in the list on the same number line. 3, 3, 5,

More information

PHS3XXX Computational Physics

PHS3XXX Computational Physics 1 PHS3XXX Computational Physics Lecturer: Mike Wheatland michael.wheatland@sydney.edu.au Lecture and lab schedule (SNH Learning Studio 4003) 1 There are 10 weeks of lectures and labs Lectures: Mon 9am

More information

Mathematical preliminaries and error analysis

Mathematical preliminaries and error analysis Mathematical preliminaries and error analysis Tsung-Ming Huang Department of Mathematics National Taiwan Normal University, Taiwan August 28, 2011 Outline 1 Round-off errors and computer arithmetic IEEE

More information

Today. Motivation. Motivation. Image gradient. Image gradient. Computational Photography

Today. Motivation. Motivation. Image gradient. Image gradient. Computational Photography Computational Photography Matthias Zwicker University of Bern Fall 009 Today Gradient domain image manipulation Introduction Gradient cut & paste Tone mapping Color-to-gray conversion Motivation Cut &

More information

Convexization in Markov Chain Monte Carlo

Convexization in Markov Chain Monte Carlo in Markov Chain Monte Carlo 1 IBM T. J. Watson Yorktown Heights, NY 2 Department of Aerospace Engineering Technion, Israel August 23, 2011 Problem Statement MCMC processes in general are governed by non

More information