Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

The varible cannot be assigned a number

Helllo all,

I simplify the codes as below:

var("T t kx A")

w=2*pi/T

kt=kx+Acos(wt)

hkt=sin(kt)

show(hkt)

hkti=hkt.integral(t)

show(hkti)

when I do

hkti(t=T)

It is OK, but when I want to assign an integer or real number, there is a problem

hkti(t=0)

or

hkti(t=0.0)

The error reads: AttributeError: 'sage.rings.integer.Integer' object has no attribute 'variables' or 'sage.rings.real_mpfr.RealLiteral' object has no attribute 'variables'

It annoys me, could someone help me on this?

Thanks Xiangru

The varible cannot be assigned a number

Helllo all,

I simplify the codes as below:

var("T t kx A")

w=2*pi/T

kt=kx+Acos(wt)

hkt=sin(kt)

show(hkt)

hkti=hkt.integral(t)

show(hkti)

A") w = 2*pi/T kt = kx + A*cos(w*t) hkt = sin(kt) show(hkt) hkti = hkt.integral(t) show(hkti)

when I do

hkti(t=T)

hkti(t=T)

It is OK, but when I want to assign an integer or real number, there is a problem

hkti(t=0)

hkti(t=0)

or

hkti(t=0.0)

hkti(t=0.0)

The error reads: reads:

AttributeError: 'sage.rings.integer.Integer' object has no attribute 'variables'
or 

or

AttributeError: 'sage.rings.real_mpfr.RealLiteral' object has no attribute 'variables'

'variables'

It annoys me, could someone help me on this?

Thanks Xiangru

The varible cannot be assigned a number

I simplify the codes as below:

var("T t kx A")
w = 2*pi/T
kt = kx + A*cos(w*t)
hkt = sin(kt)
show(hkt)
hkti = hkt.integral(t)
show(hkti)

when I do

hkti(t=T)

It is OK, but when I want to assign an integer or real number, there is a problem

hkti(t=0)

or

hkti(t=0.0)

The error reads:

AttributeError: 'sage.rings.integer.Integer' object has no attribute 'variables'

or

AttributeError: 'sage.rings.real_mpfr.RealLiteral' object has no attribute 'variables'

It annoys me, could someone help me on this?

Thanks Xiangru