Ask Your Question
0

Plotting a set of R^2 using three variables

asked 2023-10-01 16:09:13 +0100

pfeifhns gravatar image

I have a set defined as 0<=x<=y, 0<=z<=3, 1<= x^2+y^2 <= 4

the last equation determines circles with raduis 1 and 2, the first equation limits these circles to a quarter in the first quadrant, the second equation makes a solid out of this. How can I plot these equations in sagemath?

Thank you for your effort,

HP

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
1

answered 2023-10-02 17:35:52 +0100

achrzesz gravatar image

Some workaround:

E = EuclideanSpace(3)
cylindrical.<rh,ph,z> = E.cylindrical_coordinates()
cartesian.<x,y,z> = E.cartesian_coordinates()
p=cylindrical.plot(cartesian,ranges={rh:(1,2),ph:(0,pi/4),z:(0,3)},
    number_values={rh:2,ph:15,z:2},thickness=2,
    color={rh:'red', ph:'green',z:'blue'},label_axes=False)
p.show(frame=False)
edit flag offensive delete link more
0

answered 2023-10-01 19:38:20 +0100

eric_g gravatar image

For the subset of $\mathbb{R}^2$, use the function region_plot:

x, y = var('x y')
region_plot([0<=x, x<=y, 1<=x^2+y^2, x^2+y^2<= 4], (x, -2, 2), (y, -2, 2))

For more details, see the description of region_plotat the end of the page https://doc.sagemath.org/html/en/refe...

For a subset of $\mathbb{R}^3$, unfortunately there does not seem to be any function equivalent to region_plot in Sage...

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2023-10-01 16:09:13 +0100

Seen: 167 times

Last updated: Oct 02 '23