Help required with BVODE

  • Thread starter ktsharp
  • Start date
  • #1
8
0

Main Question or Discussion Point

I'm intending to solve the following BVODE:

[tex]

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

[/tex]

[tex]

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

[/tex]



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?
 

Answers and Replies

  • #2
HallsofIvy
Science Advisor
Homework Helper
41,833
955
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
[tex]\frac{z(x_{i+1})- z(x_f)}{h}[/tex]
and the second derivative by
[tex]\frac{z(x_{i+2})- 2f(x_{i+1})+ f(x_i)}{h^2}[/tex]

That will give a system of equations to solve for [itex]z(x_i)[/itex] and [itex]y(x_i)[/itex].
 
  • #3
8
0
Thank you for your reply!

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


[tex]

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

[/tex]

[tex]

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

[/tex]

It seems the problem is then what is the BV for [tex]z_{i+1}[/tex]?
 
  • #4
HallsofIvy
Science Advisor
Homework Helper
41,833
955
There is no "boundary condition" for [itex]z_{i+1}[/itex] because you no longer have a differential equation for [itex]z_{i+1}[/itex].

As a very simple example, suppose you were to use 3 intervals so you need to find [itex]y_0, y_1, y_2, y_3, z_0, z_1, z_2, z_3[/itex].
Then the left boundary condition gives you values for [itex]y_0[/itex] and [itex]z_0[/itex]. 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 [itex]y_3[/itex] and [itex]z_3[/itex]. That's a total of 8 equations to solve for the 8 values of y and z.
 
  • #5
8
0
Thanks again for your help. So what happens with the nonlinear terms in the second equation?
 
  • #6
HallsofIvy
Science Advisor
Homework Helper
41,833
955
If your differential equations are non-linear, as these are, then the simultaneous equations you get will be non-linear. You might have to use something like Newton's method to solve those.
 

Related Threads on Help required with BVODE

  • Last Post
Replies
4
Views
2K
  • Last Post
Replies
2
Views
2K
Replies
2
Views
2K
Replies
1
Views
605
Replies
3
Views
4K
Replies
4
Views
646
Top