Linear boundary value problems:

Slides:



Advertisements
Similar presentations
Matrix Representation
Advertisements

Parabolic Partial Differential Equations
Refresher: Vector and Matrix Algebra Mike Kirkpatrick Department of Chemical Engineering FAMU-FSU College of Engineering.
Chapter 2, Linear Systems, Mainly LU Decomposition.
ECIV 301 Programming & Graphics Numerical Methods for Engineers Lecture 14 Elimination Methods.
Differential Equations and Boundary Value Problems
Warm-Up Solving Systems of Equations Learning Targets l Refresher on solving systems of equations l Matrices –Operations –Uses –Reduced Row Echelon.
Today’s class Boundary Value Problems Eigenvalue Problems
Chapter 10 Review: Matrix Algebra
Academy Algebra II/Trig
CHAPTER 2 MATRIX. CHAPTER OUTLINE 2.1 Introduction 2.2 Types of Matrices 2.3 Determinants 2.4 The Inverse of a Square Matrix 2.5 Types of Solutions to.
Solving Systems of 3 or More Variables Why a Matrix? In previous math classes you solved systems of two linear equations using the following method:
1 MAC 2103 Module 3 Determinants. 2 Rev.F09 Learning Objectives Upon completing this module, you should be able to: 1. Determine the minor, cofactor,
4.7 Identity and Inverse Matrices and Solving Systems of Equations Objectives: 1.Determine whether two matrices are inverses. 2.Find the inverse of a 2x2.
1 EEE 431 Computational Methods in Electrodynamics Lecture 4 By Dr. Rasime Uyguroglu
Domain Range definition: T is a linear transformation, EIGENVECTOR EIGENVALUE.
SOLVING SYSTEMS ALGEBRAICALLY SECTION 3-2. SOLVING BY SUBSTITUTION 1) 3x + 4y = 12 STEP 1 : SOLVE ONE EQUATION FOR ONE OF THE VARIABLES 2) 2x + y = 10.
Linear algebra: matrix Eigen-value Problems Eng. Hassan S. Migdadi Part 1.
Elliptic PDEs and the Finite Difference Method
Class Opener:. Identifying Matrices Student Check:
Boundary Value Problems l Up to this point we have solved differential equations that have all of their initial conditions specified. l There is another.
Section 7-3 Solving 3 x 3 systems of equations. Solving 3 x 3 Systems  substitution (triangular form)  Gaussian elimination  using an augmented matrix.
Linear Algebra Diyako Ghaderyan 1 Contents:  Linear Equations in Linear Algebra  Matrix Algebra  Determinants  Vector Spaces  Eigenvalues.
Ch11: Normal Modes 1. Review diagonalization and eigenvalue problem 2. Normal modes of Coupled oscillators (3 springs, 2 masses) 3. Case of Weakly coupled.
3.6 Solving Systems Using Matrices You can use a matrix to represent and solve a system of equations without writing the variables. A matrix is a rectangular.
Review of Matrix Operations Vector: a sequence of elements (the order is important) e.g., x = (2, 1) denotes a vector length = sqrt(2*2+1*1) orientation.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Chapter 27.
Warm- Up Solve the following systems using elimination or substitution : 1. x + y = 6 -3x + y = x + 4y = 7 x + 2y = 7.
Arab Open University Faculty of Computer Studies M132: Linear Algebra
Linear Algebra Diyako Ghaderyan 1 Contents:  Linear Equations in Linear Algebra  Matrix Algebra  Determinants  Vector Spaces  Eigenvalues.
Solving Linear Systems by Substitution
Solving Systems of Linear equations with 3 Variables To solve for three variables, we need a system of three independent equations.
1/15 Fun Matrix Facts and Tricks Ben G. Fitzpatrick Department of Mathematics Loyola Marymount University One LMU Drive.
Reduced echelon form Matrix equations Null space Range Determinant Invertibility Similar matrices Eigenvalues Eigenvectors Diagonabilty Power.
Ordinary Differential Equations (ODEs). Objectives of Topic  Solve Ordinary Differential Equations (ODEs).  Appreciate the importance of numerical methods.
10.4 Matrix Algebra. 1. Matrix Notation A matrix is an array of numbers. Definition Definition: The Dimension of a matrix is m x n “m by n” where m =
1 Week 11 Numerical methods for ODEs 1.The basics: finite differences, meshes 2.The Euler method.
Use Inverse Matrices to Solve Linear Systems
Chapter 7: Systems of Equations and Inequalities; Matrices
Ch. 7 – Matrices and Systems of Equations
Eigenfaces (for Face Recognition)
Engineering Problem Solution
Modeling and Simulation Dr. Mohammad Kilani
Chapter 2, Linear Systems, Mainly LU Decomposition
Review of Matrix Operations
Linear Systems, Mainly LU Decomposition
Systems of Equations Lesson 41: Solve by using a matrix
Advanced Numerical Methods (S. A. Sahu) Code: AMC 51151
Linearized Block Implicit (LBI) Method applied to Quasi-1D Flow
CHE 391 T. F. Edgar Spring 2012.
Systems of First Order Linear Equations
Java for Beginners University Greenwich Computing At School DASCO
SE301: Numerical Methods Topic 8 Ordinary Differential Equations (ODEs) Lecture KFUPM (Term 101) Section 04 Read , 26-2, 27-1 CISE301_Topic8L4&5.
Linear Systems Chapter 3.
Chapter 27.
Use Inverse Matrices to Solve Linear Systems
Ordinary differential equaltions:
Chapter 7: Matrices and Systems of Equations and Inequalities
Simultaneous Equations
Unit 3: Matrices
Matrix Solutions to Linear Systems
Linear Algebra Lecture 3.
Numerical Analysis Lecture13.
Eigenvalues and Eigenvectors
Chapter 7: Matrices and Systems of Equations and Inequalities
Boundary value problems:
Laplace Transforms Important analytical method for solving linear ordinary differential equations. - Application to nonlinear ODEs? Must linearize first.
Laplace Transforms Important analytical method for solving linear ordinary differential equations. - Application to nonlinear ODEs? Must linearize first.
CISE301: Numerical Methods Topic 8 Ordinary Differential Equations (ODEs) Lecture KFUPM Read , 26-2, 27-1 CISE301_Topic8L1 KFUPM.
Boundary value problems workshop
Presentation transcript:

