Relative Content

Tag Archive for sympy

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