Plot surface of constraints: Possibly via Apply or Map Reduce over a list of equations












2












$begingroup$


I have a function f(A,B,C) where for specific A and B values I can use Reduce to determine the constraint on C for my problem using a constraint on f. I want to plot the resulting surface.



To illustrate, consider



f = A^5 + B^3 + C^2


If A and B vary between 1 and 3 then I get the list of constraints (with f<20)



constraints = {{1, 1, C < 18}, {2, 1, C < -13}, {3, 1, C < -224}, {1, 2, C < 11}, {2, 2, C < -20}, {3, 2, C < -231}, {1, 3, C < -8}, {2, 3, C < -39}, {3, 3, C < -250}}


I then want to plot the surface given by



surf = {{1, 1, 18}, {2, 1, -13}, {3, 1, -224}, {1, 2, 
11}, {2, 2, -20}, {3, 2, -231}, {1, 3, -8}, {2, 3,
-39}, {3, 3, -250}}

ListPlot3D[surf,Mesh->All]


I can form the list of constraints using For loops



constraints = {};
For[B = 1, B <= 3, B++,
For[A = 1, A <= 3, A++,
f = (A)^5 + B^3 + p;
sol = Reduce[f < 20, p];
constraints = Append[constraints, {A, B, sol}]
]
]
constraints


However I am not sure how to get from the list of constraints to the max permitted value for C and therefore get to the surf expression.



I also expect that For loops are not an ideal approach, and that I should be able to form lists of the A and B values and use another approach (Map, or Thread, or Apply maybe) with Reduce. I find these methods confusing though, and don't really understand anything but the most basic examples (so possibly similar questions have not helped me figure this out).










share|improve this question









$endgroup$












  • $begingroup$
    Are A and B constrained to be integers?
    $endgroup$
    – Chris K
    17 hours ago










  • $begingroup$
    No they aren't - my actual function is quite complex so this is just a simple example. @Henrik Schumacher's solution works wonderfully, but I'd still like to know how to map across the list if anyone has a solution that works that way (just for general development of skills)
    $endgroup$
    – Esme_
    17 hours ago
















2












$begingroup$


I have a function f(A,B,C) where for specific A and B values I can use Reduce to determine the constraint on C for my problem using a constraint on f. I want to plot the resulting surface.



To illustrate, consider



f = A^5 + B^3 + C^2


If A and B vary between 1 and 3 then I get the list of constraints (with f<20)



constraints = {{1, 1, C < 18}, {2, 1, C < -13}, {3, 1, C < -224}, {1, 2, C < 11}, {2, 2, C < -20}, {3, 2, C < -231}, {1, 3, C < -8}, {2, 3, C < -39}, {3, 3, C < -250}}


I then want to plot the surface given by



surf = {{1, 1, 18}, {2, 1, -13}, {3, 1, -224}, {1, 2, 
11}, {2, 2, -20}, {3, 2, -231}, {1, 3, -8}, {2, 3,
-39}, {3, 3, -250}}

ListPlot3D[surf,Mesh->All]


I can form the list of constraints using For loops



constraints = {};
For[B = 1, B <= 3, B++,
For[A = 1, A <= 3, A++,
f = (A)^5 + B^3 + p;
sol = Reduce[f < 20, p];
constraints = Append[constraints, {A, B, sol}]
]
]
constraints


However I am not sure how to get from the list of constraints to the max permitted value for C and therefore get to the surf expression.



I also expect that For loops are not an ideal approach, and that I should be able to form lists of the A and B values and use another approach (Map, or Thread, or Apply maybe) with Reduce. I find these methods confusing though, and don't really understand anything but the most basic examples (so possibly similar questions have not helped me figure this out).










share|improve this question









$endgroup$












  • $begingroup$
    Are A and B constrained to be integers?
    $endgroup$
    – Chris K
    17 hours ago










  • $begingroup$
    No they aren't - my actual function is quite complex so this is just a simple example. @Henrik Schumacher's solution works wonderfully, but I'd still like to know how to map across the list if anyone has a solution that works that way (just for general development of skills)
    $endgroup$
    – Esme_
    17 hours ago














2












2








2





$begingroup$


I have a function f(A,B,C) where for specific A and B values I can use Reduce to determine the constraint on C for my problem using a constraint on f. I want to plot the resulting surface.



To illustrate, consider



f = A^5 + B^3 + C^2


If A and B vary between 1 and 3 then I get the list of constraints (with f<20)



constraints = {{1, 1, C < 18}, {2, 1, C < -13}, {3, 1, C < -224}, {1, 2, C < 11}, {2, 2, C < -20}, {3, 2, C < -231}, {1, 3, C < -8}, {2, 3, C < -39}, {3, 3, C < -250}}


I then want to plot the surface given by



surf = {{1, 1, 18}, {2, 1, -13}, {3, 1, -224}, {1, 2, 
11}, {2, 2, -20}, {3, 2, -231}, {1, 3, -8}, {2, 3,
-39}, {3, 3, -250}}

ListPlot3D[surf,Mesh->All]


I can form the list of constraints using For loops



constraints = {};
For[B = 1, B <= 3, B++,
For[A = 1, A <= 3, A++,
f = (A)^5 + B^3 + p;
sol = Reduce[f < 20, p];
constraints = Append[constraints, {A, B, sol}]
]
]
constraints


However I am not sure how to get from the list of constraints to the max permitted value for C and therefore get to the surf expression.



I also expect that For loops are not an ideal approach, and that I should be able to form lists of the A and B values and use another approach (Map, or Thread, or Apply maybe) with Reduce. I find these methods confusing though, and don't really understand anything but the most basic examples (so possibly similar questions have not helped me figure this out).










share|improve this question