Linear boundary value problems: Matrix methods Aims: write boundary value problem for ODE as a matrix equation. use NAG (Numerical Algorithms group) routine to solve the matrix problem.

Setting up the problem: linear 2nd order ODE boundary conditions Discretize the independent variable, t.

Discretizing t: the function Continuum: Numerical:

Discretizing t, the derivatives: Taylor expand the function x(t) Solve for , Solve for , Substitute these into the continuum ODE to get a set of linear equations for the unknowns xn.

The equation: Eg. The boundary conditions: The analytic solution:

the discretized equation is Try n=1 n=2 n=3

given that the boundary conditions are: x0=0, x4=1, we arrive at which we can write in matrix form Now solve with linear algebra, e.g. row reduction, matrix inversion…

in this example we have that for general this “tri-diagonal” structure comes from the discrete version of the derivative operator. We can think of the derivative operator as connecting neighbouring lattice points, as exemplified by the above equation.

Back to Schrodinger’s equation: matrix method we want to solve subject to the boundary conditions

Back to Schrodinger’s equation: matrix method introduce the rescaled quantities introduce the finite difference derivatives to get it is our aim to find E (i.e. ) and

We then get the series of linear equations Or, in matrix form This is now a matrix eigenvalue problem, which we can solve to find the eigenvalues And the eigenvectors, n. This gives us the E we are after.

We could try to solve using the standard technique from matrix algebra; the characteristic equation This leads to a large order polynomial and is intractable analytically. Fortunately there are people who have solved this before, the Numerical Algorithms Group, NAG. We shall be using a particular routine which solves the eigenvalue, eigenvector problem for tri-diagonal matrices, “F08JEF”.

Using NAG routines in C create a folder in which your program will live write your C program, remembering to include the NAG routines, in the new folder In Plato, click on “New Project” in the file menu Click on C++ application, enter a name for your project, and choose the location to be the folder you just created. A new “Project Explorer” window will appear on the right. Right-click on “references”, then left-click on “add reference” Choose “Nag_mk21” on the P-drive, by clicking on the “MyComputer” icon Go into the “bin” folder and double-click on “FLDLL214Z_nag.dll” Right-click on “Source Files” in the “Project Explorer” window, choose “Add Existing Items” and select your C program. #include <nagmk21.h> //link to NAG library #include <stdio.h> #include <math.h> #include <stdlib.h> main(void) { … }

F08JEF: the tri-diagonal NAG routine #include <nagmk21.h> //link to NAG library #include <stdio.h> #include <math.h> #include <stdlib.h> int const N=100; //Size of matrix main(void) { char COMPZ='I'; //Calculate eigenvalues and eigenvectors int CLEN=1; //Character length int INFO=0; //Gives error information double D[N]; //Input diagonal elements //and returns eigenvalues double E[N-1]; //Input off diagonal elements double Z[N][N]; //Returns array of eigenvectors //as Z[quantum state][i] double WORK[2*(N-1)]; //Work space int i; for(i=0;i<N;i++) D[i]= 1.0; //Diagonal elements go here for(i=0;i<N-1;i++) E[i]= 2.0; //Off diagonal elements go here F08JEF(&COMPZ,CLEN,&N,(double *)D,(double *)E,(double *)Z,&N,(double *)WORK,&INFO); printf("%f\n",D[i]); //Print eigenvalues printf("%f\n",Z[0][i]); //Print first eigenvector }

F08JEF and the harmonic oscillator: For the harmonic oscillator the diagonal elements are the off-diagonal elements are E[i]=-1; the results depend on N and x N=500, x=0.1 gives En=0.994.., 2.9969.., 4.9919.. N=100, x=0.1 gives En=0.994.., 2.9969.., 4.9919.. N=50, x=0.1 gives En=1.007.., 3.083.., 5.397.. the higher eigenvalues are not so well measured because the eigenfunctions spread out beyond our lattice size.