- #1

- 367

- 2

## Homework Statement

d

^{2}T/dx

^{2}= 5*(dT/dx) - 0.1*x = 0

T(0) = 50

T(10) = 400

(Δx) = 2

I've figured out how to do these problems when Δx = 1, but when it equals any other number it goes wrong.

I know you start by plugging in the algebraic approximations for the differential elements, I think maybe my problem is the nodes?

## Homework Equations

d

^{2}T/dx

^{2}= (T

_{i+1}* T

_{i}+ T

_{i-1})/(

^{(Δx)})

dT/dx = (T

_{i+1}- T

_{i-1})/(2*Δx)

## The Attempt at a Solution

node1 = 2; node2 = 4; node3 = 6; node4 = 8;

For node1:

(T

_{2}- 2*T

_{1}+ T

_{0})/(2

^{2}) + 5*((T

_{2}- T

_{0})/(2*2)) - 0.1*(2) = 0

End up with ======> -0.5*T

_{1}+ 1.5*T

_{2}= 50.2

For node2:

(T

_{3}- 2*T

_{2}+ T

_{1})/(2

^{2}) + 5*((T

_{3}- T

_{1})/(2*2)) - 0.1*(4) = 0

End up with =======> -T

_{1}- 0.25*T

_{2}+ 1.5*T

_{3}= 0.4

For node3:

(T

_{4}- 2*T

_{3}+ T

_{2})/(2

^{2}) + 5*((T

_{4}- T

_{2})/(2*2)) - 0.1*(6) = 0

End up with ========> -T

_{2}- 0.5*T

_{3}+ 1.5*T

_{4}= 0.6

For node4:

(T

_{5}- 2*T

_{4}+ T

_{3})/(2

^{2}) + 5*((T

_{5}- T

_{3})/(2*2)) - 0.1*(8) = 0

End up with ========> -T

_{3}- 0.5*T

_{4}= -724.2

I put all the coefficients into a matrix and its tridiagonal, which is good I think. But when I try to plot it in matlab it gives me a crazy looking zigzag, which I'm pretty sure isn't correct.

If someone could point out what I'm doing wrong I would really appreciate it! :)

Last edited by a moderator: