Ask Your Question

userX's profile - activity

2019-06-06 02:53:38 -0500 received badge  Nice Question (source)
2018-10-28 08:00:27 -0500 received badge  Popular Question (source)
2018-04-22 05:25:22 -0500 received badge  Nice Question (source)
2018-04-20 23:36:53 -0500 asked a question Solve a differential equation using series expansions.

Given an ODE such as $$y''+x^2y'+y=0$$ Is it possible to get sage to display the solution in the from (at least the first few terms of the expansion) $$y=a_o\left(c_0+c_1x+c_2x^2+\dots\right) + a_1\left(d_0+d_1x+d_2x^2+\dots\right) $$

my attempts:

EDIT: I have made some progress, functional but it is not pretty. second attempt

2018-03-19 13:25:22 -0500 asked a question quick latex question

I am writing a worksheet for an ODE course and would like to display the following equation as $$y''+y=1$$ OR as $$\frac{d^2y}{dx^2}+y=1$$ However sage always reverts to partials. Is there an easy way to display these as ordinary differential equations?

thx

see sage cell link text

2017-11-06 19:40:59 -0500 received badge  Notable Question (source)
2017-11-06 19:40:59 -0500 received badge  Popular Question (source)
2017-07-13 12:19:29 -0500 received badge  Famous Question (source)
2017-07-13 12:19:29 -0500 received badge  Notable Question (source)
2017-07-13 12:19:29 -0500 received badge  Popular Question (source)
2017-01-17 23:01:12 -0500 asked a question How to get the z-score for a given probability for standard normal distribution

I can set mu = 0; sigma = 1; P(x)= (1)/(sigma*sqrt(2*pi))*e^((-(x-mu)^2)/(2*sigma^2));

Then I can always get the probability $P( x < z )$ by doing

p=integrate(P,x,-oo,z)

I would like to do the opposite. Given some probability $p_o$ I would like to find the corresponding $z$ so that $P( x < z )=p_0$ I have tried various things.. but keep running into this sort of issue

any help is greatly appreciated

2016-04-30 15:26:06 -0500 commented answer how do I change the color of the ticks

perfect! thank you!

2016-04-29 18:08:19 -0500 asked a question how do I change the color of the ticks

I have this sage cell

x,y,z,t,u,v= var("x,y,z,t,u,v"); f(x,y)=9-x^2-y^2; G=plot_vector_field(f.diff(), (x,-10,10), (y,-10,10), transparent=True, plot_points=12, color="brown", aspect_ratio=1); G.axes_color((0,0,1)); show(G)

but I would like the tick color to match the blue axes color.

all help is appreciated.

2016-03-13 22:09:39 -0500 asked a question Is there a more elegant way to make an interactive worksheet for students?

I have this so far, but formatting the latex string seems tedious. I am also aware of SageTeX but there, any type of errors simply cause a failure in compiling the pdf file without much information as to what caused the error, or the error messages are not very visible to me. Here is what I have so far.. link text

2016-02-25 11:09:03 -0500 commented answer making background transparent on implicit_plot3d

opacity makes the whole thing transparent. The desired result is as @slelievre points out, to just get rid of the white background. Sorry I can not find anything helpful when I search "transparent" on the docs. Again, thanks for your help.

2016-02-22 09:39:09 -0500 asked a question making background transparent on implicit_plot3d

Plots produced using implicit_plot3d have white background. To get transparent background, I tried using transparent=True in implicit_plot3d and in save, without success:

sage: x, y, z, t = var('x y z t')
sage: name='/Volumes/abcd/Users/efgh/Desktop/ijkl.png'
sage: myplot = implicit_plot3d(z - sqrt(8 - x^2 - y^2),
....:                          [x, -4, 4], [y, -4, 4], [z, -4, 4],
....:                          color='red', axes=True, transparent=True)
sage: myplot.save(filename=name, axes=True, transparent=True, fontsize='12')

The image I obtain has white but not transparent background:

image description

I know implicit_plot3d has an opacity option to set the opacity of the plotted surface, but how can I set the transparency of the background?

2015-12-08 12:26:00 -0500 asked a question embed interactive cycloid plot in beamer+sagetex

