Ask Your Question

terrygarcia's profile - activity

2019-09-02 02:59:40 -0500 received badge  Nice Question (source)
2019-09-01 12:22:03 -0500 asked a question Vector valued function: unable to convert to symbolic expression

This has been giving me quite a headache. It seems that I am unable to create even a simple vector-valued function of multiple variables. For example, the following


spits out a big traceback ending with

TypeError: unable to convert (1, s, s*t) to a symbolic expression.

What's going on here? I know I can use substitution instead, but what if I'd prefer a callable function?

2019-02-15 00:29:14 -0500 received badge  Famous Question (source)
2018-02-28 10:43:21 -0500 received badge  Notable Question (source)
2017-08-10 08:33:47 -0500 received badge  Student (source)
2017-07-26 18:02:46 -0500 received badge  Popular Question (source)
2017-07-21 16:57:36 -0500 commented answer Piecewise Symbolic Function with Conditional Statement

There isn't any sort of conditional statement in the above code, which is what my question addresses.

2017-07-21 12:52:38 -0500 asked a question Piecewise Symbolic Function with Conditional Statement

I wish to incorporate a conditional Python expression (if ... else ...) in a symbolic function.

Suppose I have a piecewise function k(n) defined for n = 1,2,3... as in the following pseudocode:

k(n) =
    2 if n = 1
    n otherwise

I compose this with another function g(x) and wish to integrate the result. For example,

f(n=...).integrate(x, 0, 1)

How can implement a non-evaluating conditional in a symbolic Sage function?