Re: [sympy] Re: ArrayComprehension or List

2019-06-04 Thread Aaron Meurer
Does it support vectorized operations, e.g., should ArrayComprehension(...) + ArrayComprehension(...) work to add the corresponding elements? If so, then it's an array. If not, then it's more like a list or tuple. Aaron Meurer On Tue, Jun 4, 2019 at 6:52 AM Chris Smith wrote: >> >> As you can

Re: [sympy] Can you pass a symbolic variable through a function?

2019-06-04 Thread Aaron Meurer
Yes, you should replace 'math' and 'numpy' with 'sympy', so that the symbolic functions are used. I also recommend using sympy.Matrix for the symbolic expressions. Then, if you want a numeric expression you can use with numpy, use lambdify() to convert the SymPy expression into a numeric

Re: [sympy] f`(0)

2019-06-04 Thread Aaron Meurer
This is primarily an issue of printing. The str() printer prints things in a way that can be copy-pasted back into SymPy, and since f'(0) isn't valid syntax, you end up with the more verbose representation that is used for the expression. It would be useful to have printers, at least pretty

Re: [sympy] f`(0)

2019-06-04 Thread Oscar Benjamin
Yeah, it would be nice to be able to do that. Unfortunately SymPy has no notion of the derivative of an unapplied function. I'd like to have a differential operator so you could do something like `D(sin) == cos` etc. I believe there are some long-standing issues on Github about this. -- Oscar On

[sympy] f`(0)

2019-06-04 Thread David Bailey
The ability to expand an expression containing unknown functions, about some point, is obviously very valuable, and it is nice that this is possible using SymPy, however if I expand f(x) about 0 I get this: f(0) + x*Subs(Derivative(f(_x), _x), _x, 0) + x**2*Subs(Derivative(f(_x), (_x, 2)), _x,

[sympy] Can you pass a symbolic variable through a function?

2019-06-04 Thread Lucy Jackson
I have a function that I have written, attached file, and would like to pass theta, thetad, phi and phid through it as symbolic variables. Therefore hoping for an output in terms of these variables that I can then integrate. Is this possible?? -- You received this message because you are

[sympy] Re: ArrayComprehension or List

2019-06-04 Thread Chris Smith
> > As you can see, `ArrayComprehension` is more likely to be a such > structure: [[[...]...]...]. Ahh...I see what you mean about the multidimensionality, now. It is a *reshaped *list comprehension: >>> reshape([i + j for i in range(4) for j in range(3) for k in range(2)], [[2]]*3)

Re: [sympy] ArrayComprehension or List

2019-06-04 Thread Oscar Benjamin
In normal Python the main purpose of list is to be mutable. When you want an immutable list you can use tuple. If SymPy had List would it be mutable? If so then it couldn't be a Basic subclass. If not what purpose would it serve? On Tue, 4 Jun 2019 at 04:46, Chris Smith wrote: > > From

[sympy] Fwd: Functions grimoire

2019-06-04 Thread Fredrik Johansson
Hi all, This is slightly related to SymPy: Fungrim, a new special functions reference. http://fredrikj.net/blog/2019/05/a-grimoire-of-functions/ Best, Fredrik -- You received this message because you are subscribed to the Google Groups "sympy" group. To unsubscribe from this group and stop

[sympy] Re: ArrayComprehension or List

2019-06-04 Thread Zhiqi KANG
Hi, As far as I know, the difference between `ArrayComprehension` and `list` lies in the notion of multidimensionality. First of all, for clarification, > `List(i + j, (i,0,3), (j,0,4))` is the unevaluated form of `[i + j for i in range(4) for j in range(5)]`. is not quite true regarding the