Non-homogenous ODE, non-homogenous boundaries

1. Jul 11, 2011

I've made a lot of simplifications to a Joule-heating problem I'm working on. I'm struggling to solve the following one-dimensional, one variable ODE:

Txx + aT = -b

with boundary conditions

T(x=0) = Ts (Dirichlet)
Tx(x=L) = 0 (Neumann)

I've learned that this is a non-homogeneous ODE with non-homogenous boundaries. I've tried using FDM to solve them and then fitting the data to a function, but I didn't get far.

I would love some help on this. I have much more experience with numerical analysis than analytical. I really need a math-wiz's help.

2. Jul 11, 2011

pmsrw3

I apologize for being to lazy to work out where this really comes from, but here's the solution Mathematica gives:

$$T(x)\to \frac{1}{a}\left(-b \cot \left(\sqrt{a} L\right) \sin \left(\sqrt{a} x\right)+b \csc \left(\sqrt{a} L\right) \sin \left(\sqrt{a} x\right)+b \cos \left(\sqrt{a} x\right)-a T_s \cot \left(\sqrt{a} L\right) \sin \left(\sqrt{a} x\right)+a T_s \cos \left(\sqrt{a} x\right)-b\right)$$

3. Jul 12, 2011

pmsrw3, very close!!! Please see the following two plots:

The equation you gave models the homogenous boundary problem exactly, which is:

Txx + aT = -b, T(x=0) = Ts, T(x=L) = 0 (first plot)

What I need is the solution to the NON-homogenous boundary problem:

Txx + aT = -b, T(x=0) = Ts, Tx(x=L) = 0 (second plot)

the difference being that the x=L boundary is Neumann, not Dirichlet.

Can you do what you did again with this Newmann boundary???

Almost there!

Attached Files:

File size:
17.5 KB
Views:
91
• nonhomogenous_plot.png
File size:
20 KB
Views:
94
4. Jul 12, 2011

pmsrw3

Oops, sorry. I must have left out a '.

$$T(x)\to \frac{(a T_s+b) \sec \left(\sqrt{a} L\right) \cos \left(\sqrt{a} (L-x)\right)-b}{a}$$

5. Jul 12, 2011

I simultaneously found the solution. The form is

T(x) = C1*cos(sqrt(a)*x) + C2*sin(sqrt(a)*x) - b/a

where C1 = Ts + b/a, C2 = C1*tan(sqrt(a)*L)

Your solution looks like it takes this form after some trig flexing.

Thanks!

Attached Files:

• solution.png
File size:
20.2 KB
Views:
104
6. Jul 12, 2011

What do you get when a is negative?

7. Jul 12, 2011

pmsrw3

The same result will work. $\sqrt{a}$ is imaginary, but it all works out real in the end. $\cos(i\alpha) = \cosh(\alpha), \sec(i\alpha) = \text{sech}(\alpha)$.

If you want it written in terms of explicitly real functions: Letting alpha = -a, assuming alpha > 0, and solving $T''(x)-\alpha T(x)=-b$, I get

$$T(x)\to \frac{e^{\sqrt{\alpha } (-x)} \left(\alpha T_s \left(e^{2 \sqrt{\alpha } L}+e^{2 \sqrt{\alpha } x}\right)-b \left(e^{\sqrt{\alpha } x}-1\right) \left(e^{\sqrt{\alpha } x}-e^{2 \sqrt{\alpha } L}\right)\right)}{\alpha \left(e^{2 \sqrt{\alpha } L}+1\right)}$$

8. Jul 12, 2011

9. Jul 14, 2011

pmsrw3: Last one...

Quickly, can you do:

y'' = 0
y'(x=0) = inf
y(x=L) = a

I don't know if this is possible.

Thanks!!

10. Jul 14, 2011

pmsrw3

I don't need to run that one -- it obviously doesn't have a solution. y'' = 0 says y' is the same everywhere. y' is infinite at 0, so it's infinite everywhere. Obviously this does not have a finite solution.

11. Jul 14, 2011