2

Assuming I have a differential equation $$ \frac{\partial u}{\partial t} = \frac{1}{f(x,t)} F(u,x,t) $$

The Crank-Nicolson scheme would have the equation discretized as such $$ \Big[ \frac{\partial u}{\partial t} \Big]_{i+1/2,j} = \frac{1}{2} \Big[\frac{1}{f(x,t)} F(u,x,t) \Big]_{ij} + \frac{1}{2}\Big[\frac{1}{f(x,t)} F(u,x,t) \Big]_{i+1,j} $$

Is it also appropriate to discretize the equation as $$ \Big[ f(x,t) \frac{\partial u}{\partial t} \Big]_{i+1/2,j} = \frac{1}{2} \Big[F(u,x,t) \Big]_{ij} + \frac{1}{2}\Big[F(u,x,t) \Big]_{i+1,j} $$

I'm writing a scheme would greatly improve it's solvability if this kind of thing is valid. To me it seems justifiable as it's just the averaging the in-between node with the neighboring nodes.

David G.
  • 260
  • 1
  • 11
  • I suppose your $f(x,t)$ is quite nice, which means $f(x,t)$ is away from zero and $C^2$ differentiable. Then the conclusion is no big difference in terms of truncation error. – Yimin Nov 14 '23 at 22:43
  • @Yimin Could you explain more about this? How much should it/could it impact the LTE? – David G. Nov 15 '23 at 14:26

1 Answers1

2

I suppose your $f(x,t)$ is quite nice, which means $f(x,t)$ is away from zero and $C^3$ differentiable.

Not sure if this is what you asked for.

In your proposed CN scheme,

$$f_{i+\frac{1}{2}} \frac{u_{i+1} - u_i}{\Delta t} = \frac{1}{2}F(u_{i+1}, x, t_{i+1}) + \frac{1}{2}F(u_i, x, t_i)$$

Now write $U(x,t) = f(x,t) u(x,t)$, then your equation becomes

$$\frac{\partial U}{\partial t} = G\left(U, x, t\right)$$

where $G(U, x, t) = F(u, x, t) + \partial_t f(x,t) u $.

If you apply the usual CN scheme to this equation,

$$\frac{U_{i+1} - U_i}{\Delta t} = \frac{1}{2}G(U_i, x, t_i) + \frac{1}{2}G(U_{i+1}, x, t_{i+1}) = \frac{1}{2}F(u_{i+1}, x, t_{i+1}) + \frac{1}{2}F(u_i, x, t_i) + \frac{1}{2}\partial_t f(x, t_{i+1}) u_{i+1} + \frac{1}{2} \partial_t f(x, t_{i}) u_i,$$

the standard theory says the LTE is $C ( (\Delta t)^2 + (\Delta x)^2 ) $, $C$ depends on some derivatives of $G$, here because we say $f$ is quite nice (smooth, away from zero), then you do not have to worry about that much.

The above scheme can be written as

$$\frac{U_{i+1} - U_i}{\Delta t} - \left(\frac{1}{2}\partial_t f(x, t_{i+1}) u_{i+1} + \frac{1}{2} \partial_t f(x, t_{i}) u_i \right) = \frac{1}{2}F(u_{i+1}, x, t_{i+1}) + \frac{1}{2}F(u_i, x, t_i)$$

A quick Taylor expansion at $t_{i+1/2}$ for $f$ on LHS will be $O(\Delta t)^2$ difference from your proposed scheme.

Yimin
  • 3,311
  • 17
  • 32