I eventually gave up on piecewise. I do something like this now and works just fine for graphs, 3 different functions with separate plots and show them together.

f1(x) = ...
f2(x) = ...
f3(x) = ...

p1 = plot(f1, (0,a))
p2 = plot(f2, (a,b))
p3 = plot(f3, (b,c))
show (p1+p2+p3)

-d
-----Original Message-----
From: kcrisman
Sent: Nov 30, 2012 10:45 PM
To: sage-support@googlegroups.com
Subject: [sage-support] Re: piecewise


Is there something better?  I tried to get piecewise to work, but I
couldn't plot, integrate, etc., the function.

f=piecewise([((1,2), x^2), ((2,3), sin(x))])
plot(f, (x,0,3)) # error, but plot(f) works...
integrate(f, (x,1,3)) # error, but integrate(f) works
diff(f,x) # error, but diff(f) gives a warning and an output

One of the things that would be easier to fix about Piecewise would be to get the syntax to be more in line with the rest of Sage, at least as an option...

--
You received this message because you are subscribed to the Google Groups "sage-support" group.
To post to this group, send email to sage-support@googlegroups.com.
To unsubscribe from this group, send email to sage-support+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support?hl=en.
 
 

--
You received this message because you are subscribed to the Google Groups "sage-support" group.
To post to this group, send email to sage-support@googlegroups.com.
To unsubscribe from this group, send email to sage-support+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support?hl=en.
 
 

Reply via email to