ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Tue, 16 Sep 2014 00:19:12 +0200Need help with an error?https://ask.sagemath.org/question/24118/need-help-with-an-error/In sage math I put in the following software
var('n a b x y s u v A')
n = 5100
a = 0
b = 2*pi
h = (b-a)/n
s = 0
for i in range(n):
x = a + i*h
s = s + find_root(((y*cos(x))^2+u)/4+((y*sin(x))^2+v)/9-1,0,4)
A = float((b-a)/n*s)
var('u v A')
f_x = u
f_y = v
f_z = A
parametric_plot3d([f_x, f_y, f_z], (u, -2, 2), (v, -2, 2))
However, I was given the following error...
Error in lines 7-9
Traceback (most recent call last):
File "/projects/180e8f3c-9dc5-424f-abcc-5267257c0d31/.sagemathcloud/sage_server.py", line 736, in execute
exec compile(block+'\n', '', 'single') in namespace, locals
File "", line 3, in <module>
File "/usr/local/sage/sage-6.3.beta6/local/lib/python2.7/site-packages/sage/numerical/optimize.py", line 77, in find_root
return f.find_root(a=a,b=b,xtol=xtol,rtol=rtol,maxiter=maxiter,full_output=full_output)
File "expression.pyx", line 9683, in sage.symbolic.expression.Expression.find_root (build/cythonized/sage/symbolic/expression.cpp:42560)
NotImplementedError: root finding currently only implemented in 1 dimension.
Is there a way I can graph this? If so is there also a way to find the maximum values of u and v, from this parametric function?Sun, 14 Sep 2014 21:47:53 +0200https://ask.sagemath.org/question/24118/need-help-with-an-error/Comment by William Stein for <p>In sage math I put in the following software</p>
<pre><code>var('n a b x y s u v A')
n = 5100
a = 0
b = 2*pi
h = (b-a)/n
s = 0
for i in range(n):
x = a + i*h
s = s + find_root(((y*cos(x))^2+u)/4+((y*sin(x))^2+v)/9-1,0,4)
A = float((b-a)/n*s)
var('u v A')
f_x = u
f_y = v
f_z = A
parametric_plot3d([f_x, f_y, f_z], (u, -2, 2), (v, -2, 2))
</code></pre>
<p>However, I was given the following error...</p>
<pre><code>Error in lines 7-9
Traceback (most recent call last):
File "/projects/180e8f3c-9dc5-424f-abcc-5267257c0d31/.sagemathcloud/sage_server.py", line 736, in execute
exec compile(block+'\n', '', 'single') in namespace, locals
File "", line 3, in <module>
File "/usr/local/sage/sage-6.3.beta6/local/lib/python2.7/site-packages/sage/numerical/optimize.py", line 77, in find_root
return f.find_root(a=a,b=b,xtol=xtol,rtol=rtol,maxiter=maxiter,full_output=full_output)
File "expression.pyx", line 9683, in sage.symbolic.expression.Expression.find_root (build/cythonized/sage/symbolic/expression.cpp:42560)
NotImplementedError: root finding currently only implemented in 1 dimension.
</code></pre>
<p>Is there a way I can graph this? If so is there also a way to find the maximum values of u and v, from this parametric function?</p>
https://ask.sagemath.org/question/24118/need-help-with-an-error/?comment=24141#post-id-24141I don't understand what you're trying to do either, but maybe implicit_plot3d would be useful... given the find_root appearing there.Tue, 16 Sep 2014 00:19:12 +0200https://ask.sagemath.org/question/24118/need-help-with-an-error/?comment=24141#post-id-24141Comment by Krishnan Arbuja for <p>In sage math I put in the following software</p>
<pre><code>var('n a b x y s u v A')
n = 5100
a = 0
b = 2*pi
h = (b-a)/n
s = 0
for i in range(n):
x = a + i*h
s = s + find_root(((y*cos(x))^2+u)/4+((y*sin(x))^2+v)/9-1,0,4)
A = float((b-a)/n*s)
var('u v A')
f_x = u
f_y = v
f_z = A
parametric_plot3d([f_x, f_y, f_z], (u, -2, 2), (v, -2, 2))
</code></pre>
<p>However, I was given the following error...</p>
<pre><code>Error in lines 7-9
Traceback (most recent call last):
File "/projects/180e8f3c-9dc5-424f-abcc-5267257c0d31/.sagemathcloud/sage_server.py", line 736, in execute
exec compile(block+'\n', '', 'single') in namespace, locals
File "", line 3, in <module>
File "/usr/local/sage/sage-6.3.beta6/local/lib/python2.7/site-packages/sage/numerical/optimize.py", line 77, in find_root
return f.find_root(a=a,b=b,xtol=xtol,rtol=rtol,maxiter=maxiter,full_output=full_output)
File "expression.pyx", line 9683, in sage.symbolic.expression.Expression.find_root (build/cythonized/sage/symbolic/expression.cpp:42560)
NotImplementedError: root finding currently only implemented in 1 dimension.
</code></pre>
<p>Is there a way I can graph this? If so is there also a way to find the maximum values of u and v, from this parametric function?</p>
https://ask.sagemath.org/question/24118/need-help-with-an-error/?comment=24122#post-id-24122I want to plot a 3-d parameter. Try and think of it this way. I'm trying to find the area under a specific curve. That is A. Then if you see u, and v in inside find_root(find_root(((y*cos(x))^2+u)/4+((y*sin(x))^2+v)/9-1,0,4)), I need highest value of A, at u, and v......
x=u
y=v
z=A
Just look above, and it will make sense.
If not I'll figure it out myself. This is as much as I can clarify it. You'll only understand if you were literally with me. This is clearly not the case!Mon, 15 Sep 2014 00:04:59 +0200https://ask.sagemath.org/question/24118/need-help-with-an-error/?comment=24122#post-id-24122Comment by tmonteil for <p>In sage math I put in the following software</p>
<pre><code>var('n a b x y s u v A')
n = 5100
a = 0
b = 2*pi
h = (b-a)/n
s = 0
for i in range(n):
x = a + i*h
s = s + find_root(((y*cos(x))^2+u)/4+((y*sin(x))^2+v)/9-1,0,4)
A = float((b-a)/n*s)
var('u v A')
f_x = u
f_y = v
f_z = A
parametric_plot3d([f_x, f_y, f_z], (u, -2, 2), (v, -2, 2))
</code></pre>
<p>However, I was given the following error...</p>
<pre><code>Error in lines 7-9
Traceback (most recent call last):
File "/projects/180e8f3c-9dc5-424f-abcc-5267257c0d31/.sagemathcloud/sage_server.py", line 736, in execute
exec compile(block+'\n', '', 'single') in namespace, locals
File "", line 3, in <module>
File "/usr/local/sage/sage-6.3.beta6/local/lib/python2.7/site-packages/sage/numerical/optimize.py", line 77, in find_root
return f.find_root(a=a,b=b,xtol=xtol,rtol=rtol,maxiter=maxiter,full_output=full_output)
File "expression.pyx", line 9683, in sage.symbolic.expression.Expression.find_root (build/cythonized/sage/symbolic/expression.cpp:42560)
NotImplementedError: root finding currently only implemented in 1 dimension.
</code></pre>
<p>Is there a way I can graph this? If so is there also a way to find the maximum values of u and v, from this parametric function?</p>
https://ask.sagemath.org/question/24118/need-help-with-an-error/?comment=24121#post-id-24121What do you expect when you write
find_root(((y*cos(x))^2+u)/4+((y*sin(x))^2+v)/9-1,0,4) ? More generally, what mathematical function do you want to plot ? Your code is very confusing, for example when you write var('u v A') you should know that the previously computed value of A is replaced by the symbolic variable A.Sun, 14 Sep 2014 22:49:39 +0200https://ask.sagemath.org/question/24118/need-help-with-an-error/?comment=24121#post-id-24121