1. Limited time only! Sign up for a free 30min personal tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Dealing with boundary conditions in system of ODEs

  1. Dec 19, 2014 #1
    1. The problem statement, all variables and given/known data
    I'm trying to plot the steady state concentration of yA vs. x, yB vs x and yu vs x using centered finite difference method.
    7bf7ff66226dc782690fe0f4ed0d511a.png
    fc9d4e25a6988d7185732bc227e8441b.png

    2. Relevant equations
    1953a53dd7b94b8f9a1a3dff7d3d322b.png


    3. The attempt at a solution
    τ represents the dimensionless time variable, so steady state would mean that the left hand side of each of the differential equations is 0.

    I began this problem by replacing the derivatives that appear in the differential equations with the finite difference approximations for them. For example, yA:
    gif.gif
    I also used the boundary conditions:
    286a851dbe10ba7c4bf2a865c10f7be4.png
    but I don't know at which point, I am taking yA on the right side from. In the below equation should yA on the right side be yA,1 or something else (since the below equation estimates the derivative at the node n=1?
    gif.gif

    More importantly, how do I deal with this type of boundary condition in Matlab? I am used to dealing with boundary conditions such as yA(0,t)=0 for which I can simply initialize Y(1)=0 in matlab but in this case I'm given a derivative boundary condition.
     
  2. jcsd
  3. Dec 19, 2014 #2

    SteamKing

    User Avatar
    Staff Emeritus
    Science Advisor
    Homework Helper

    These aren't ODEs; they're PDEs.
     
  4. Dec 19, 2014 #3
    What you do is add a fictitious point at -1 such that:

    [tex]\frac{y_{1}-y_{-1}}{2h}=-(1-y_0)[/tex]

    Combining this with ##\frac{(y_{-1}+2y_0+y_1)}{h^2}## gives:

    [tex]\frac{(y_{-1}-2y_0+y_1)}{h^2}=\frac{2(y_1-y_0)}{h^2}-\frac{2(1-y_0)}{h}[/tex]

    You solve the time-dependent equation at x = 0, and use this in that equation. This is a standard way of handling that type of flux boundary condition.

    Chet
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?
Draft saved Draft deleted



Similar Discussions: Dealing with boundary conditions in system of ODEs
Loading...