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), axes_labels=['$gro$','$kro
$'], contours = [0.0, 0.2, 0.4, 0.6, 0.8], labels = True, label_inline
= True, label_colors = 'black', label_inline_spacing = 0.01,
fill=False, aspect_ratio=1, legend_label='polodial')
show(p)
error:
File "", line 1, in <module>
File "/tmp/tmpYWys8j/___code___.py", line 10, in <module>
p = contour_plot(f , (r, _sage_const_0 , _sage_const_2p5 ), (z,
_sage_const_0 , _sage_const_4 ), axes_labels=['$gro$','$kro$'],
contours = [_sage_const_0p0 , _sage_const_0p2 , _sage_const_0p4 ,
_sage_const_0p6 , _sage_const_0p8 ], labels = True, label_inline =
True, label_colors = 'black', label_inline_spacing =
_sage_const_0p01 , fill=False, aspect_ratio=_sage_const_1 ,
legend_label='polodial')
File "/sagenb/sage_install/sage-4.7.1/local/lib/python2.6/site-
packages/sage/misc/decorators.py", line 426, in wrapper
return func(*args, **kwds)
File "/sagenb/sage_install/sage-4.7.1/local/lib/python2.6/site-
packages/sage/misc/decorators.py", line 426, in wrapper
return func(*args, **kwds)
File "/sagenb/sage_install/sage-4.7.1/local/lib/python2.6/site-
packages/sage/misc/decorators.py", line 504, in wrapper
return func(*args, **options)
File "/sagenb/sage_install/sage-4.7.1/local/lib/python2.6/site-
packages/sage/plot/contour_plot.py", line 475, in contour_plot
for y in xsrange(*ranges[1], include_endpoint=True)]
File "/tmp/tmpYWys8j/___code___.py", line 8, in f
def f(y,t): return (_sage_const_1 +(bessel_J(_sage_const_0 , gro)/
bessel_J(_sage_const_2 , gro)))*(r/kro)*(bessel_J(_sage_const_1 , r)/
bessel_J(_sage_const_1 ,gro))*z.cos()-(bessel_J(_sage_const_0 ,r)/
bessel_J(_sage_const_2 , gro))*(r**_sage_const_2 /kro**_sage_const_2 )
if t != _sage_const_0 else infinity
File "/sagenb/sage_install/sage-4.7.1/local/lib/python2.6/site-
packages/sage/functions/special.py", line 829, in bessel_J
z = C(z)
File "/sagenb/sage_install/sage-4.7.1/local/lib/python2.6/site-
packages/sage/rings/complex_field.py", line 279, in __call__
return Parent.__call__(self, x)
File "parent.pyx", line 941, in
sage.structure.parent.Parent.__call__ (sage/structure/parent.c:7102)
File "coerce_maps.pyx", line 82, in
sage.structure.coerce_maps.DefaultConvertMap_unique._call_ (sage/
structure/coerce_maps.c:3254)
File "coerce_maps.pyx", line 77, in
sage.structure.coerce_maps.DefaultConvertMap_unique._call_ (sage/
structure/coerce_maps.c:3157)
File "/sagenb/sage_install/sage-4.7.1/local/lib/python2.6/site-
packages/sage/rings/complex_field.py", line 307, in
_element_constructor_
return x._complex_mpfr_field_( self )
File "expression.pyx", line 933, in
sage.symbolic.expression.Expression._complex_mpfr_field_ (sage/
symbolic/expression.cpp:5437)
File "expression.pyx", line 796, in
sage.symbolic.expression.Expression._eval_self (sage/symbolic/
expression.cpp:4898)
TypeError: Cannot evaluate symbolic expression to a numeric value.
On Oct 18, 3:55 pm, Eric Kangas <[email protected]> wrote:
> thanks that worked.
>
> On Oct 17, 7:34 pm, kcrisman <[email protected]> wrote:
>
> > > 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 [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org