I have the following graph and would like to included it on a beamer presentation. It there a way to embed this onto the pdf beamer file? I have sagetex running and working well, works for much of the math on my beamer lectures.

var('x,t,y,t,theta'); @interact def _(degrees=(1..720)): r=4; x=r*(t-sin(t)); y=r*(1-cos(t)); P= point((x.substitute(t=degrees*pi/180), y.substitute(t=degrees*pi/180)), size=80, rgbcolor=(1,0,0)); C = circle((degrees*pi/180*4,4), 4, hue=.7); A = P+C+parametric_plot((x,y), (t,0,degrees*pi/180), rgbcolor=(1,0,0), xmin=-.5, xmax=80, ymin=-1, ymax=10); show(A, xmin=-5.5, xmax=80, ymin=-1, ymax=10)

see link

2015-03-03 10:25:35 -0500 commented answer Is this a bug or what am I missing, simple limit computation

thank you kindly

2015-03-03 10:25:27 -0500 commented answer Is this a bug or what am I missing, simple limit computation

thank you, appreciate the sympy tip

2015-02-28 11:02:17 -0500 asked a question Is this a bug or what am I missing, simple limit computation
f=(e^(-x))/(2+ sin(x));
limit(f,x=infinity)

this yields "undefined", but the limits is clearly zero, thus I gather there's a bug or I am missing something basic . All help is appreciated.

2015-02-16 13:32:06 -0500 commented answer how to re-order factors

very nice thank you! its perfect!

2015-02-16 13:31:47 -0500 received badge  Scholar (source)
2015-02-16 13:31:44 -0500 received badge  Supporter (source)
2015-02-15 16:41:17 -0500 asked a question how to re-order factors

I have

 x,y, dx, dy= var("x, y, dx, dy");
 def iD(f): return diff(f, x)*dx + diff(f,y)*dy;

iD(x^3*y^5) returns

5*dy*x^3*y^4 + 3*dx*x^2*y^5

is there a way to have it return the differentials always at the end as in

5*x^3*y^4*dy + 3*x^2*y^5*dx

thank you

2014-11-11 13:45:31 -0500 received badge  Student (source)
2014-11-11 13:10:50 -0500 asked a question typesetting simple nth root using radical

is there a way to ask sage to typeset $$\sqrt[3]{x}$$ rather than $$x^{1/3}$$ latex(sqrt(x)) does fine but I cant fingure out the general nth root radical notation command

thx

2014-10-27 00:20:31 -0500 edited question Typesetting Simple Student Worksheet Question & need to defer computation

I have

eq1=2*(x+10)/5==3*(6-5*x)/7

the command print latex(eq1) simplifies the equation to $$\frac{2}{5} x + 4 = -\frac{15}{7} x + \frac{18}{7}$$

is there something like latex(eq1.hold()) that would produce

$$\frac{2(x+3)}{5}=\frac{3(6-5x)}{7}$$

edit: I must apologize in advanced as my code may seem infantile but I am very new to this and trying to learn. That said, I was able to get something going but it seems to me there must be a million better ways to do this. Can you point me in the right direction to generalize this process and improve this code. Keep in mind the point of this is to write a student worksheet with problem sets and solutions. can be seen here link text

ri = lambda x,y:  floor(round(random()*(y-x)+x)); #random integer from x to y
ls = [ri(-5,-1),ri(1,3),ri(2,15),ri(2,15)];
rs = [ri(2,10),ri(-3,-1),ri(-6,-2),ri(2,15)];

def texLinearA(t): return "$\\frac{"+str(latex(t[0]))+"\\left("+str(latex(t[1]))+"+"+str(latex(t[2]))+"x\\right)}{"+str(latex(t[3]))+"}$";

def sageLinearA(t): x=var("x"); return  t[0]*(t[1]+t[2]*x)/t[3];

eq1 = texLinearA(ls)+"="+texLinearA(rs);
eq2 = sageLinearA(ls)==sageLinearA(rs);
eq3 = eq2*lcm(ls[3],rs[3]);
eq4=eq3-x*eq3.rhs().coefficient(x);
eq5=eq4-(eq4.lhs()).substitute(x=0);
eq6=eq5*(1/eq5.lhs().coefficient(x));

html(eq1);
show(eq2);
show(eq3);
show(eq4);
show(eq5);