Solve from interpolation function

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












1












$begingroup$


I have the following list and its interpolating finction x1:



point=0., 0., 0.2, 1., 0.25, 1.5, 0.3, 1., 0.5, 0.;x1 = 
Interpolation[point]


I would like to obtain values of x for which y=1 and I try:



Solve[x1[x] == 1, x]


but the output is:



NSolve::ifun: Inverse functions are being used by NSolve, so some solutions 
may not be found; use Reduce for complete solution information.
InterpolatingFunction[0., 0.5, <>] -> 0.3


with a unique solution x=0.3. From the plot of x1, I expect that will be two different solutions. How can I solve this?Thanks










share|improve this question









$endgroup$
















    1












    $begingroup$


    I have the following list and its interpolating finction x1:



    point=0., 0., 0.2, 1., 0.25, 1.5, 0.3, 1., 0.5, 0.;x1 = 
    Interpolation[point]


    I would like to obtain values of x for which y=1 and I try:



    Solve[x1[x] == 1, x]


    but the output is:



    NSolve::ifun: Inverse functions are being used by NSolve, so some solutions 
    may not be found; use Reduce for complete solution information.
    InterpolatingFunction[0., 0.5, <>] -> 0.3


    with a unique solution x=0.3. From the plot of x1, I expect that will be two different solutions. How can I solve this?Thanks










    share|improve this question









    $endgroup$














      1












      1








      1





      $begingroup$


      I have the following list and its interpolating finction x1:



      point=0., 0., 0.2, 1., 0.25, 1.5, 0.3, 1., 0.5, 0.;x1 = 
      Interpolation[point]


      I would like to obtain values of x for which y=1 and I try:



      Solve[x1[x] == 1, x]


      but the output is:



      NSolve::ifun: Inverse functions are being used by NSolve, so some solutions 
      may not be found; use Reduce for complete solution information.
      InterpolatingFunction[0., 0.5, <>] -> 0.3


      with a unique solution x=0.3. From the plot of x1, I expect that will be two different solutions. How can I solve this?Thanks










      share|improve this question









      $endgroup$




      I have the following list and its interpolating finction x1:



      point=0., 0., 0.2, 1., 0.25, 1.5, 0.3, 1., 0.5, 0.;x1 = 
      Interpolation[point]


      I would like to obtain values of x for which y=1 and I try:



      Solve[x1[x] == 1, x]


      but the output is:



      NSolve::ifun: Inverse functions are being used by NSolve, so some solutions 
      may not be found; use Reduce for complete solution information.
      InterpolatingFunction[0., 0.5, <>] -> 0.3


      with a unique solution x=0.3. From the plot of x1, I expect that will be two different solutions. How can I solve this?Thanks







      interpolation






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Feb 13 at 9:10









      Gae PGae P

      1589




      1589




















          2 Answers
          2






          active

          oldest

          votes


















          1












          $begingroup$

          Try



          FindRoot[x1[x] == 1, x, .25, 0., 0.25, Method -> "Secant"]
          (*x -> 0.2*)
          FindRoot[x1[x] == 1, x, .25, 0.25, 0.5, Method -> "Secant"]
          (*x -> 0.3*)





          share|improve this answer









          $endgroup$




















            1












            $begingroup$

            Use numerical solver,



            NSolve[x1[x] == 1, x]



            x -> 0.3







            share|improve this answer









            $endgroup$












            • $begingroup$
              Usually NDSolvewould be my first choice, but in this example I'm wondering why NSolve[x1[x] == 1, 0 <= x <= 0.5, x] doesn't evaluate the two(!) solutions.
              $endgroup$
              – Ulrich Neumann
              Feb 13 at 9:54











            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%2f191442%2fsolve-from-interpolation-function%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            1












            $begingroup$

            Try



            FindRoot[x1[x] == 1, x, .25, 0., 0.25, Method -> "Secant"]
            (*x -> 0.2*)
            FindRoot[x1[x] == 1, x, .25, 0.25, 0.5, Method -> "Secant"]
            (*x -> 0.3*)





            share|improve this answer









            $endgroup$

















              1












              $begingroup$

              Try



              FindRoot[x1[x] == 1, x, .25, 0., 0.25, Method -> "Secant"]
              (*x -> 0.2*)
              FindRoot[x1[x] == 1, x, .25, 0.25, 0.5, Method -> "Secant"]
              (*x -> 0.3*)





              share|improve this answer









              $endgroup$















                1












                1








                1





                $begingroup$

                Try



                FindRoot[x1[x] == 1, x, .25, 0., 0.25, Method -> "Secant"]
                (*x -> 0.2*)
                FindRoot[x1[x] == 1, x, .25, 0.25, 0.5, Method -> "Secant"]
                (*x -> 0.3*)





                share|improve this answer









                $endgroup$



                Try



                FindRoot[x1[x] == 1, x, .25, 0., 0.25, Method -> "Secant"]
                (*x -> 0.2*)
                FindRoot[x1[x] == 1, x, .25, 0.25, 0.5, Method -> "Secant"]
                (*x -> 0.3*)






                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Feb 13 at 9:40









                Ulrich NeumannUlrich Neumann

                9,503616




                9,503616





















                    1












                    $begingroup$

                    Use numerical solver,



                    NSolve[x1[x] == 1, x]



                    x -> 0.3







                    share|improve this answer









                    $endgroup$












                    • $begingroup$
                      Usually NDSolvewould be my first choice, but in this example I'm wondering why NSolve[x1[x] == 1, 0 <= x <= 0.5, x] doesn't evaluate the two(!) solutions.
                      $endgroup$
                      – Ulrich Neumann
                      Feb 13 at 9:54
















                    1












                    $begingroup$

                    Use numerical solver,



                    NSolve[x1[x] == 1, x]



                    x -> 0.3







                    share|improve this answer









                    $endgroup$












                    • $begingroup$
                      Usually NDSolvewould be my first choice, but in this example I'm wondering why NSolve[x1[x] == 1, 0 <= x <= 0.5, x] doesn't evaluate the two(!) solutions.
                      $endgroup$
                      – Ulrich Neumann
                      Feb 13 at 9:54














                    1












                    1








                    1





                    $begingroup$

                    Use numerical solver,



                    NSolve[x1[x] == 1, x]



                    x -> 0.3







                    share|improve this answer









                    $endgroup$



                    Use numerical solver,



                    NSolve[x1[x] == 1, x]



                    x -> 0.3








                    share|improve this answer












                    share|improve this answer



                    share|improve this answer










                    answered Feb 13 at 9:41









                    zhkzhk

                    9,70911433




                    9,70911433











                    • $begingroup$
                      Usually NDSolvewould be my first choice, but in this example I'm wondering why NSolve[x1[x] == 1, 0 <= x <= 0.5, x] doesn't evaluate the two(!) solutions.
                      $endgroup$
                      – Ulrich Neumann
                      Feb 13 at 9:54

















                    • $begingroup$
                      Usually NDSolvewould be my first choice, but in this example I'm wondering why NSolve[x1[x] == 1, 0 <= x <= 0.5, x] doesn't evaluate the two(!) solutions.
                      $endgroup$
                      – Ulrich Neumann
                      Feb 13 at 9:54
















                    $begingroup$
                    Usually NDSolvewould be my first choice, but in this example I'm wondering why NSolve[x1[x] == 1, 0 <= x <= 0.5, x] doesn't evaluate the two(!) solutions.
                    $endgroup$
                    – Ulrich Neumann
                    Feb 13 at 9:54





                    $begingroup$
                    Usually NDSolvewould be my first choice, but in this example I'm wondering why NSolve[x1[x] == 1, 0 <= x <= 0.5, x] doesn't evaluate the two(!) solutions.
                    $endgroup$
                    – Ulrich Neumann
                    Feb 13 at 9:54


















                    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%2f191442%2fsolve-from-interpolation-function%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?

                    Displaying single band from multi-band raster using QGIS

                    How many registers does an x86_64 CPU actually have?