Derive Jacobian matrix for discretised PDE

60 Views Asked by At

I'm working on deriving the analytical formulas for the nonzero elements on row i of the Jacobian matrix for:

$$F_i(U) = \frac{U^k_{i}-U^{k-1}{i}}{\Delta t} + U^k{i} \left(\frac{U^k_{i}-U^k_{i-1}}{h}\right) - v \left(\frac{U^k_{i+1}-2U^k_{i}+U^k_{i-1}}{h^2}\right) = 0$$

Would this be correct? I am slightly confused on $\frac{\partial F_i}{\partial U^k_{i}}$ and Im not sure if it's correct.

$U^k_{i-1}$ = $\frac{\partial F_i}{\partial U^k_{i-1}} = \frac{-U^k_{i}}{h} - v \frac{1}{h^2}$

$U^k_{i}$ = $\frac{\partial F_i}{\partial U^k_{i}} = \frac{1}{\Delta t} + \frac{U^k_{i}}{h} - v \frac{-2}{h^2}$

$U^k_{i-1}$ = $\frac{\partial F_i}{\partial U^k_{i+1}} = - v \frac{1}{h^2}$

Edit for $U^k_{i}$: $\frac{\partial F_i}{\partial U^k_{i}} = \frac{1}{\Delta t} + \frac{U^k_{i}-U^k_{i-1}}{h} + U^k_{i} \frac{1}{h} - v \frac{-2}{h^2}$

1

There are 1 best solutions below

0
On BEST ANSWER

The following is the collation of my comments:

In the second term $U_i^k\left(\frac{U_i^k - U_{i-1}^k}{h}\right)$, you have a product of two terms involving $U_i^k$ so you need to use the product rule.

Everything else looks correct.