1

I am attempting to numerically solve the following problem. I decompose it into a system of two first order ODEs and then solve via the shooting method. I use the fourth order Runge-Kutta (RK4) method to solve each iteration of the shooting method.

$$k \frac{d^2T}{dx^2}=h(T-T_{\inf}) + \sigma(T^4-T^4_{surr})\\ T_{inf} = T_{surr} = 200 \, K\\ k = 1 \quad h = 0.05 \, \text{m}^{-2}\quad \sigma = 2.7*10^{-9} \, \text{K}^{-3}\,\text{m}^{-2}\quad T_L = 300 \, K \quad T_R = 400 \, K\\ L = 10 \, \text{m}$$

If I set $\sigma = 0$ then the solution converges for RK4 in just 3 iterations. I have checked it against the analytical solution for when $\sigma=0$.

However, if I keep the radiation term ($\sigma\neq0$) then RK4 quickly diverges during the first iteration of the shooting method. About half-way thru the solution domain it explodes.

Is there something special or unique about the following system that I am not aware? Some special case or sensitivity to initial conditions?

The system of first order ODEs that I am applying RK4 to is: $$ \frac{dz}{dx} = w\\ \frac{dw}{dx} = h(z-T_{inf}) + \sigma (z^4-T^4_{inf})\\ \text{where} \quad z(0) = T_L\\ \text{and} \quad w(0) = 1 \; \text{(Guess 1)} $$

Nukesub
  • 163
  • 4
  • Shooting isn't stable. I would recommend using a MIRK-based method instead in order to get a more stable rootfinding problem. The tutorials of DifferentialEquations.jl show how to quickly swap out a shooting problem for a MIRK problem. – Chris Rackauckas Feb 08 '20 at 21:26
  • Thank you, I'll check out those resources, but this is an assignment for a class and the instructions are "use shooting method with RK4" – Nukesub Feb 09 '20 at 01:17
  • 1
    Can you give the numerical values of all the parameters involved $h,\sigma,T_{inf},T_L$ and domain length. – cfdlab Feb 09 '20 at 16:48
  • In the second system, at some point you have to divide by $k$, you can decide on the first or second equation. Is this only missing here or also in your code? – Lutz Lehmann Feb 09 '20 at 17:37
  • 1
    It's not very effective to use the shooting method for a two-point boundary value problem. Just solve it as a coupled problem in space, using the finite difference or finite element method! – Wolfgang Bangerth Feb 10 '20 at 21:57
  • I've updated the problem definition with the parameters involved. Also, as I stated earlier, the solution method is not optional. I was tasked with using the shooting method and RK4 to solve this BVP. – Nukesub Feb 11 '20 at 00:14
  • I don't understand why the solution is diverging when I include the radiation term. There is a limitation on the shooting method I guess that I am not understanding here. If it matters, I use the secant method to update the guess (after the initial two guesses). – Nukesub Feb 11 '20 at 00:20
  • Well I finally got it to work but apparently it is quite sensitive to the guess values. I was trying small negative numbers (informed by the expected temperature distribution) and those weren't working. I played around, adding -10 or -5 to the initial guess until it worked. Not a very scientific or reliable way to solve a problem. – Nukesub Feb 11 '20 at 01:27
  • Did you try to use the solution with $\sigma=0$ as the initial guess when you solve for the non-zero $\sigma$ case ? – cfdlab Feb 11 '20 at 12:21
  • No - I think it was because my initial guess of w (the derivative of temperature) was positive and it couldn't handle a bad or unrealistic initial first guess like that. Seems obvious now but didn't at the time. But even for too small or too large negative numbers it would diverge. – Nukesub Feb 12 '20 at 03:59

0 Answers0