Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Solving Tri-Diagonal Linear Systems using Crout Factorization Algorithm, Assignments of Mathematics

A homework problem based on solving boundary-value problems of differential equations using central differences and tri-diagonal linear systems. It includes instructions to implement algorithm 6.7 (crout factorization algorithm) in c++ for a tri-diagonal linear system of arbitrary size, and to compute the approximate solution w for given values of n and compare it with the exact solution at x = 1/2. The problem also asks to determine the value of n for which the error is below 10^-5.

Typology: Assignments

Pre 2010

Uploaded on 08/31/2009

koofers-user-ge5
koofers-user-ge5 🇺🇸

10 documents

1 / 1

Toggle sidebar

Related documents


Partial preview of the text

Download Solving Tri-Diagonal Linear Systems using Crout Factorization Algorithm and more Assignments Mathematics in PDF only on Docsity! M348 Homework #13 Burden and Faires. Section 6.6 (#2abc, 4b, 6b). Ortega and Grimshaw. Chapter 19: #19.1, 19.4. Programming mini-project. In contrast to initial-value problems, where the approximate solution is obtained by marching forward, boundary-value problems lead to a system of equations. For example, when discretized using central differences on a uniform grid, the boundary-value problem u′′(x) − q(x)u(x) = f(x), 0 ≤ x ≤ 1, u(0) = α, u(1) = β, x x 10 0 n+1 leads to the tri-diagonal linear system of equations         d1 1 0 0 0 0 1 d2 1 0 0 0 0 1 d3 1 0 0 . . . 0 0 0 1 dn−1 1 0 0 0 0 1 dn                 w1 w2 w3 ... wn−1 wn         =         h2f1 − α h2f2 h2f3 ... h2fn−1 h2fn − β         where di = −(2+h 2qi) and h = 1/(n+1) is the grid spacing. Here we use a linear system solver to study the approximate solution wi as the grid is refined. We consider the case when q(x) = 4, f(x) = 2x, α = 0, β = 1 and for reference we note that the exact solution is u(x) = (3e2−2x − 3e2+2x + xe4 − x)/(2− 2e4). (a) Write a C++ program to implement Algorithm 6.7 from the Burden and Faires text (Crout Fac- torization Algorithm) for a tri-diagonal linear system Aw = b of arbitrary size n. (b) Use your program to compute w for n = 10, 20 and 40 and compare the approximate and actual solutions at x = 1/2. Does the error decrease as n is increased? For what value of n is the error below 10−5?
Docsity logo



Copyright © 2024 Ladybird Srl - Via Leonardo da Vinci 16, 10126, Torino, Italy - VAT 10816460017 - All rights reserved