Solving second order derivative with Neumann boundary conditions

61 Views Asked by At

I am trying to solve the equation:

$w''(z) = -\frac{q0-qm}{kc*hr}*exp(-\frac{z}{hr})$

with the boundary conditions:

$w'(0) = 0$ and $w'(L) = \frac{qm}{kc}$

I am not sure how to do this where the equation is only defined at the derivative of both boundaries. Is this possible and if so what is the solution?

This is the to solve the inhomogeneous part of a diffusion equation that looks like this:

$\frac{\partial u}{\partial t} = \kappa \frac{\partial^2 u}{\partial z^2} + \frac{\gamma(z)}{\rho c_p}$ for $0\leq z \leq L, t>0$
$\frac{\partial u}{\partial z}(0,t) = 0 , \frac{\partial u}{\partial z}(L,t) = \frac{qm}{kc}$
$u(z,0) = f(z)$

and I have defined $ u = w(z) + v(z,t)$ where w is the inhomogeneous part and v is the homogeneous part of the equation.

1

There are 1 best solutions below

0
On

Elaborating on what I said in the comments here.

Consider $u_t=Au_{xx}+f(x),u_x(t,0)=B,u_x(t,L)=C$. In a steady state solution say $w(t,x)$ with $w_t=0$, you must have

$$\frac{d}{dt} \int_0^L w(t,x) dx = \int_0^L w_t(t,x) dx = 0 = \int_0^L f(x) dx + w_x(L) - w_x(0).$$

If replacing $w_x(0)=B$ and $w_x(L)=C$ results in a true equation, then your solution is just $u=w+v$ where

$$v_t=Av_{xx},v_x(t,0)=0,v_x(t,L)=0.$$

But this probably isn't the case. So instead, you can sacrifice one of the three things that you want to happen. One way is to sacrifice the BC on the right, by taking

$$w_x(0)=B,w_x(L)=B-\int_0^L f(x) dx.$$

Following this route you get

$$v_t=Av_{xx},v_x(t,0)=0,v_x(t,L)=C-B+\int_0^L f(x) dx.$$

Analogously you can sacrifice the BC on the left; I won't write that out.

The other way you can go is to sacrifice the forcing. To do that, choose your favorite $g$ such that $\int_0^L g(x) dx + C - B=0$ and have $w''=g,w'(0)=B,w'(L)=C$, then $v$ will satisfy

$$v_t=A v_{xx} + f(x) - g(x),v_x(t,0)=0,v_x(t,L)=0.$$

I would probably do the last idea with $g(x)=f(x)+\frac{B-C}{L}$, so that $v$ could be evaluated with Fourier series. This way you don't need any differential equation solver, just quadrature.