1. Not finding help here? Sign up for a free 30min 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!

Model reaction diffusion brusselator 2d matlab

  1. Dec 19, 2016 #1
    • Moved from a technical forum, so homework template missing
    Hello, I have a project (model reaction diffusion brusselator 2d)
    ∂u/∂t=A+u^2v-(B−1)u+D1((∂^2)u/∂(x^2)+(∂^2)u/∂(y^2))
    ∂v/∂t=Bu−u^2v+D2((∂^2)v/∂(x^2)+(∂^2)v/∂(y^2))

    initial conditions:
    u(x,y,0) = 0.5 + y,
    v(x,y,0) = 1 + 5x.

    boundary conditions:
    ∂u/∂n = 0, ∂v/∂t = 0

    n-external normal to the boundary

    for numerical experiment:
    A=1;B=3.4; D1=D2=2*10-3

    I attached .zip with matlab code, but it is not working properly for some reason (( pls help me with code (problems with initial conditions)
     

    Attached Files:

  2. jcsd
  3. Dec 19, 2016 #2

    DrClaude

    User Avatar

    Staff: Mentor

    You'll have to describe the problem better than that.
     
  4. Dec 19, 2016 #3
    ok, I already found one mistake there was to be no x, y and i, j


    Code (Text):
    for i =1:n
        for j =1:n
            u(i,j) = 0.5 + i;
            v(i,j) = 1 + 5*j;
        end
    end
    at t = 0
    Screenshot_10.png is good,
    but in other cases(t=0.25; t=0.75),
    my u = NaN go in and I'm stuck at this point
    Screenshot_7.png
     
  5. Dec 19, 2016 #4

    DrClaude

    User Avatar

    Staff: Mentor

    Why is t_max = 0?

    While not related to your problem, I must say that your program if not efficient. In the brusselator functions, you should use array operations, not for loops. In laplacian, you should not have a series of ifs for border cases. Use instead a main loop dealing with core points, and then treat the border values independently.
     
  6. Dec 19, 2016 #5
    I realized now, even if I knew how to write, since I do not use matlab, and perform calculations have it
     
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: Model reaction diffusion brusselator 2d matlab
Loading...