Thread Subject:
Right hand values of linear systems

Subject: Right hand values of linear systems

From: Ryan

Date: 29 Nov, 2010 03:55:04

Message: 1 of 1

for a tridiagonal matrix, where the matrix is nxn, the right hand side is: b_i = 6/h^2*(y_i+1-2*y_i+y_i-1), i = 1...n where y_i = cos(i*h), i = 0...n+1 and h = pi/(n+1).

Instead I just wrote the equation as b_i+1 = 6/h^2*(cos((i+2)*h) - 2*cos((i+1)*h) + cos(i*h), where h = pi/(n+1) since it seemed easier to organize.
I want to solve the tridiagonal system and analyze what happens when n increases. But I'm not sure how to do this.

Here's what I have so far:

array=zeros(1,4)
for i=1:4
h=pi/(i+1)
array(i)=h
end

array2=zeros(1,4)
for ii=1:4
d=6./array.^2.*(cos((i+2).*array)-2.*cos((i+1).*array)+cos(i.*array))
array2(ii)=d
end

Please help. Thanks so much!

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
iteration Ryan 28 Nov, 2010 22:59:05
loops Ryan 28 Nov, 2010 22:59:05
matrix Ryan 28 Nov, 2010 22:59:05
tridiagonal Ryan 28 Nov, 2010 22:59:05
numerical analysis Ryan 28 Nov, 2010 22:59:05
array indexing Ryan 28 Nov, 2010 22:59:05
rssFeed for this Thread

Contact us