# Help required with BVODE

ktsharp
I'm intending to solve the following BVODE:

$$\frac{dy}{dx} & = & a + by,$$

$$\frac{d^{2}z}{dx^{2}} & = & {\alpha}y\frac{dz}{dx} - \beta +cz\frac{dy}{dx}.$$

I have the boundary values for both y and z at x=0, L, however I do NOT have any values for either first derivatives. How can I solve this numerically?

Homework Helper
What numerical methods do you know? It sounds like you are trying to use something like a "Runge-Kutta" which really applies to initial value problems. Typically for a boundary value problem you would use "finite elements". That is, divide the interval from 0 to L into intervals of length h (equal length intervals is simplest but not necessary), then approximate the first derivative by
$$\frac{z(x_{i+1})- z(x_f)}{h}$$
and the second derivative by
$$\frac{z(x_{i+2})- 2f(x_{i+1})+ f(x_i)}{h^2}$$

That will give a system of equations to solve for $z(x_i)$ and $y(x_i)$.

ktsharp

I am not familiar with the FEM, although I am familiar with finite difference methods, which is what this seems to be as you have written it above, but for an ODE. If I make the above assumption, I will get

$$y_{i+1} = y_{i}(hb+1) + ha.$$

$$f(y_{i})z_{i+2} = g(y_{i})z_{i+1} -\beta h^{2} - z_{i}.$$

It seems the problem is then what is the BV for $$z_{i+1}$$?

Homework Helper
There is no "boundary condition" for $z_{i+1}$ because you no longer have a differential equation for $z_{i+1}$.

As a very simple example, suppose you were to use 3 intervals so you need to find $y_0, y_1, y_2, y_3, z_0, z_1, z_2, z_3$.
Then the left boundary condition gives you values for $y_0$ and $z_0$. Those are your first two equations. Then on the three intervals, your differential equation gives 6 equations involving two values of y and z. Finally, your right boundary condition gives two values for $y_3$ and $z_3$. That's a total of 8 equations to solve for the 8 values of y and z.

ktsharp
Thanks again for your help. So what happens with the nonlinear terms in the second equation?