- #1
jdawg
- 367
- 2
Homework Statement
d2T/dx2 = 5*(dT/dx) - 0.1*x = 0
T(0) = 50
T(10) = 400
(Δx) = 2I'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
d2T/dx2 = (Ti+1 * Ti + Ti-1)/((Δx))
dT/dx = (Ti+1 - Ti-1)/(2*Δx)
The Attempt at a Solution
node1 = 2; node2 = 4; node3 = 6; node4 = 8;
For node1:
(T2 - 2*T1 + T0)/(22) + 5*((T2 - T0)/(2*2)) - 0.1*(2) = 0
End up with ======> -0.5*T1 + 1.5*T2 = 50.2
For node2:
(T3 - 2*T2 + T1)/(22) + 5*((T3 - T1)/(2*2)) - 0.1*(4) = 0
End up with =======> -T1 - 0.25*T2 + 1.5*T3 = 0.4
For node3:
(T4 - 2*T3 + T2)/(22) + 5*((T4 - T2)/(2*2)) - 0.1*(6) = 0
End up with ========> -T2 - 0.5*T3 + 1.5*T4 = 0.6
For node4:
(T5 - 2*T4 + T3)/(22) + 5*((T5 - T3)/(2*2)) - 0.1*(8) = 0
End up with ========> -T3 - 0.5*T4 = -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: