Restricting the domain of a StreamPlot to a non rectangular region

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











up vote
2
down vote

favorite












First, I should say I am at best an advanced amateur at Mathematica, and that generally speaking my knowledge of programming (in any language) is more in computation than visualization.



There is a model I am working on for which I have recently shown there is a feasibility region: $$mathcalR = (x,y) in [0,infty)times[0, infty) : x+y leq L.$$ Of course this is a triangular subregion of the first quadrant. I wish to restrict the domain of the streamplots I am generating to $mathcalR$.



From looking at the documentation I have constructed the following code:



StreamPlot[dx/dt, dy/dt, x, 0, L, y, 0, L]


which works fine, but of course gives me a large amount of unneeded data that clutters up my attempted visualization. So then, my question is:



How do I restrict the domain of StreamPlot to $mathcalR $?










share|improve this question









New contributor




GeauxMath is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.



















  • Welcome to Mathematica.se! Full minimalistic code to demonstrate the issue, please! Then it is much easier for us to help you out!
    – Johu
    36 mins ago











  • Closely related to DensityPlot with equal mesh and a certain boundary
    – Johu
    30 mins ago















up vote
2
down vote

favorite












First, I should say I am at best an advanced amateur at Mathematica, and that generally speaking my knowledge of programming (in any language) is more in computation than visualization.



There is a model I am working on for which I have recently shown there is a feasibility region: $$mathcalR = (x,y) in [0,infty)times[0, infty) : x+y leq L.$$ Of course this is a triangular subregion of the first quadrant. I wish to restrict the domain of the streamplots I am generating to $mathcalR$.



From looking at the documentation I have constructed the following code:



StreamPlot[dx/dt, dy/dt, x, 0, L, y, 0, L]


which works fine, but of course gives me a large amount of unneeded data that clutters up my attempted visualization. So then, my question is:



How do I restrict the domain of StreamPlot to $mathcalR $?










share|improve this question









New contributor




GeauxMath is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.



















  • Welcome to Mathematica.se! Full minimalistic code to demonstrate the issue, please! Then it is much easier for us to help you out!
    – Johu
    36 mins ago











  • Closely related to DensityPlot with equal mesh and a certain boundary
    – Johu
    30 mins ago













up vote
2
down vote

favorite









up vote
2
down vote

favorite











First, I should say I am at best an advanced amateur at Mathematica, and that generally speaking my knowledge of programming (in any language) is more in computation than visualization.



There is a model I am working on for which I have recently shown there is a feasibility region: $$mathcalR = (x,y) in [0,infty)times[0, infty) : x+y leq L.$$ Of course this is a triangular subregion of the first quadrant. I wish to restrict the domain of the streamplots I am generating to $mathcalR$.



From looking at the documentation I have constructed the following code:



StreamPlot[dx/dt, dy/dt, x, 0, L, y, 0, L]


which works fine, but of course gives me a large amount of unneeded data that clutters up my attempted visualization. So then, my question is:



How do I restrict the domain of StreamPlot to $mathcalR $?










share|improve this question









New contributor




GeauxMath is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











First, I should say I am at best an advanced amateur at Mathematica, and that generally speaking my knowledge of programming (in any language) is more in computation than visualization.



There is a model I am working on for which I have recently shown there is a feasibility region: $$mathcalR = (x,y) in [0,infty)times[0, infty) : x+y leq L.$$ Of course this is a triangular subregion of the first quadrant. I wish to restrict the domain of the streamplots I am generating to $mathcalR$.



From looking at the documentation I have constructed the following code:



StreamPlot[dx/dt, dy/dt, x, 0, L, y, 0, L]


which works fine, but of course gives me a large amount of unneeded data that clutters up my attempted visualization. So then, my question is:



How do I restrict the domain of StreamPlot to $mathcalR $?







plotting






share|improve this question









New contributor




GeauxMath is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|improve this question









New contributor




GeauxMath is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this question




share|improve this question








edited 28 mins ago









Johu

3,4131033




3,4131033






New contributor




GeauxMath is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked 41 mins ago









GeauxMath

132




132




New contributor




GeauxMath is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





GeauxMath is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






GeauxMath is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











  • Welcome to Mathematica.se! Full minimalistic code to demonstrate the issue, please! Then it is much easier for us to help you out!
    – Johu
    36 mins ago











  • Closely related to DensityPlot with equal mesh and a certain boundary
    – Johu
    30 mins ago

















  • Welcome to Mathematica.se! Full minimalistic code to demonstrate the issue, please! Then it is much easier for us to help you out!
    – Johu
    36 mins ago











  • Closely related to DensityPlot with equal mesh and a certain boundary
    – Johu
    30 mins ago
















Welcome to Mathematica.se! Full minimalistic code to demonstrate the issue, please! Then it is much easier for us to help you out!
– Johu
36 mins ago





Welcome to Mathematica.se! Full minimalistic code to demonstrate the issue, please! Then it is much easier for us to help you out!
– Johu
36 mins ago













Closely related to DensityPlot with equal mesh and a certain boundary
– Johu
30 mins ago





Closely related to DensityPlot with equal mesh and a certain boundary
– Johu
30 mins ago











2 Answers
2






active

oldest

votes

















up vote
1
down vote



accepted










Try



StreamPlot[dx/dt, dy/dt, x, 0, L, y, 0, L, RegionFunction -> Function[x, y, x+y <= L]]





share|improve this answer




















  • Thank you very much for your help
    – GeauxMath
    25 mins ago

















up vote
2
down vote













StreamPlot[-1 - x^2 + y, 1 + x - y^2, x, -3, 3, y, -3, 3, 
RegionFunction -> Function[x, y, z, 2 < x^2 + y^2 < 9]]


enter image description here



or



StreamPlot[-1 - x^2 + y, 1 + x - y^2, x, y [Element] 


StadiumShape[0, 0, 2, 3, 2]]



enter image description here






share|improve this answer






















  • Thank you very much for your help. This code will be very helpful if I ever need to plot a circular region.
    – GeauxMath
    24 mins ago










  • Just to demonstrate that the solution is not limted to circlar region, I updated the answer with a more compelx shape.
    – Johu
    15 mins ago











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



);






GeauxMath is a new contributor. Be nice, and check out our Code of Conduct.









 

draft saved


draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f182376%2frestricting-the-domain-of-a-streamplot-to-a-non-rectangular-region%23new-answer', 'question_page');

);

Post as a guest






























2 Answers
2






active

oldest

votes








2 Answers
2






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
1
down vote



accepted










Try



StreamPlot[dx/dt, dy/dt, x, 0, L, y, 0, L, RegionFunction -> Function[x, y, x+y <= L]]





share|improve this answer




















  • Thank you very much for your help
    – GeauxMath
    25 mins ago














up vote
1
down vote



accepted










Try



StreamPlot[dx/dt, dy/dt, x, 0, L, y, 0, L, RegionFunction -> Function[x, y, x+y <= L]]





share|improve this answer




















  • Thank you very much for your help
    – GeauxMath
    25 mins ago












up vote
1
down vote



accepted







up vote
1
down vote



accepted






Try



StreamPlot[dx/dt, dy/dt, x, 0, L, y, 0, L, RegionFunction -> Function[x, y, x+y <= L]]





share|improve this answer












Try



StreamPlot[dx/dt, dy/dt, x, 0, L, y, 0, L, RegionFunction -> Function[x, y, x+y <= L]]






share|improve this answer












share|improve this answer



share|improve this answer










answered 34 mins ago









That Gravity Guy

723410




723410











  • Thank you very much for your help
    – GeauxMath
    25 mins ago
















  • Thank you very much for your help
    – GeauxMath
    25 mins ago















Thank you very much for your help
– GeauxMath
25 mins ago




Thank you very much for your help
– GeauxMath
25 mins ago










up vote
2
down vote













StreamPlot[-1 - x^2 + y, 1 + x - y^2, x, -3, 3, y, -3, 3, 
RegionFunction -> Function[x, y, z, 2 < x^2 + y^2 < 9]]


