Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

automatic substitution within functions?

what i do to do this?

>>>var('t w')

>>>f(t) = sin(w*t)


>>>f
t |--> sin(t*w)

>>>w=2

>>>f
t |--> sin(2*w)
click to hide/show revision 2
Without doing f(w=2)!!!

automatic substitution within functions?

what i do to do this?

>>>var('t w')

>>>f(t) = sin(w*t)


>>>f
t |--> sin(t*w)

>>>w=2

>>>f
t |--> sin(2*w)

Without doing f(w=2)!!! imagine that the function is f->f(a,b,c,d,f....,t)

click to hide/show revision 3
Changed formatting to be more concise, reflect sage: prompts.

automatic substitution within functions?

what i do to do this?

>>>var('t sage: var('t w')

>>>f(t) sage: f(t) = sin(w*t)


>>>f
t |--> sin(t*w)

>>>w=2

>>>f
sage: w = 2
sage: f
t |--> sin(2*w)

Without doing f(w=2)!!! imagine that the function is f->f(a,b,c,d,f....,t)

click to hide/show revision 4
another example f(a,b,c,d...)

automatic substitution within functions?

what i do to do this?

sage: var('t w')
sage: f(t) = sin(w*t)
t |--> sin(t*w)
sage: w = 2
sage: f
t |--> sin(2*w)

Without doing f(w=2)!!! imagine that the function is f->f(a,b,c,d,f....,t)f->f(a,b,c,d,f....,t) like doing this:

...
...
sage: aw1=aw2(m1=1,m2=0.5,l1=1,l2=0.5,g=9.8)
sage: aw2=aw2(m1=1,m2=0.5,l1=1,l2=0.5,g=9.8)
sage: aw4=aw2(m1=1,m2=0.5,l1=1,l2=0.5,g=9.8)
...
...

etc

automatic substitution within functions?

what i do to do this?

sage: var('t w')
sage: f(t) = sin(w*t)
t |--> sin(t*w)
sage: w = 2
sage: f
t |--> sin(2*w)

Without doing f(w=2)!!! imagine that the function is f->f(a,b,c,d,f....,t) like doing this:

...
...
sage: aw1=aw2(m1=1,m2=0.5,l1=1,l2=0.5,g=9.8)
aw1=aw1(m1=1,m2=0.5,l1=1,l2=0.5,g=9.8)
sage: aw2=aw2(m1=1,m2=0.5,l1=1,l2=0.5,g=9.8)
sage: aw4=aw2(m1=1,m2=0.5,l1=1,l2=0.5,g=9.8)
aw4=aw4(m1=1,m2=0.5,l1=1,l2=0.5,g=9.8)
...
...

etc