Restricting the domain of a StreamPlot to a non rectangular region
Clash 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 $?
plotting
New contributor
add a comment |Â
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 $?
plotting
New contributor
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
add a comment |Â
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 $?
plotting
New contributor
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
plotting
New contributor
New contributor
edited 28 mins ago
Johu
3,4131033
3,4131033
New contributor
asked 41 mins ago
GeauxMath
132
132
New contributor
New contributor
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
add a comment |Â
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
add a comment |Â
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]]
Thank you very much for your help
â GeauxMath
25 mins ago
add a comment |Â
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]]
or
StreamPlot[-1 - x^2 + y, 1 + x - y^2, x, y [Element]
StadiumShape[0, 0, 2, 3, 2]]
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
add a comment |Â
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]]
Thank you very much for your help
â GeauxMath
25 mins ago
add a comment |Â
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]]
Thank you very much for your help
â GeauxMath
25 mins ago
add a comment |Â
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]]
Try
StreamPlot[dx/dt, dy/dt, x, 0, L, y, 0, L, RegionFunction -> Function[x, y, x+y <= L]]
answered 34 mins ago
That Gravity Guy
723410
723410
Thank you very much for your help
â GeauxMath
25 mins ago
add a comment |Â
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
add a comment |Â
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]]
or
StreamPlot[-1 - x^2 + y, 1 + x - y^2, x, y [Element]
StadiumShape[0, 0, 2, 3, 2]]
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
add a comment |Â
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]]
or
StreamPlot[-1 - x^2 + y, 1 + x - y^2, x, y [Element]
StadiumShape[0, 0, 2, 3, 2]]
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
add a comment |Â
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]]
or
StreamPlot[-1 - x^2 + y, 1 + x - y^2, x, y [Element]
StadiumShape[0, 0, 2, 3, 2]]
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]]
or
StreamPlot[-1 - x^2 + y, 1 + x - y^2, x, y [Element]
StadiumShape[0, 0, 2, 3, 2]]
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
add a comment |Â
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
add a comment |Â
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.
GeauxMath is a new contributor. Be nice, and check out our Code of Conduct.
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
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
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
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
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
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