On 27/04/12 20:52, Jason Grout wrote:
On 4/27/12 10:15 AM, Jose Guzman wrote:
Dear colleagues,
I am trying to manipulate an expression that starts at a time =
"tonset". Everything works nice until I try to plot.
#define independent variable
sage: t = var('t')
# define parameters
sage: taum, tauh = var('taum, tauh')
sage: tonset=var('tonset')
# normalize the equation
sage: f(t) = -e^(-t/taum)*(1-e^(-t/tauh))
sage: Tmax = solve(diff(f(t),t)==0,t)[0].rhs()
sage: norm_f(t) = (f(t-tonset) / f(Tmax))
Right here, aren't you shifting the plot of f to the right by tonset?
norm_f(t+tonset)=f((t+tonset)-tonset)/f(Tmax)=f(t)/f(Tmax), so that
norm_f(0+3)=f(0)/f(Tmax)? I think that horizontal shift may be the
problem?
Yes, this is exactly what I wanted; to have an offset, where the
function starts. Obviously, I want to plot between t=0 and a large t, so
that I can see where the onset begining.I find anyoing having to change
the axis, and I cannot get it with the Piecewise function
So do you just want norm_f(t)=f(t)/f(Tmax)?
I want a function that I can start at every tonset that i get:
f(t) =-e^(-(t-tonset)/taum)*(1-e^(-(t-tonset)/tauh))
Tmax = solve(diff(f(t),t)==0,t)[0].rhs()
norm(t) = f(t)/f(Tmax)
plot(epsc.subs(taum=0.3, tauh=5, tonset=3), 0+3, 5+3, figsize=[6,3])
Ideally, I would like to call the function plot with xmin=0 and
xmax=whatever.
Thanks to yoU!
Jose
--
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
For more options, visit this group at
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org