Next: Errors Up: Components of MHD Numerical Previous: Variable arrangement

## Numerical differentiation

To get the time evolution of system variables, we should be able to derive the system values at time step according to the system values at time step t. Practical MHD simulation equations provide the possibility of evolving these variables. One thing we need to do now is to find methods to perform numerical differentiation, as there are 's and 's in the MHD equations.

The most common way for time differentiation is Euler differentiation.

 (49)

We can see that this way of differentiation on t has an error of order . A better way to achieve better accuracy is the leap-frog differentiation

 (50)

The compensation for the high order accuracy of leap-frog differentiation is that it needs level values from two different time step(t and ) to get values at the third time step( ). At any time in the evolution of the system variables, we need to save two contiguous time step values, instead of one for the Euler differentiation. For small programs this extra demand poses no difficulty, but for large programs we have to balance the accuracy and resources to obtain the optimal result.

For the first-order space differentiation, there are three basic types. We will discuss these types for the one-dimensional case.

Forward differentiation:

 (51)

Backward differentiation:

 (52)

Centered differentiation:

 (53)

We can see that centered differentiation has better accuracy, and for this reason it is most commonly used in first-order space differentiation.

For the second order differentiation, , the most common differentiation method is:

 (54)

Next: Errors Up: Components of MHD Numerical Previous: Variable arrangement