linear equations with indexed variables?
- To: mathgroup at smc.vnet.net
 - Subject: [mg6896] linear equations with indexed variables?
 - From: hxie at gradin.cis.upenn.edu (Hong-liang Xie)
 - Date: Fri, 25 Apr 1997 14:00:30 -0400 (EDT)
 - Organization: University of Pennsylvania
 - Sender: owner-wri-mathgroup at wolfram.com
 
I am new to Mathematica and I need to solve a system of 
linear equations whose variables are indexed (i.e., x[1], 
x[2], x[3]), for example,
       3x[i] = 2x[i+1] + x[i-1] ( 1 <= i <= 3)
       x[4 ]  = 1
       x[0]   = 0
The above is a system of 5 linear equations with
5 variables x[0], x[1], x[2], x[3], x[4].  I can certainly
rewrite it into 5 equations using 5 variables x0, x1, x2, 
x3, x4.  However, if the range of i gets bigger, or, worse, 
if each x has two indexes as in x[i,j], this rewriting could 
get of hand quickly.  I tried different equation solving 
functions in Mathematica but with no luck.  I would therefore 
appreciate help from experts here on how to solve this kind of 
equations directly.  Thanks a lot!
Hong
CIS Dept
Univ of Pennsylvania