$endgroup$




I have a function f(A,B,C) where for specific A and B values I can use Reduce to determine the constraint on C for my problem using a constraint on f. I want to plot the resulting surface.



To illustrate, consider



f = A^5 + B^3 + C^2


If A and B vary between 1 and 3 then I get the list of constraints (with f<20)



constraints = {{1, 1, C < 18}, {2, 1, C < -13}, {3, 1, C < -224}, {1, 2, C < 11}, {2, 2, C < -20}, {3, 2, C < -231}, {1, 3, C < -8}, {2, 3, C < -39}, {3, 3, C < -250}}


I then want to plot the surface given by



surf = {{1, 1, 18}, {2, 1, -13}, {3, 1, -224}, {1, 2, 
11}, {2, 2, -20}, {3, 2, -231}, {1, 3, -8}, {2, 3,
-39}, {3, 3, -250}}

ListPlot3D[surf,Mesh->All]


I can form the list of constraints using For loops



constraints = {};
For[B = 1, B <= 3, B++,
For[A = 1, A <= 3, A++,
f = (A)^5 + B^3 + p;
sol = Reduce[f < 20, p];
constraints = Append[constraints, {A, B, sol}]
]
]
constraints


However I am not sure how to get from the list of constraints to the max permitted value for C and therefore get to the surf expression.



I also expect that For loops are not an ideal approach, and that I should be able to form lists of the A and B values and use another approach (Map, or Thread, or Apply maybe) with Reduce. I find these methods confusing though, and don't really understand anything but the most basic examples (so possibly similar questions have not helped me figure this out).







list-manipulation equation-solving






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked 20 hours ago









Esme_Esme_

24916




24916












  • $begingroup$
    Are A and B constrained to be integers?
    $endgroup$
    – Chris K
    17 hours ago










  • $begingroup$
    No they aren't - my actual function is quite complex so this is just a simple example. @Henrik Schumacher's solution works wonderfully, but I'd still like to know how to map across the list if anyone has a solution that works that way (just for general development of skills)
    $endgroup$
    – Esme_
    17 hours ago


















  • $begingroup$
    Are A and B constrained to be integers?
    $endgroup$
    – Chris K
    17 hours ago










  • $begingroup$
    No they aren't - my actual function is quite complex so this is just a simple example. @Henrik Schumacher's solution works wonderfully, but I'd still like to know how to map across the list if anyone has a solution that works that way (just for general development of skills)
    $endgroup$
    – Esme_
    17 hours ago
















$begingroup$
Are A and B constrained to be integers?
$endgroup$
– Chris K
17 hours ago




$begingroup$
Are A and B constrained to be integers?
$endgroup$
– Chris K
17 hours ago












$begingroup$
No they aren't - my actual function is quite complex so this is just a simple example. @Henrik Schumacher's solution works wonderfully, but I'd still like to know how to map across the list if anyone has a solution that works that way (just for general development of skills)
$endgroup$
– Esme_
17 hours ago




$begingroup$
No they aren't - my actual function is quite complex so this is just a simple example. @Henrik Schumacher's solution works wonderfully, but I'd still like to know how to map across the list if anyone has a solution that works that way (just for general development of skills)
$endgroup$
– Esme_
17 hours ago










1 Answer
1






active

oldest

votes


















4












$begingroup$

f = a^5 + b^3 + c^2
RegionPlot3D[f <= 20, {a, 1, 3}, {b, 1, 3}, {c, -5, 5},
AxesLabel -> {"a", "b", "c"}]


enter image description here






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%2f193964%2fplot-surface-of-constraints-possibly-via-apply-or-map-reduce-over-a-list-of-equ%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









    4












    $begingroup$

    f = a^5 + b^3 + c^2
    RegionPlot3D[f <= 20, {a, 1, 3}, {b, 1, 3}, {c, -5, 5},
    AxesLabel -> {"a", "b", "c"}]


    enter image description here






    share|improve this answer











    $endgroup$


















      4












      $begingroup$

      f = a^5 + b^3 + c^2
      RegionPlot3D[f <= 20, {a, 1, 3}, {b, 1, 3}, {c, -5, 5},
      AxesLabel -> {"a", "b", "c"}]


      enter image description here






      share|improve this answer











      $endgroup$
















        4












        4








        4





        $begingroup$

        f = a^5 + b^3 + c^2
        RegionPlot3D[f <= 20, {a, 1, 3}, {b, 1, 3}, {c, -5, 5},
        AxesLabel -> {"a", "b", "c"}]


        enter image description here






        share|improve this answer











        $endgroup$



        f = a^5 + b^3 + c^2
        RegionPlot3D[f <= 20, {a, 1, 3}, {b, 1, 3}, {c, -5, 5},
        AxesLabel -> {"a", "b", "c"}]


        enter image description here







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited 19 hours ago

























        answered 20 hours ago









        Henrik SchumacherHenrik Schumacher

        57.9k579159




        57.9k579159






























            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%2f193964%2fplot-surface-of-constraints-possibly-via-apply-or-map-reduce-over-a-list-of-equ%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

            He _____ here since 1970 . Answer needed [closed]What does “since he was so high” mean?Meaning of “catch birds for”?How do I ensure “since” takes the meaning I want?“Who cares here” meaningWhat does “right round toward” mean?the time tense (had now been detected)What does the phrase “ring around the roses” mean here?Correct usage of “visited upon”Meaning of “foiled rail sabotage bid”It was the third time I had gone to Rome or It is the third time I had been to Rome

            Bunad

            Færeyskur hestur Heimild | Tengill | Tilvísanir | LeiðsagnarvalRossið - síða um færeyska hrossið á færeyskuGott ár hjá færeyska hestinum