ASKSAGE: Sage Q&A Forum - Individual question feedhttp://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Thu, 16 Apr 2015 02:43:38 -0500Plotting issue, number of arguments errorhttp://ask.sagemath.org/question/26429/plotting-issue-number-of-arguments-error/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/___code___.py", 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')
show(plot1)
Thu, 02 Apr 2015 12:19:22 -0500http://ask.sagemath.org/question/26429/plotting-issue-number-of-arguments-error/Comment by ajk_birdman for <p>Hey all,</p>
<p>I have a question that's probably been asked before (tough I couldn't find it here)</p>
<p>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:</p>
<hr/>
<pre><code>*File "", line 1, in <module>
File "/tmp/tmp0fBGGb/___code___.py", 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*
</code></pre>
<hr/>
<p>Does anyone have any ideas what this could be?
(Using sageNB and 6.4.1)</p>
<pre><code>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')
show(plot1)
</code></pre>
http://ask.sagemath.org/question/26429/plotting-issue-number-of-arguments-error/?comment=26555#post-id-26555Thanks 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.Thu, 16 Apr 2015 02:43:38 -0500http://ask.sagemath.org/question/26429/plotting-issue-number-of-arguments-error/?comment=26555#post-id-26555Comment by calc314 for <p>Hey all,</p>
<p>I have a question that's probably been asked before (tough I couldn't find it here)</p>
<p>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:</p>
<hr/>
<pre><code>*File "", line 1, in <module>
File "/tmp/tmp0fBGGb/___code___.py", 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*
</code></pre>
<hr/>
<p>Does anyone have any ideas what this could be?
(Using sageNB and 6.4.1)</p>
<pre><code>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')
show(plot1)
</code></pre>
http://ask.sagemath.org/question/26429/plotting-issue-number-of-arguments-error/?comment=26445#post-id-26445This works fine for me in Sage Math Cloud and in sagecell.sagemath.org. I do wonder whether you need to make sure Area is not a list in your version of Sage.Sun, 05 Apr 2015 19:53:22 -0500http://ask.sagemath.org/question/26429/plotting-issue-number-of-arguments-error/?comment=26445#post-id-26445