Plot surface of constraints: Possibly via Apply or Map Reduce over a list of equations
$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).
list-manipulation equation-solving
$endgroup$
add a comment |
$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).
list-manipulation equation-solving
$endgroup$
$begingroup$
AreA
andB
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
add a comment |
$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).
list-manipulation equation-solving
$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
list-manipulation equation-solving
asked 20 hours ago
Esme_Esme_
24916
24916
$begingroup$
AreA
andB
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
add a comment |
$begingroup$
AreA
andB
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
add a comment |
1 Answer
1
active
oldest
votes
$begingroup$
f = a^5 + b^3 + c^2
RegionPlot3D[f <= 20, {a, 1, 3}, {b, 1, 3}, {c, -5, 5},
AxesLabel -> {"a", "b", "c"}]
$endgroup$
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%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
$begingroup$
f = a^5 + b^3 + c^2
RegionPlot3D[f <= 20, {a, 1, 3}, {b, 1, 3}, {c, -5, 5},
AxesLabel -> {"a", "b", "c"}]
$endgroup$
add a comment |
$begingroup$
f = a^5 + b^3 + c^2
RegionPlot3D[f <= 20, {a, 1, 3}, {b, 1, 3}, {c, -5, 5},
AxesLabel -> {"a", "b", "c"}]
$endgroup$
add a comment |
$begingroup$
f = a^5 + b^3 + c^2
RegionPlot3D[f <= 20, {a, 1, 3}, {b, 1, 3}, {c, -5, 5},
AxesLabel -> {"a", "b", "c"}]
$endgroup$
f = a^5 + b^3 + c^2
RegionPlot3D[f <= 20, {a, 1, 3}, {b, 1, 3}, {c, -5, 5},
AxesLabel -> {"a", "b", "c"}]
edited 19 hours ago
answered 20 hours ago
Henrik SchumacherHenrik Schumacher
57.9k579159
57.9k579159
add a comment |
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%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
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
$begingroup$
Are
A
andB
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