sage: plot(lambda w:arg(1/(I*w) + 1/2 + (I*w)) ,(w,0,5), axes_labels=['$Frequency$', '$Phase$'])
On 4 Kwi, 22:41, Renan Birck Pinheiro <[email protected]> wrote: > Hello, > > I define a complex-valued function, and then want to plot its absolute > value and argument: > > w = var('w') > V(omega) = 1/(I*omega) + 1/2 + (I*omega) > > plot(abs(V(w)),(w,0.1,5), axes_labels=['$Frequency$', '$Voltage$']) # > This works, I get the correct plot. > > However, I want to plot the argument of this function, and I try: > > plot(arg(V(w)),(w,0,5), axes_labels=['$Frequency$', '$Phase$']) > > But it gives those errors: > > ------ > Traceback (most recent call last): > File "<stdin>", line 1, in <module> > File "_sage_input_29.py", line 10, in <module> > exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8 > -*-\\n" + > _support_.preparse_worksheet_cell(base64.b64decode("cGxvdChhcmcoVih3KSksKHcsMCw1KSwgYXhlc19sYWJlbHM9WyckRnJlcXVlbmN5JCcsICckUGhhc2UkJ10p"),globals())+"\\n"); > execfile(os.path.abspath("___code___.py")) > File "", line 1, in <module> > > File "/tmp/tmphudQ36/___code___.py", line 3, in <module> > exec compile(u"plot(arg(V(w)),(w,_sage_const_0 ,_sage_const_5 ), > axes_labels=['$Frequency$', '$Phase$'])" + '\n', '', 'single') > File "", line 1, in <module> > > File > "/tools/sage/local/lib/python2.6/site-packages/sage/misc/functional.py", > line 81, in arg > except AttributeError: return CDF(x).arg() > File "complex_double.pyx", line 310, in > sage.rings.complex_double.ComplexDoubleField_class.__call__ > (sage/rings/complex_double.c:4190) > File "parent.pyx", line 915, in sage.structure.parent.Parent.__call__ > (sage/structure/parent.c:6668) > File "coerce_maps.pyx", line 82, in > sage.structure.coerce_maps.DefaultConvertMap_unique._call_ > (sage/structure/coerce_maps.c:3119) > File "coerce_maps.pyx", line 77, in > sage.structure.coerce_maps.DefaultConvertMap_unique._call_ > (sage/structure/coerce_maps.c:3022) > File "complex_double.pyx", line 344, in > sage.rings.complex_double.ComplexDoubleField_class._element_constructor_ > (sage/rings/complex_double.c:4592) > File "expression.pyx", line 928, in > sage.symbolic.expression.Expression._complex_double_ > (sage/symbolic/expression.cpp:5306) > File "expression.pyx", line 771, in > sage.symbolic.expression.Expression._eval_self > (sage/symbolic/expression.cpp:4763) > TypeError: Cannot evaluate symbolic expression to a numeric value. > ------ > > How do I solve this problem? > > I'm using sage 4.6.2. > > Thanks! > -- > Renan Birck Pinheiro - Grupo de Microeletr�nica - Eng. El�trica/UFSM > > http://renanbirck.blogspot.com|http://twitter.com/renan2112 > skype: renan.ee.ufsm | msn: [email protected] -- 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
