How can I get results over the whole domain of my non-linear differential equations?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP












4












$begingroup$


I want to solve the following system of non-linear differential equations:



t0 = 0.6;
tmax = 20;

σ = 0.04 t0;
a1 = -0.02;
a2 = -0.8;

s =
NDSolve[
D[x[t], t] + σ x[t] + a1/t0 (y[t]/t)^(1/3) == 0,
D[y[t], t] - a2 x[t]/t == 0, x[t0] == y[t0] == 1,
x, y, t, t0, tmax]

Plot[x[t] /. s, t, t0, tmax]


The problem is that the NDSolve long before reaching max.



enter image description here



I guess the problem comes from the power 1/3.



How can I correct the situation?










share|improve this question











$endgroup$











  • $begingroup$
    Please do not post images of your work. Please post your actual Mathematica code in the form of text that can be copied and pasted into a Mathematica notebook. Without such, it will be difficult to reproduce your problem and to experiment with possible solutions.
    $endgroup$
    – m_goldberg
    Feb 20 at 6:19















4












$begingroup$


I want to solve the following system of non-linear differential equations:



t0 = 0.6;
tmax = 20;

σ = 0.04 t0;
a1 = -0.02;
a2 = -0.8;

s =
NDSolve[
D[x[t], t] + σ x[t] + a1/t0 (y[t]/t)^(1/3) == 0,
D[y[t], t] - a2 x[t]/t == 0, x[t0] == y[t0] == 1,
x, y, t, t0, tmax]

Plot[x[t] /. s, t, t0, tmax]


The problem is that the NDSolve long before reaching max.



enter image description here



I guess the problem comes from the power 1/3.



How can I correct the situation?










share|improve this question











$endgroup$











  • $begingroup$
    Please do not post images of your work. Please post your actual Mathematica code in the form of text that can be copied and pasted into a Mathematica notebook. Without such, it will be difficult to reproduce your problem and to experiment with possible solutions.
    $endgroup$
    – m_goldberg
    Feb 20 at 6:19













4












4








4





$begingroup$


I want to solve the following system of non-linear differential equations:



t0 = 0.6;
tmax = 20;

σ = 0.04 t0;
a1 = -0.02;
a2 = -0.8;

s =
NDSolve[
D[x[t], t] + σ x[t] + a1/t0 (y[t]/t)^(1/3) == 0,
D[y[t], t] - a2 x[t]/t == 0, x[t0] == y[t0] == 1,
x, y, t, t0, tmax]

Plot[x[t] /. s, t, t0, tmax]


The problem is that the NDSolve long before reaching max.



enter image description here



I guess the problem comes from the power 1/3.



How can I correct the situation?










share|improve this question











$endgroup$




I want to solve the following system of non-linear differential equations:



t0 = 0.6;
tmax = 20;

σ = 0.04 t0;
a1 = -0.02;
a2 = -0.8;

s =
NDSolve[
D[x[t], t] + σ x[t] + a1/t0 (y[t]/t)^(1/3) == 0,
D[y[t], t] - a2 x[t]/t == 0, x[t0] == y[t0] == 1,
x, y, t, t0, tmax]

Plot[x[t] /. s, t, t0, tmax]


The problem is that the NDSolve long before reaching max.



enter image description here



I guess the problem comes from the power 1/3.



How can I correct the situation?







differential-equations






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Feb 20 at 7:51









m_goldberg

87.6k872198




87.6k872198










asked Feb 20 at 6:06









MPHYKEKMPHYKEK

864




864











  • $begingroup$
    Please do not post images of your work. Please post your actual Mathematica code in the form of text that can be copied and pasted into a Mathematica notebook. Without such, it will be difficult to reproduce your problem and to experiment with possible solutions.
    $endgroup$
    – m_goldberg
    Feb 20 at 6:19
















  • $begingroup$
    Please do not post images of your work. Please post your actual Mathematica code in the form of text that can be copied and pasted into a Mathematica notebook. Without such, it will be difficult to reproduce your problem and to experiment with possible solutions.
    $endgroup$
    – m_goldberg
    Feb 20 at 6:19















$begingroup$
Please do not post images of your work. Please post your actual Mathematica code in the form of text that can be copied and pasted into a Mathematica notebook. Without such, it will be difficult to reproduce your problem and to experiment with possible solutions.
$endgroup$
– m_goldberg
Feb 20 at 6:19




$begingroup$
Please do not post images of your work. Please post your actual Mathematica code in the form of text that can be copied and pasted into a Mathematica notebook. Without such, it will be difficult to reproduce your problem and to experiment with possible solutions.
$endgroup$
– m_goldberg
Feb 20 at 6:19










1 Answer
1






active

oldest

votes


















11












$begingroup$

Surd is the solution, but it behaves delicately in this specific situation. Surd[x, n] returns the $n$-th real root of $x$, but it requires that $n$ be an integer. If NDSolve is fed any inexact coefficients, however, it will numericize everything -- including Surd's second argument it turns out.



Thus, use exact arithmetic to define the variables in the equation:



t0 = 6/10;
tmax = 20;
σ = 4/100 t0;
a1 = -2/100;
a2 = -8/10;


And then use Surd[y[t]/t, 3] in place of (y[t]/t)^(1/3):



s = NDSolve[D[x[t], t] + σ x[t] + a1/t0 Surd[y[t]/t, 3] == 0,
D[y[t], t] - a2 x[t]/t == 0, x[t0] == 1, y[t0] == 1, x, y, t,
t0, tmax]


