Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a MATLAB function that solves tridiagonal systems of equations of size n. Assume that no pivoting is needed, but do not assume that the

Write a MATLAB function that solves tridiagonal systems of equations of size n. Assume that no pivoting is needed, but do not assume that the tridiagonal matrix A is symmetric. Your program should expect as input four vectors of size n (or n — I): one right-hand-side b and the three nonzero diagonals of A. It should calculate and return x = A— lb using a Gaussian elimination variant that requires 0(n) flops and consumes no additional space as a function of n (i.e., in total 5n storage locations are required).

Try your program on the matrix defined by n = 10, a i-1 , i = a i+1 , i = —i, and ai, i = 3i for all i such that the relevant indices fall in the range 1 to n. Invent a right-hand-side vector b.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

Matlab code for Gaussian elimination clear all close all creating tridiagonal matrix for 1st part fp... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

An Introduction to the Mathematics of Financial Derivatives

Authors: Ali Hirsa, Salih N. Neftci

3rd edition

012384682X, 978-0123846822

More Books

Students also viewed these Programming questions

Question

Write a Matlab function to price an European call.

Answered: 1 week ago