enter image description here



or



StreamPlot[-1 - x^2 + y, 1 + x - y^2, x, y [Element] 


StadiumShape[0, 0, 2, 3, 2]]



enter image description here






share|improve this answer






















  • Thank you very much for your help. This code will be very helpful if I ever need to plot a circular region.
    – GeauxMath
    24 mins ago










  • Just to demonstrate that the solution is not limted to circlar region, I updated the answer with a more compelx shape.
    – Johu
    15 mins ago















up vote
2
down vote













StreamPlot[-1 - x^2 + y, 1 + x - y^2, x, -3, 3, y, -3, 3, 
RegionFunction -> Function[x, y, z, 2 < x^2 + y^2 < 9]]


enter image description here



or



StreamPlot[-1 - x^2 + y, 1 + x - y^2, x, y [Element] 


StadiumShape[0, 0, 2, 3, 2]]



enter image description here






share|improve this answer






















  • Thank you very much for your help. This code will be very helpful if I ever need to plot a circular region.
    – GeauxMath
    24 mins ago










  • Just to demonstrate that the solution is not limted to circlar region, I updated the answer with a more compelx shape.
    – Johu
    15 mins ago













up vote
2
down vote










up vote
2
down vote









StreamPlot[-1 - x^2 + y, 1 + x - y^2, x, -3, 3, y, -3, 3, 
RegionFunction -> Function[x, y, z, 2 < x^2 + y^2 < 9]]


enter image description here



or



StreamPlot[-1 - x^2 + y, 1 + x - y^2, x, y [Element] 


StadiumShape[0, 0, 2, 3, 2]]



enter image description here






share|improve this answer














StreamPlot[-1 - x^2 + y, 1 + x - y^2, x, -3, 3, y, -3, 3, 
RegionFunction -> Function[x, y, z, 2 < x^2 + y^2 < 9]]


enter image description here



or



StreamPlot[-1 - x^2 + y, 1 + x - y^2, x, y [Element] 


StadiumShape[0, 0, 2, 3, 2]]



enter image description here







share|improve this answer














share|improve this answer



share|improve this answer








edited 16 mins ago

























answered 34 mins ago









Johu

3,4131033




3,4131033











  • Thank you very much for your help. This code will be very helpful if I ever need to plot a circular region.
    – GeauxMath
    24 mins ago










  • Just to demonstrate that the solution is not limted to circlar region, I updated the answer with a more compelx shape.
    – Johu
    15 mins ago

















  • Thank you very much for your help. This code will be very helpful if I ever need to plot a circular region.
    – GeauxMath
    24 mins ago










  • Just to demonstrate that the solution is not limted to circlar region, I updated the answer with a more compelx shape.
    – Johu
    15 mins ago
















Thank you very much for your help. This code will be very helpful if I ever need to plot a circular region.
– GeauxMath
24 mins ago




Thank you very much for your help. This code will be very helpful if I ever need to plot a circular region.
– GeauxMath
24 mins ago












Just to demonstrate that the solution is not limted to circlar region, I updated the answer with a more compelx shape.
– Johu
15 mins ago





Just to demonstrate that the solution is not limted to circlar region, I updated the answer with a more compelx shape.
– Johu
15 mins ago











GeauxMath is a new contributor. Be nice, and check out our Code of Conduct.









 

draft saved


draft discarded


















GeauxMath is a new contributor. Be nice, and check out our Code of Conduct.












GeauxMath is a new contributor. Be nice, and check out our Code of Conduct.











GeauxMath is a new contributor. Be nice, and check out our Code of Conduct.













 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f182376%2frestricting-the-domain-of-a-streamplot-to-a-non-rectangular-region%23new-answer', 'question_page');

);

Post as a guest













































































Comments

Popular posts from this blog

Long meetings (6-7 hours a day): Being “babysat” by supervisor

Is the Concept of Multiple Fantasy Races Scientifically Flawed? [closed]

Confectionery