This is also much faster to solve, likely because it doesn't encounter any abnormalities in the complex plane.



You can easily check that it matches up with the other solution (where the other solution is defined at all) by naming this solution something other than s and plotting both x[t] results on the same graph.






share|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: "387"
    ;
    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: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    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
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f191873%2fhow-can-i-get-results-over-the-whole-domain-of-my-non-linear-differential-equati%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









    11












    $begingroup$

    Surd is the solution, but it behaves delicately in this specific situation. Surd[x, n] returns the $n$-th real root of $x$, but it requires that $n$ be an integer. If NDSolve is fed any inexact coefficients, however, it will numericize everything -- including Surd's second argument it turns out.



    Thus, use exact arithmetic to define the variables in the equation:



    t0 = 6/10;
    tmax = 20;
    σ = 4/100 t0;
    a1 = -2/100;
    a2 = -8/10;


    And then use Surd[y[t]/t, 3] in place of (y[t]/t)^(1/3):



    s = NDSolve[D[x[t], t] + σ x[t] + a1/t0 Surd[y[t]/t, 3] == 0,
    D[y[t], t] - a2 x[t]/t == 0, x[t0] == 1, y[t0] == 1, x, y, t,
    t0, tmax]


    This is also much faster to solve, likely because it doesn't encounter any abnormalities in the complex plane.



    You can easily check that it matches up with the other solution (where the other solution is defined at all) by naming this solution something other than s and plotting both x[t] results on the same graph.






    share|improve this answer









    $endgroup$

















      11












      $begingroup$

      Surd is the solution, but it behaves delicately in this specific situation. Surd[x, n] returns the $n$-th real root of $x$, but it requires that $n$ be an integer. If NDSolve is fed any inexact coefficients, however, it will numericize everything -- including Surd's second argument it turns out.



      Thus, use exact arithmetic to define the variables in the equation:



      t0 = 6/10;
      tmax = 20;
      σ = 4/100 t0;
      a1 = -2/100;
      a2 = -8/10;


      And then use Surd[y[t]/t, 3] in place of (y[t]/t)^(1/3):



      s = NDSolve[D[x[t], t] + σ x[t] + a1/t0 Surd[y[t]/t, 3] == 0,
      D[y[t], t] - a2 x[t]/t == 0, x[t0] == 1, y[t0] == 1, x, y, t,
      t0, tmax]


      This is also much faster to solve, likely because it doesn't encounter any abnormalities in the complex plane.



      You can easily check that it matches up with the other solution (where the other solution is defined at all) by naming this solution something other than s and plotting both x[t] results on the same graph.






      share|improve this answer









      $endgroup$















        11












        11








        11





        $begingroup$

        Surd is the solution, but it behaves delicately in this specific situation. Surd[x, n] returns the $n$-th real root of $x$, but it requires that $n$ be an integer. If NDSolve is fed any inexact coefficients, however, it will numericize everything -- including Surd's second argument it turns out.



        Thus, use exact arithmetic to define the variables in the equation:



        t0 = 6/10;
        tmax = 20;
        σ = 4/100 t0;
        a1 = -2/100;
        a2 = -8/10;


        And then use Surd[y[t]/t, 3] in place of (y[t]/t)^(1/3):



        s = NDSolve[D[x[t], t] + σ x[t] + a1/t0 Surd[y[t]/t, 3] == 0,
        D[y[t], t] - a2 x[t]/t == 0, x[t0] == 1, y[t0] == 1, x, y, t,
        t0, tmax]


        This is also much faster to solve, likely because it doesn't encounter any abnormalities in the complex plane.



        You can easily check that it matches up with the other solution (where the other solution is defined at all) by naming this solution something other than s and plotting both x[t] results on the same graph.






        share|improve this answer









        $endgroup$



        Surd is the solution, but it behaves delicately in this specific situation. Surd[x, n] returns the $n$-th real root of $x$, but it requires that $n$ be an integer. If NDSolve is fed any inexact coefficients, however, it will numericize everything -- including Surd's second argument it turns out.



        Thus, use exact arithmetic to define the variables in the equation:



        t0 = 6/10;
        tmax = 20;
        σ = 4/100 t0;
        a1 = -2/100;
        a2 = -8/10;


        And then use Surd[y[t]/t, 3] in place of (y[t]/t)^(1/3):



        s = NDSolve[D[x[t], t] + σ x[t] + a1/t0 Surd[y[t]/t, 3] == 0,
        D[y[t], t] - a2 x[t]/t == 0, x[t0] == 1, y[t0] == 1, x, y, t,
        t0, tmax]


        This is also much faster to solve, likely because it doesn't encounter any abnormalities in the complex plane.



        You can easily check that it matches up with the other solution (where the other solution is defined at all) by naming this solution something other than s and plotting both x[t] results on the same graph.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Feb 20 at 6:35









        eyorbleeyorble

        5,66311028




        5,66311028



























            draft saved

            draft discarded
















































            Thanks for contributing an answer to Mathematica 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%2fmathematica.stackexchange.com%2fquestions%2f191873%2fhow-can-i-get-results-over-the-whole-domain-of-my-non-linear-differential-equati%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

            How to check contact read email or not when send email to Individual?

            Bahrain

            Postfix configuration issue with fips on centos 7; mailgun relay