Ask Your Question

Matrin's profile - activity

2018-02-16 13:40:42 +0200 commented answer trying to plot the phase angle of a Laplace transfer function

meanwhile I fixed it by writing abs(F(I*S)) and agr(F(I*S))... step by step i was suspecting that S was replaced by real Values from the x-axis. The function F stands or the Laplace Transform of a "first order low-pass filter", and the x-axis should equal w

2018-02-15 07:42:23 +0200 answered a question trying to plot the phase angle of a Laplace transfer function

Thank you that works,

the error message is gone... and after a few corrections thats my code:

n=1;1;1000
T1=0.1
w=2*pi*10*n/1000
S=I*w
F(S)=1/(1+S*T1)
P1=plot_loglog(abs(F(S)), xmin=0.1, xmax=100.0, ymin=0.1)
P2=plot_semilogx(arg(F(S)), xmin=0.1, xmax=100.0, ymax=0, ymin=-pi/2)
P1.show()
P2.show()

but the output of the second plot is not what i was expecting. Hmmm, sorry I'm not allowed to upload files, but let my explaine. The out put is just a straight line that covers the x-axis and it is supposed to be an s-shaped curve that goes from 0 to -pi/2.

So there ist still something wrong with that function arg(). Is there a way to examine the output of the function arg()?

2018-02-14 12:11:05 +0200 received badge  Editor (source)
2018-02-14 11:10:48 +0200 received badge  Student (source)
2018-02-14 11:09:44 +0200 asked a question trying to plot the phase angle of a Laplace transfer function

hello, I'm new to sagemath and while i was trying to dig into it i came across the following problem see my small program... ​

n=1;1;1000
T1=0.1 w=2*pi*10*n/1000
S=I*w

F(S)=1/(1+S*T1)

P1=plot_loglog(abs(F), xmin=0.1, xmax=100.0, ymin=0.1)
P2=plot_semilogx(arg(F), xmin=0.1, xmax=100.0, ymax=0, ymin=-90)
P=P1+P1 p.show()

I'm getting the following error message:

I dont know how to fix this, i would really apreciate if one can give me some hints...

---------------------------------------------------------------------------

TypeError Traceback (most recent call last)
<ipython-input-1-b52c0c8fff57> in <module>()
8
9 P1=plot_loglog(abs(F), xmin=RealNumber('0.1'), xmax=RealNumber('100.0'), ymin=RealNumber('0.1'))
---> 10 P2=plot_semilogx(arg(F), xmin=RealNumber('0.1'), xmax=RealNumber('100.0'), ymax=Integer(0), ymin=-Integer(90))
11 P=P1+P1
12 p.show()

/home/sc_serv/sage/src/sage/symbolic/function.pyx in sage.symbolic.function.BuiltinFunction.__call__ (build/cythonized/sage/symbolic/function.cpp:11602)()
992 res = self._evalf_try_(*args)
993 if res is None:
--> 994 res = super(BuiltinFunction, self).__call__(
995 *args, coerce=coerce, hold=hold)
996

/home/sc_serv/sage/src/sage/symbolic/function.pyx in sage.symbolic.function.Function.__call__ (build/cythonized/sage/symbolic/function.cpp:6439)()
472 if callable(method):
473 return method()
--> 474 raise TypeError("cannot coerce arguments: %s" % (err))
475
476 else: # coerce == False

TypeError: cannot coerce arguments: no canonical coercion from Callable function ring with argument S to Symbolic Ring