Numerical Solution to Advection Equation












1












$begingroup$


I was wondering if classic Schemes like Lax-Friedrichs, Lax-Wendroff or Upwind Schemes work for the following PDE



$$dfrac{partial u}{partial t}+e^{-x}(cos(t)+2)dfrac{partial u}{partial x}=1+u^2$$ with initial condition
$$u(x,0) = e^{-x^2}$$



I've tried solving them with the schemes mentioned above with different time step $$Delta t leq dfrac{Delta x}{max|a(x,t)|}$$ where $a(x,t)=e^{-x}(cos(t)+2)$ but I always end up with unstable solutions. If anyone could point me in a direction or a source that would be great!










share|cite|improve this question











$endgroup$












  • $begingroup$
    What is the spatial domain? In any case, along the characteristics you will indeed see finite time blowup because of the $1+u^2$ on the right hand side.
    $endgroup$
    – Ian
    Jun 2 '18 at 19:10












  • $begingroup$
    The spatial domain is from [0,5] and the solution using the method of characteristics is u(x,t) = tan(t+arctan(e^{-[ln(e^x-(sin(t)+2t))]^2})
    $endgroup$
    – Ken Caluya
    Jun 2 '18 at 19:17










  • $begingroup$
    The solution is of the form $tan(t+b(x,t))$ where $b$ is a bounded function. This $tan$ is where the blowup is coming from.
    $endgroup$
    – Ian
    Jun 2 '18 at 19:20


















1












$begingroup$


I was wondering if classic Schemes like Lax-Friedrichs, Lax-Wendroff or Upwind Schemes work for the following PDE



$$dfrac{partial u}{partial t}+e^{-x}(cos(t)+2)dfrac{partial u}{partial x}=1+u^2$$ with initial condition
$$u(x,0) = e^{-x^2}$$



I've tried solving them with the schemes mentioned above with different time step $$Delta t leq dfrac{Delta x}{max|a(x,t)|}$$ where $a(x,t)=e^{-x}(cos(t)+2)$ but I always end up with unstable solutions. If anyone could point me in a direction or a source that would be great!










share|cite|improve this question











$endgroup$












  • $begingroup$
    What is the spatial domain? In any case, along the characteristics you will indeed see finite time blowup because of the $1+u^2$ on the right hand side.
    $endgroup$
    – Ian
    Jun 2 '18 at 19:10












  • $begingroup$
    The spatial domain is from [0,5] and the solution using the method of characteristics is u(x,t) = tan(t+arctan(e^{-[ln(e^x-(sin(t)+2t))]^2})
    $endgroup$
    – Ken Caluya
    Jun 2 '18 at 19:17










  • $begingroup$
    The solution is of the form $tan(t+b(x,t))$ where $b$ is a bounded function. This $tan$ is where the blowup is coming from.
    $endgroup$
    – Ian
    Jun 2 '18 at 19:20
















1












1








1





$begingroup$


I was wondering if classic Schemes like Lax-Friedrichs, Lax-Wendroff or Upwind Schemes work for the following PDE



$$dfrac{partial u}{partial t}+e^{-x}(cos(t)+2)dfrac{partial u}{partial x}=1+u^2$$ with initial condition
$$u(x,0) = e^{-x^2}$$



I've tried solving them with the schemes mentioned above with different time step $$Delta t leq dfrac{Delta x}{max|a(x,t)|}$$ where $a(x,t)=e^{-x}(cos(t)+2)$ but I always end up with unstable solutions. If anyone could point me in a direction or a source that would be great!










share|cite|improve this question











$endgroup$




I was wondering if classic Schemes like Lax-Friedrichs, Lax-Wendroff or Upwind Schemes work for the following PDE



$$dfrac{partial u}{partial t}+e^{-x}(cos(t)+2)dfrac{partial u}{partial x}=1+u^2$$ with initial condition
$$u(x,0) = e^{-x^2}$$



I've tried solving them with the schemes mentioned above with different time step $$Delta t leq dfrac{Delta x}{max|a(x,t)|}$$ where $a(x,t)=e^{-x}(cos(t)+2)$ but I always end up with unstable solutions. If anyone could point me in a direction or a source that would be great!







numerical-methods computational-mathematics hyperbolic-equations






share|cite|improve this question















share|cite|improve this question













share|cite|improve this question




share|cite|improve this question








edited Aug 8 '18 at 19:50









Harry49

6,44631133




6,44631133










asked Jun 2 '18 at 19:06









Ken CaluyaKen Caluya

412




412












  • $begingroup$
    What is the spatial domain? In any case, along the characteristics you will indeed see finite time blowup because of the $1+u^2$ on the right hand side.
    $endgroup$
    – Ian
    Jun 2 '18 at 19:10












  • $begingroup$
    The spatial domain is from [0,5] and the solution using the method of characteristics is u(x,t) = tan(t+arctan(e^{-[ln(e^x-(sin(t)+2t))]^2})
    $endgroup$
    – Ken Caluya
    Jun 2 '18 at 19:17










  • $begingroup$
    The solution is of the form $tan(t+b(x,t))$ where $b$ is a bounded function. This $tan$ is where the blowup is coming from.
    $endgroup$
    – Ian
    Jun 2 '18 at 19:20




















  • $begingroup$
    What is the spatial domain? In any case, along the characteristics you will indeed see finite time blowup because of the $1+u^2$ on the right hand side.
    $endgroup$
    – Ian
    Jun 2 '18 at 19:10












  • $begingroup$
    The spatial domain is from [0,5] and the solution using the method of characteristics is u(x,t) = tan(t+arctan(e^{-[ln(e^x-(sin(t)+2t))]^2})
    $endgroup$
    – Ken Caluya
    Jun 2 '18 at 19:17










  • $begingroup$
    The solution is of the form $tan(t+b(x,t))$ where $b$ is a bounded function. This $tan$ is where the blowup is coming from.
    $endgroup$
    – Ian
    Jun 2 '18 at 19:20


















$begingroup$
What is the spatial domain? In any case, along the characteristics you will indeed see finite time blowup because of the $1+u^2$ on the right hand side.
$endgroup$
– Ian
Jun 2 '18 at 19:10






$begingroup$
What is the spatial domain? In any case, along the characteristics you will indeed see finite time blowup because of the $1+u^2$ on the right hand side.
$endgroup$
– Ian
Jun 2 '18 at 19:10














$begingroup$
The spatial domain is from [0,5] and the solution using the method of characteristics is u(x,t) = tan(t+arctan(e^{-[ln(e^x-(sin(t)+2t))]^2})
$endgroup$
– Ken Caluya
Jun 2 '18 at 19:17




$begingroup$
The spatial domain is from [0,5] and the solution using the method of characteristics is u(x,t) = tan(t+arctan(e^{-[ln(e^x-(sin(t)+2t))]^2})
$endgroup$
– Ken Caluya
Jun 2 '18 at 19:17












$begingroup$
The solution is of the form $tan(t+b(x,t))$ where $b$ is a bounded function. This $tan$ is where the blowup is coming from.
$endgroup$
– Ian
Jun 2 '18 at 19:20






$begingroup$
The solution is of the form $tan(t+b(x,t))$ where $b$ is a bounded function. This $tan$ is where the blowup is coming from.
$endgroup$
– Ian
Jun 2 '18 at 19:20












1 Answer
1






active

oldest

votes


















0












$begingroup$

We consider here a balance law of the form
$$
partial_t u + a partial_x u = r (u)
$$

where $a = e^{-x}(cos t + 2)$ and $r (u) = 1+u^2$. As indicated in the comments, the solution from the method of characteristics blows up in finite time. Nevertheless, let us consider numerical integration up to this blow-up time. We write an explicit finite-volume discretization using the Lax-Friedrichs method:
$$
u_i^{n+1} = frac{1}{2}(u_{i-1}^n+u_{i+1}^n) - frac{Delta t}{2Delta x}a_i^n left(u_{i+1}^n- u_{i-1}^nright) + Delta t, r(u_i^n), ,
$$

where $u_i^nsimeq u(iDelta x, nDelta t)$ and $a_i^n = a(iDelta x, nDelta t)$.
This method is stable under the condition
$$
Delta t leq min_i min leftlbrace frac{Delta x}{|a_i^n|}, frac{2}{|r'(u_i^n)|}rightrbrace .
$$

The first stability restriction corresponds to the Courant-Friedrichs-Lewy (CFL) condition, while the second stability restriction is due to the first-order explicit time integration (forward Euler integration). Depending on the value of $r(u_i^n)$, this may be penalizing.



An alternative strategy relies on operator splitting, and unconditionally stable integration of the relaxation term. A Godunov splitting scheme based on the Lax-Friedrichs method and the backward Euler method reads
begin{aligned}
u_i^{*} &= frac{1}{2}(u_{i-1}^n+u_{i+1}^n) - frac{Delta t}{2Delta x}a_i^n left(u_{i+1}^n- u_{i-1}^nright) \
u_i^{n+1} &= u_i^* + Delta t, r(u_i^{n+1})
end{aligned}

which is stable under the CFL condition.






share|cite|improve this answer











$endgroup$













    Your Answer





    StackExchange.ifUsing("editor", function () {
    return StackExchange.using("mathjaxEditing", function () {
    StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix) {
    StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
    });
    });
    }, "mathjax-editing");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "69"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    noCode: true, onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f2805781%2fnumerical-solution-to-advection-equation%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0












    $begingroup$

    We consider here a balance law of the form
    $$
    partial_t u + a partial_x u = r (u)
    $$

    where $a = e^{-x}(cos t + 2)$ and $r (u) = 1+u^2$. As indicated in the comments, the solution from the method of characteristics blows up in finite time. Nevertheless, let us consider numerical integration up to this blow-up time. We write an explicit finite-volume discretization using the Lax-Friedrichs method:
    $$
    u_i^{n+1} = frac{1}{2}(u_{i-1}^n+u_{i+1}^n) - frac{Delta t}{2Delta x}a_i^n left(u_{i+1}^n- u_{i-1}^nright) + Delta t, r(u_i^n), ,
    $$

    where $u_i^nsimeq u(iDelta x, nDelta t)$ and $a_i^n = a(iDelta x, nDelta t)$.
    This method is stable under the condition
    $$
    Delta t leq min_i min leftlbrace frac{Delta x}{|a_i^n|}, frac{2}{|r'(u_i^n)|}rightrbrace .
    $$

    The first stability restriction corresponds to the Courant-Friedrichs-Lewy (CFL) condition, while the second stability restriction is due to the first-order explicit time integration (forward Euler integration). Depending on the value of $r(u_i^n)$, this may be penalizing.



    An alternative strategy relies on operator splitting, and unconditionally stable integration of the relaxation term. A Godunov splitting scheme based on the Lax-Friedrichs method and the backward Euler method reads
    begin{aligned}
    u_i^{*} &= frac{1}{2}(u_{i-1}^n+u_{i+1}^n) - frac{Delta t}{2Delta x}a_i^n left(u_{i+1}^n- u_{i-1}^nright) \
    u_i^{n+1} &= u_i^* + Delta t, r(u_i^{n+1})
    end{aligned}

    which is stable under the CFL condition.






    share|cite|improve this answer











    $endgroup$


















      0












      $begingroup$

      We consider here a balance law of the form
      $$
      partial_t u + a partial_x u = r (u)
      $$

      where $a = e^{-x}(cos t + 2)$ and $r (u) = 1+u^2$. As indicated in the comments, the solution from the method of characteristics blows up in finite time. Nevertheless, let us consider numerical integration up to this blow-up time. We write an explicit finite-volume discretization using the Lax-Friedrichs method:
      $$
      u_i^{n+1} = frac{1}{2}(u_{i-1}^n+u_{i+1}^n) - frac{Delta t}{2Delta x}a_i^n left(u_{i+1}^n- u_{i-1}^nright) + Delta t, r(u_i^n), ,
      $$

      where $u_i^nsimeq u(iDelta x, nDelta t)$ and $a_i^n = a(iDelta x, nDelta t)$.
      This method is stable under the condition
      $$
      Delta t leq min_i min leftlbrace frac{Delta x}{|a_i^n|}, frac{2}{|r'(u_i^n)|}rightrbrace .
      $$

      The first stability restriction corresponds to the Courant-Friedrichs-Lewy (CFL) condition, while the second stability restriction is due to the first-order explicit time integration (forward Euler integration). Depending on the value of $r(u_i^n)$, this may be penalizing.



      An alternative strategy relies on operator splitting, and unconditionally stable integration of the relaxation term. A Godunov splitting scheme based on the Lax-Friedrichs method and the backward Euler method reads
      begin{aligned}
      u_i^{*} &= frac{1}{2}(u_{i-1}^n+u_{i+1}^n) - frac{Delta t}{2Delta x}a_i^n left(u_{i+1}^n- u_{i-1}^nright) \
      u_i^{n+1} &= u_i^* + Delta t, r(u_i^{n+1})
      end{aligned}

      which is stable under the CFL condition.






      share|cite|improve this answer











      $endgroup$
















        0












        0








        0





        $begingroup$

        We consider here a balance law of the form
        $$
        partial_t u + a partial_x u = r (u)
        $$

        where $a = e^{-x}(cos t + 2)$ and $r (u) = 1+u^2$. As indicated in the comments, the solution from the method of characteristics blows up in finite time. Nevertheless, let us consider numerical integration up to this blow-up time. We write an explicit finite-volume discretization using the Lax-Friedrichs method:
        $$
        u_i^{n+1} = frac{1}{2}(u_{i-1}^n+u_{i+1}^n) - frac{Delta t}{2Delta x}a_i^n left(u_{i+1}^n- u_{i-1}^nright) + Delta t, r(u_i^n), ,
        $$

        where $u_i^nsimeq u(iDelta x, nDelta t)$ and $a_i^n = a(iDelta x, nDelta t)$.
        This method is stable under the condition
        $$
        Delta t leq min_i min leftlbrace frac{Delta x}{|a_i^n|}, frac{2}{|r'(u_i^n)|}rightrbrace .
        $$

        The first stability restriction corresponds to the Courant-Friedrichs-Lewy (CFL) condition, while the second stability restriction is due to the first-order explicit time integration (forward Euler integration). Depending on the value of $r(u_i^n)$, this may be penalizing.



        An alternative strategy relies on operator splitting, and unconditionally stable integration of the relaxation term. A Godunov splitting scheme based on the Lax-Friedrichs method and the backward Euler method reads
        begin{aligned}
        u_i^{*} &= frac{1}{2}(u_{i-1}^n+u_{i+1}^n) - frac{Delta t}{2Delta x}a_i^n left(u_{i+1}^n- u_{i-1}^nright) \
        u_i^{n+1} &= u_i^* + Delta t, r(u_i^{n+1})
        end{aligned}

        which is stable under the CFL condition.






        share|cite|improve this answer











        $endgroup$



        We consider here a balance law of the form
        $$
        partial_t u + a partial_x u = r (u)
        $$

        where $a = e^{-x}(cos t + 2)$ and $r (u) = 1+u^2$. As indicated in the comments, the solution from the method of characteristics blows up in finite time. Nevertheless, let us consider numerical integration up to this blow-up time. We write an explicit finite-volume discretization using the Lax-Friedrichs method:
        $$
        u_i^{n+1} = frac{1}{2}(u_{i-1}^n+u_{i+1}^n) - frac{Delta t}{2Delta x}a_i^n left(u_{i+1}^n- u_{i-1}^nright) + Delta t, r(u_i^n), ,
        $$

        where $u_i^nsimeq u(iDelta x, nDelta t)$ and $a_i^n = a(iDelta x, nDelta t)$.
        This method is stable under the condition
        $$
        Delta t leq min_i min leftlbrace frac{Delta x}{|a_i^n|}, frac{2}{|r'(u_i^n)|}rightrbrace .
        $$

        The first stability restriction corresponds to the Courant-Friedrichs-Lewy (CFL) condition, while the second stability restriction is due to the first-order explicit time integration (forward Euler integration). Depending on the value of $r(u_i^n)$, this may be penalizing.



        An alternative strategy relies on operator splitting, and unconditionally stable integration of the relaxation term. A Godunov splitting scheme based on the Lax-Friedrichs method and the backward Euler method reads
        begin{aligned}
        u_i^{*} &= frac{1}{2}(u_{i-1}^n+u_{i+1}^n) - frac{Delta t}{2Delta x}a_i^n left(u_{i+1}^n- u_{i-1}^nright) \
        u_i^{n+1} &= u_i^* + Delta t, r(u_i^{n+1})
        end{aligned}

        which is stable under the CFL condition.







        share|cite|improve this answer














        share|cite|improve this answer



        share|cite|improve this answer








        edited Jan 13 at 16:59

























        answered Aug 8 '18 at 20:29









        Harry49Harry49

        6,44631133




        6,44631133






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Mathematics Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            Use MathJax to format equations. MathJax reference.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f2805781%2fnumerical-solution-to-advection-equation%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            'app-layout' is not a known element: how to share Component with different Modules

            android studio warns about leanback feature tag usage required on manifest while using Unity exported app?

            WPF add header to Image with URL pettitions [duplicate]