* Use plot3d
* typo error mp2 versus m2 and mp1 versus m1 ?
This works.
var('t1 t2')
m1 = 0.33;
m2 = 0.39;
sap = 1.2;
saf = 0.4;
H = 10;
E(t1,t2)= -1*m1*H*sin(t1) - m2* H * sin(t2)+sap * cos(t2-t1)-saf * sin
(t1)
plot3d(E,(t1,-5,5),(t2,-5,5))
R.M.
On 7 říj, 23:09, SG <[email protected]> wrote:
> Hi,
> I am trying to plot this trignometric function using plot3D, but I
> keep getting this "value error: free variable". I run Sage 3.2.3 on
> Win XP Sp2 (WMware 2.5.2)
> Here's the code:
> var('t1 t2 m1 m2 H sap saf')
> E(t1,t2)= -1*m1*H*sin(t1) - m2* H * sin(t2)+sap * cos(t2-t1)-saf * sin
> (t1);
> mp1 = 0.33;
> mp2 = 0.39;
> sap = 1.2;
> saf = 0.4;
> H = 10;
> plot(E,(t1,-5,5),(t2,-5,5))
>
> What am I doing wrong? Please help:
>
> Here's the error message I get:
>
> Traceback (click to the left for traceback)
> ...
> ValueError: free variable: mp2
>
> Traceback (most recent call last):
> File "<stdin>", line 1, in <module>
> File "/home/notebook/sage_notebook/worksheets/admin/8/code/3.py",
> line 13, in <module>
> plot(E,(t1,-_sage_const_5 ,_sage_const_5 ),(t2,-
> _sage_const_5 ,_sage_const_5 ))
> File "/usr/local/sage/local/lib/python2.5/site-packages/
> zope.interface-3.3.0-py2.5-linux-i686.egg/", line 1, in <module>
>
> File "/usr/local/sage/local/lib/python2.5/site-packages/sage/plot/
> misc.py", line 388, in wrapper
> return func(*args, **kwds)
> File "/usr/local/sage/local/lib/python2.5/site-packages/sage/plot/
> misc.py", line 285, in wrapper
> return func(*args, **options)
> File "/usr/local/sage/local/lib/python2.5/site-packages/sage/plot/
> plot.py", line 1602, in plot
> G = funcs.plot(*args, **original_opts)
> File "/usr/local/sage/local/lib/python2.5/site-packages/sage/
> calculus/calculus.py", line 975, in plot
> f = F._fast_float_(param)
> File "/usr/local/sage/local/lib/python2.5/site-packages/sage/
> calculus/calculus.py", line 4898, in _fast_float_
> fops = [op._fast_float_(*vars) for op in self._operands]
> File "/usr/local/sage/local/lib/python2.5/site-packages/sage/
> calculus/calculus.py", line 4898, in _fast_float_
> fops = [op._fast_float_(*vars) for op in self._operands]
> File "/usr/local/sage/local/lib/python2.5/site-packages/sage/
> calculus/calculus.py", line 4898, in _fast_float_
> fops = [op._fast_float_(*vars) for op in self._operands]
> File "/usr/local/sage/local/lib/python2.5/site-packages/sage/
> calculus/calculus.py", line 4898, in _fast_float_
> fops = [op._fast_float_(*vars) for op in self._operands]
> File "/usr/local/sage/local/lib/python2.5/site-packages/sage/
> calculus/calculus.py", line 4898, in _fast_float_
> fops = [op._fast_float_(*vars) for op in self._operands]
> File "/usr/local/sage/local/lib/python2.5/site-packages/sage/
> calculus/calculus.py", line 4898, in _fast_float_
> fops = [op._fast_float_(*vars) for op in self._operands]
> File "/usr/local/sage/local/lib/python2.5/site-packages/sage/
> calculus/calculus.py", line 5443, in _fast_float_
> raise ValueError, "free variable: %s" % self._name
> ValueError: free variable: mp2
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---