Ask Your Question

strangelove1221's profile - activity

2020-05-23 18:01:58 +0200 received badge  Good Question (source)
2020-05-23 00:20:30 +0200 received badge  Nice Question (source)
2018-07-12 16:53:21 +0200 received badge  Famous Question (source)
2017-12-19 22:28:14 +0200 received badge  Famous Question (source)
2017-12-07 05:14:10 +0200 received badge  Famous Question (source)
2017-02-24 23:45:27 +0200 received badge  Notable Question (source)
2016-05-01 18:16:50 +0200 received badge  Popular Question (source)
2016-04-27 16:45:55 +0200 received badge  Notable Question (source)
2016-04-27 16:45:55 +0200 received badge  Popular Question (source)
2016-04-06 23:33:36 +0200 received badge  Notable Question (source)
2015-08-26 04:05:19 +0200 received badge  Popular Question (source)
2015-05-19 06:05:03 +0200 received badge  Famous Question (source)
2014-04-15 05:01:02 +0200 received badge  Notable Question (source)
2013-09-23 13:36:05 +0200 received badge  Popular Question (source)
2013-09-22 15:32:31 +0200 marked best answer plotting regions in 3D

You can use implicit_plot3d as follows:

sage: region = implicit_plot3d(z, (x, -3, 3), (y, -3, 3), (z, -3, 3), plot_points=100, region=lambda x,y,z: y - 2*x<= 0 and 0<x and x<2 and 0<y and y<3)
sage: region.show()
2013-09-22 12:38:50 +0200 commented answer plotting regions in 3D

Thank you for your help. What does that lambda command do? Also, suppose I want to extend that region upward; that is, let z >=0 and get a solid. Is there an easy tweak to your code to do that?

2013-09-21 20:53:44 +0200 asked a question plotting regions in 3D

I have recently learned to plot regions in the xy-plane as follows:

region_plot([y - 2*x<= 0, 0<x, x<2, 0<y, y<3], (x, -3, 3), (y, -3, 3))

My question is: How do I plot the same region, but living in 3-space? How do I add an extra condition (namely, z=0) so that the region appears in 3-space? The reason I ask is that I want to plot a two-variable function and its region of integration in the same plot.

2013-09-21 19:27:23 +0200 commented answer accessing the components of a vector

Thank you!

2013-09-21 19:27:04 +0200 marked best answer accessing the components of a vector

You can use Python sequence indexing syntax, for which the index numbers start at zero: a=vector([1,2,3]);a[0] returns 1.

2013-09-21 19:06:35 +0200 asked a question accessing the components of a vector

Is there a command in Sage that allows me to access the individual components of a vector? For example, suppose I've defined a vector like a=vector([1,2,3]). I want a command like "a.1" that returns the first component of the vector, so in this case I would want a.1 to return 1. Is there a command like this in Sage? Thanks!

2013-03-28 14:06:31 +0200 received badge  Student (source)
2012-08-20 11:35:08 +0200 received badge  Scholar (source)
2012-08-20 11:35:08 +0200 marked best answer filling in an area under a function or curve in 3 dimensions

In the case of 3d curve you can try something like:

var('t u')
p1=parametric_plot3d([cos(u),sin(u),u^2],(u,-1,1),thickness=10)
p2=sum([line([(cos(t),sin(t),0),(cos(t),sin(t),t^2)]) for t in srange(-1,1,0.02)]) 
p1+p2

In the case of 3d surface:

var('x y')
f(x,y)=x^2*y+10
p0=plot3d(f(x,y),(x,1,3),(y,0,5),opacity=0.2)+plot3d(0,(x,1,3),(y,0,5),opacity=0.2)  
p1=sum([line([(t,0,0),(t,0,f(t,0))]) for t in srange(1,3,0.02)]) 
p2=sum([line([(3,u,0),(3,u,f(3,u))]) for u in srange(0,5,0.1)]) 
p0+p1+p2
2012-08-19 21:19:49 +0200 commented answer filling in an area under a function or curve in 3 dimensions

Thanks for the help.

2012-08-19 15:44:48 +0200 asked a question filling in an area under a function or curve in 3 dimensions

I am new to Sage, and I couldn't find an answer to two question in the documentation. First, how do I get sage to plot a parametric curve in 3 dimensions, and then fill in the area between the curve and the xy-plane (i.e., I want sage to drop down a "sheet" from the curve to the xy-plane)? Similarly, how do I get Sage to plot a function in 3 dimensions (say, $f(x,y)=x^2y+10)$), and tell sage to fill in the volume under the graph between the function and the xy-plane? So for the function $f$ just mentioned, I would like the volume under the curve filled in over the rectangle $1 \leq x \leq 3$, $0 \leq y \leq 5$. How do I do that? Thanks!

2012-08-19 15:27:24 +0200 asked a question getting edge labels in a digraph to display properly

I am new to Sage, and I am trying to get the program to display labeled digraphs the way that I want them. I give Sage the code:

sage: g = DiGraph({0:{1:'x',2:'z',3:'a'}, 2:{5:'out'}});
sage: g.show(edge_labels=True)

When I do this, the graph is displayed with the edge labels, but the labels appear right on top of the edges, which makes the labels hard to read. How do I get the program to display the edge labels right next to the edge, rather than on them? Any help will be appreciated.