[sage-support] Re: Bessel Contour Plot problem

2011-10-21 Thread Eric Kangas
Well I did use your method but I still get an error. Code: r,z = var('r,z') gro = 1.0 kro = 3.0 def f(r,z): term1 = (1+(bessel_J(0, gro)/bessel_J(2,gro)))*(r/ kro)*(bessel_J(1, r)/bessel_J(1,gro))*cos(z) term2 = -(bessel_J(0,r)/ bessel_J(2, gro))*(r**2/kro**2) return term1 + term2 if t != 0

[sage-support] Re: Bessel Contour Plot problem

2011-10-21 Thread achrzesz
This version works for me: r,z = var('r,z') gro = 1.0 kro = 3.0 def f(r,z): term1 = (1+(bessel_J(0, gro)/bessel_J(2,gro)))*(r/ kro)*(bessel_J(1, r)/bessel_J(1,gro))*cos(z) term2 = -(bessel_J(0,r)/bessel_J(2, gro))*(r**2/kro**2) return term1 + term2 p = contour_plot(f , (r, 0, 2.5),

Re: [sage-support] Re: Bessel Contour Plot problem

2011-10-21 Thread D. S. McNeil
Hi! I'm not sure what you mean by Also if I have the terms, and return on separate lines in the definition then I get this error. You _have_ to have the different statements on separate lines, like I did. (Unless you use a semicolon to separate the statements, I suppose.) Did you combine

[sage-support] Re: Bessel Contour Plot problem

2011-10-21 Thread Eric Kangas
Everything worked once I placed semicolons after each line in the definition of the function. On Oct 21, 5:22 pm, D. S. McNeil dsm...@gmail.com wrote: Hi! I'm not sure what you mean by Also if I have the terms, and return on separate lines in the definition then I get this error. You

[sage-support] Re: Bessel Contour Plot problem

2011-10-20 Thread Eric Kangas
A new issue came up. program: r,z = var('r,z') gro = 1.0 kro = 3.0 def f(y,t): return (1+(bessel_J(0, gro)/bessel_J(2, gro)))*(r/ kro)*(bessel_J(1, r)/bessel_J(1,gro))*z.cos()-(bessel_J(0,r)/ bessel_J(2, gro))*(r**2/kro**2) if t != 0 else infinity p = contour_plot(f , (r, 0, 2.5), (z, 0, 4),

Re: [sage-support] Re: Bessel Contour Plot problem

2011-10-20 Thread D. S. McNeil
def f(y,t): return (1+(bessel_J(0, gro)/bessel_J(2, gro)))*(r/ kro)*(bessel_J(1, r)/bessel_J(1,gro))*z.cos()-(bessel_J(0,r)/ bessel_J(2, gro))*(r**2/kro**2) if t != 0 else infinity A few things: (1) Your arguments to this function are y and t, but inside you use r and z. r and z are still

[sage-support] Re: Bessel Contour Plot problem

2011-10-17 Thread Eric Kangas
I still get an error: p = contour_plot(f, (y, 0, 6), (t, 0, 3), fill = false, axes_labels=['$gro$','$kro$'], contours = [0.1, 0.2, 0.3, 0.5, 0.7, 1.0, 2.0, 4.0], legend_label='qwall'); File , line 1, in module File /tmp/tmpZLCoKg/___code___.py, line 6 return (sqrt(t**_sage_const_2

[sage-support] Re: Bessel Contour Plot problem

2011-10-17 Thread kcrisman
SyntaxError: invalid syntax You'll need to type the whole part after def f(y,t): in just one line, and similarly for the whole plot command. Google groups tends to cut off things at a fairly short line length. - kcrisman -- To post to this group, send email to