Solving 1D Poisson's equation approximation using a linear system
Problem: Find the temperature distribution T(x) along a one-dimensional rod heated by a heat source f(x). The rod has unit length, with boundary conditions T(0) = 0 and T(1) = 0. The heat source is represented by f(x) = max(0, 1-(x-xc)^2/d^2), where d is the half-width of the heated region and xc is the center of the heated region.
The numerical approach being taken is to discretize the rod into n interior points x[i] = i*h for i = 1,2,...,n, where h = 1/(n+1) is the distance between points. Poission's equation is approximated as T[i-1] - 2T[i] + T[i+1] = -A*h^2*f[i], where T[i] ~= T(x[i]) and f[i] = f(x[i]). This equation is the ith equation of n equations (one for each value of i) that can be represented as the linear system MT=b, where M is the tridiagonal matrix below and b has components b[i] = A*h^2*f[i]. It is implied that T[0] = 0 and T[n+1] = 0, which corresponds to the boundary conditions T(0)=0 and T(1) = 0.
M=
| 2 | -1 | | | | | |
| -1 | 2 | -1 | | | | |
| -1 | 2 | -1 | | | |
| | | ... | | | |
| | | | -1 | 2 | -1 |
| | | | | -1 | 2 |
We are asked to write a function (in MATLAB) to solve the system MT=b using the MATLAB backslash operator (T = M\b).
The problem I'm having is that I do not see how it's possible to numerically solve this system without having values for the vector b. Although we are provided with an equation for finding the values of the elements b[i] of this vector, I don't see how that can be done since the values of the constants A, xc, and d have not been specified. It's certainly possible to solve this system analytically if you allow the unspecified constants to remain that way, but I can't see how I can solve this numerically.
I've attempted to try to express the unknown constants xc and d in terms of x or h, but this approach did not work. I've also attempted to examine what the upper and lower bounds for f(x) and other constants might be, but I do not see how the results I obtained help me solve the problem. Even so, A is only stated to be a "proportionality constant" so I do not see how I can get around being told what A is, since it is not equated to any other variables of the problem.
Anyone have any ideas or thoughts about what it is I'm not seeing and what I need to do to get on the right path?
Thank you!
Re: Solving 1D Poisson's equation approximation using a linear system
This is a linear differential eigenvalue problem to an approximating algebraic system.

y(0)=y(1)=0
or similar.
Requiring this to hold at the interior points j=1,...N, we have an algebraic eigenvalue problem:

with the band matrix M and )
The exact solution is
with {Sin}^2({n$\pi $h}/2))
as h tends to zero these results converge to those of the target differential problem.