[sage-support] dynamical systems

2010-03-30 Thread Renato Budinich
Hello, I'm studying a course in dynamical systems and I was wondering if,
given a differential equation, there are easy (i.e. not writing the
functions myself)
 ways, in SAGE, to:

1- draw phase portraits
2- draw bifurcation diagrams

currently I'm concerned mainly about continous 1-dimensional autonomous
systems depending on a paramater, but I'll be doing also non-autonomous,
discrete, and 2-dimensional systems.

thanks for any help/suggestions

renato

-- 
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

To unsubscribe from this group, send email to 
sage-support+unsubscribegooglegroups.com or reply to this email with the words 
"REMOVE ME" as the subject.


[sage-support] newbie: plotting sum of cosines...complex values?

2011-01-30 Thread Renato Budinich
Hello, I'd like to plot this function of x (latex code):
x/2 + sum_{r=1}^n cos(rx)
for some fixed n. However I'm running into problems... as I understand it
sage converts the sum of cosines in a sum of exponentials, but then somehow
doesn't get real values (and thus can't plot the function in the plane).
Below is the code and the error. Am I doing something wrong? I'm on sage
4.4.2

renato


k = var('k');
s(x,n) = x/2 + sum(cos(k*x),k,1,n);
n0 = 5;
plot(s(x,n0),(x,0,pi));

verbose 0 (3495: plot.py, generate_plot_points) WARNING: When plotting,
failed to evaluate function at 200 points.
verbose 0 (3495: plot.py, generate_plot_points) Last error message:
'can't convert complex to float; use abs(z)'

-- 
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


Re: [sage-support] plot(): no ticks and arrow on axes?

2011-01-31 Thread Renato Budinich
On Mon, Jan 31, 2011 at 12:48 AM, Francois Maltey  wrote:

> Renato a écrit :
>
>  Hello, I can't understand how the ticks option works in plot()... I
>> want to have no ticks or labels on the axis.
>>
>> Also, is it possible to show the arrows on the axis? like this:
>> http://www.homeschoolmath.net/blog/few-complex-numbers.gif
>>
>> I'm using latest version of sage
>>
>>
>
> Search ticks and axes in plot? and copy/paste the examples :
>
> plot(sin(pi*x), (x, -8, 8), ticks=[[],[]], axes=false)
> + arrow((-8,0),(8,0), color="black")
> + arrow((0,-1),(0,1), color="black")
>
>
> If you want a grid add a function as
>
> def grid (xmin, xmax, ymin, ymax) :
>   linesYcst = add (line ([(xmin, k), (xmax, k)]) for k in [ceil (ymin)..
> floor(ymax)])
>   linesXcst = add (line ([(k, ymin), (k, ymax)]) for k in [ceil (xmin)..
> floor(xmax)])
>   return linesXcst+linesYcst
>
> read the help about line2d? and find the right options !
>
> Then add to your (almost) last plot : + grid ("the right area")
>
> F.
>
>
>

many thanks

renato

-- 
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


[sage-support] plotting box function

2011-02-04 Thread Renato Budinich
hello,
why is the below code plotting a flat function rather than a box one?

renato


def box(x,c):
if abs(x) < c:
return 1
else:
return 0
var('x')
plot(box(x,1),(x,-3,3))

-- 
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