# Boundary Value Problems: Direct Solve and Relaxation

## Computing Derivatives with Taylor Series

\begin{eqnarray} \alpha_1 y(a) + \beta_1 \frac{\mathrm dy(a)}{\mathrm dt}&=&\gamma_1 \
\alpha_2 y(a) + \beta_2 \frac{\mathrm dy(a)}{\mathrm dt}&=&\gamma_2 \end{eqnarray}

y(b)&=&\beta \end{eqnarray}

\begin{eqnarray} f(t+\Delta t) &=& f(t) + \Delta t \frac{\mathrm d f}{\mathrm dt} + \frac{1}{2}\Delta t^2 \frac{\mathrm d^2 f}{\mathrm dt^2} + \frac{1}{3!}\Delta t^3 \frac{\mathrm d^3 f(c_1)}{\mathrm dt^3}
f(t - \Delta t) &=& f(t) - \Delta t \frac{\mathrm d f}{\mathrm dt} + \frac{1}{2}\Delta t^2 \frac{\mathrm d^2 f}{\mathrm dt^2} - \frac{1}{3!}\Delta t^3 \frac{\mathrm d^3 f(c_2)}{\mathrm dt^3} \end{eqnarray}

$\frac{\mathrm df}{\mathrm dt} = \frac{f(t + \Delta t) - f(t-\Delta t)}{2\Delta } - \frac{1}{2}\frac{1}{3!} \Delta t^2 \frac{\mathrm d^3 f(c)}{\mathrm dt^3}$

## Second Order Derivatives and Forward and Backward Differences

$f’’(t) = \frac{f(t+\Delta t) -2f(t) + f(t-\Delta t) }{ \Delta t^2 } + O(\Delta t^2)$

## Boundary Value Problems and Ax=b

MATLAB 是设计用来解决线性代数问题 $\mathbf A \mathbf x = \mathbf b$ 的，所以我们希望我们的离散化的方法解决问题的时候，可以化成上面这种线性的形式。

$\frac{1}{2}(1-p(t) \Delta t) y(t+\Delta t) + (-2 - \Delta t^2 q(t) ) y(t) + ( 1+ \frac{1}{2} p(t) \Delta t ) y(t-\Delta t) = r(t) \Delta t^2$

By OctoMiao

Last updated