Can you determine if a sympy expression has an explicit time dependence?
Can you determine if a sympy expression has an explicit time dependence?
Can you check if an expression is strictly quadratic in a variable in sympy?
I have some sympy expressions which are functions some variables. Is it possible to check the following in sympy:
Sympy’s `subs` function does not work correctly with `exp`
I use SymPy to compute exp(U)
, where U
is a matrix of symbols.
Then, I want to substitute the symbols in U
for values, but SymPy gives me the wrong result.
Below is a minimal code example:
Maybe a wrong rank when there are parameters
The result of the following code is 2, but the value of the rank of the matrix is not 2 if k = 0
. Is this a bug?
Codegen Sympy computing matrix of expressions
I have a set of matrices with sympy expressions. I succeed to generate a .f90 file and used it properly in another code but I have still two problems.
Write module Sympy codegen
I have a set of matrix and I would like to generate a code that compute the matrix, to plug it into another code already done. My problem is I don’t know the variables that I need to compute theses matrices but I know all the possible variables. So I would like to create a module when called do something like this CALL eq2(mu,zeta,phi,out) and the matrix is stored in out and phi can be put as an input even it is not used. I tried with argument sequence but I can’t find a way to deal with it.
Write several subroutines in a file SymPy Codegen
I have a set of sympy matrix with different variables inside and I would like to generate a file in Fortran of these matrices in order to plug it inside an existing code as a module.
But I see from the documentation to write several subroutines in the same file but I can’t find a way to do it. If you have some hints also to create a module via Codegen, it will be nice.
Thank you
interaction between latex2sympy and sympy.symbols()
I’m not understanding the interaction between latex2sympy and sympy.symbols() properly.