Solve from interpolation function
Clash Royale CLAN TAG#URR8PPP
$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
interpolation
$endgroup$
add a comment |
$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
interpolation
$endgroup$
add a comment |
$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
interpolation
$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
interpolation
asked Feb 13 at 9:10
Gae PGae P
1589
1589
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
$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*)
$endgroup$
add a comment |
$begingroup$
Use numerical solver,
NSolve[x1[x] == 1, x]
x -> 0.3
$endgroup$
$begingroup$
UsuallyNDSolve
would be my first choice, but in this example I'm wondering whyNSolve[x1[x] == 1, 0 <= x <= 0.5, x]
doesn't evaluate the two(!) solutions.
$endgroup$
– Ulrich Neumann
Feb 13 at 9:54
add a comment |
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
$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*)
$endgroup$
add a comment |
$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*)
$endgroup$
add a comment |
$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*)
$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*)
answered Feb 13 at 9:40
Ulrich NeumannUlrich Neumann
9,503616
9,503616
add a comment |
add a comment |
$begingroup$
Use numerical solver,
NSolve[x1[x] == 1, x]
x -> 0.3
$endgroup$
$begingroup$
UsuallyNDSolve
would be my first choice, but in this example I'm wondering whyNSolve[x1[x] == 1, 0 <= x <= 0.5, x]
doesn't evaluate the two(!) solutions.
$endgroup$
– Ulrich Neumann
Feb 13 at 9:54
add a comment |
$begingroup$
Use numerical solver,
NSolve[x1[x] == 1, x]
x -> 0.3
$endgroup$
$begingroup$
UsuallyNDSolve
would be my first choice, but in this example I'm wondering whyNSolve[x1[x] == 1, 0 <= x <= 0.5, x]
doesn't evaluate the two(!) solutions.
$endgroup$
– Ulrich Neumann
Feb 13 at 9:54
add a comment |
$begingroup$
Use numerical solver,
NSolve[x1[x] == 1, x]
x -> 0.3
$endgroup$
Use numerical solver,
NSolve[x1[x] == 1, x]
x -> 0.3
answered Feb 13 at 9:41
zhkzhk
9,70911433
9,70911433
$begingroup$
UsuallyNDSolve
would be my first choice, but in this example I'm wondering whyNSolve[x1[x] == 1, 0 <= x <= 0.5, x]
doesn't evaluate the two(!) solutions.
$endgroup$
– Ulrich Neumann
Feb 13 at 9:54
add a comment |
$begingroup$
UsuallyNDSolve
would be my first choice, but in this example I'm wondering whyNSolve[x1[x] == 1, 0 <= x <= 0.5, x]
doesn't evaluate the two(!) solutions.
$endgroup$
– Ulrich Neumann
Feb 13 at 9:54
$begingroup$
Usually
NDSolve
would 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
NDSolve
would 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
add a comment |
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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