Plotting issue, number of arguments error

asked 2015-04-02 12:19:22 -0500

ajk_birdman gravatar image

updated 2015-04-02 12:48:18 -0500

Hey all,

I have a question that's probably been asked before (tough I couldn't find it here)

I'm trying to plot these two functions of d. Area is a function of d and some other functions of d. I could swear I had this code working a few months ago but now I get the error:

*File "", line 1, in <module>

  File "/tmp/tmp0fBGGb/", line 21, in <module>
    plot1 = plot(Area, R1-R2, limit, color='red')
  File "sage/symbolic/expression.pyx", line 4382, in sage.symbolic.expression.Expression.__call__ (build/cythonized/sage/symbolic/expression.cpp:24669)
  File "sage/symbolic/ring.pyx", line 760, in sage.symbolic.ring.SymbolicRing._call_element_ (build/cythonized/sage/symbolic/ring.cpp:8970)
ValueError: the number of arguments must be less than or equal to 1*

Does anyone have any ideas what this could be? (Using sageNB and 6.4.1)

var('x, y, z, R1, R2, d, a, s1, s2, Area, limit, Area2')

R1 = 6
R2 = 4

a = (1/d)*sqrt( (-d+R1+R2)*(d-R1+R2)*(d+R1-R2)*(d+R1+R2) )

s1 = (a + 2*R1)/2
s2 = (a + 2*R2)/2

limit = sqrt(R1**2 - (R2/2)**2) + (R1 - R2)

Area = [((R1**2)*arcsin(a/(2*R1))) - sqrt(s1*(s1-a)*((s1-R1)^2)) + (R2**2)*(pi - arcsin(a/(2*R2))) + sqrt(s2*(s2-a)*((s2-R2)**2))]

plot1 = plot(Area, d, R1-R2, limit, color='red')

Area2 = ((R1**2)*arcsin(a/(2*R1))) - sqrt(s1*(s1-a)*((s1-R1)^2)) + (R2**2)*(arcsin(a/(2*R2))) - sqrt(s2*(s2-a)*((s2-R2)**2))

plot2 = plot(Area2, d, limit, R1+R2, color='green')
edit retag flag offensive close merge delete


This works fine for me in Sage Math Cloud and in I do wonder whether you need to make sure Area is not a list in your version of Sage.

calc314 gravatar imagecalc314 ( 2015-04-05 19:53:22 -0500 )edit

Thanks calc314 and sorry for the slow response.

Yep. Sagecell worked well. Soon as I deleted the brackets in "Area" it worked fine in other environments too. Not sure why they were there in the first place.

ajk_birdman gravatar imageajk_birdman ( 2015-04-16 02:43:38 -0500 )edit