Since people have been introducing themselves I thought I would do the
same. My name is Alan Bromborsky and I am an old fart, 76, and have
been coding since the early 70's. I graduated from the Newark College
of Engineering (now the New Jersey Institute of Technology) in 1968 with
a B.S.E.E. While in school I did take a course in numerical analysis
from Phyllis Fox. I started working at the Harry Diamond Laboratory (US
Army) in 1969 and retired in 2001 (by then it was the Army Research
Laboratory in Adelphi Maryland). My first experience in computing was
misusing IBM JCL and crashing the Johns Hopkins 360. I started
programming in Fortran on the 360, a IBM 1130, and a VAX 11/780
calculating the dispersion curves for solid state models and microwave
slow wave structures. I also got TeX/LaTeX from Stanford for
installation on the VAX. My first personal computer was an Apple II
which is where I learned Basic and Pascale. After getting IBM personal
computers at work I learned C and C++ when the Symantec compiler became
available. When 486 pc's became available at work I learned Autolisp
for programming Autocad and when linux became available I also installed
it on my work computer (Slackware on 50 HD floppy disks). Next I got a
pentium for my work and home pc's. At home and work I installed linux,
C, C++, and python. Upon retiring I look for a way to apply computer
algebra systems to geometric algebra. My first attempt was using GINAC
and C++ until I discovered sympy (which made everything much easier)
while most everything was still being done by Ondrej Certik. Using
sympy I wrote the galgbra geometric algebra module in python ( galgebra
docs <https://galgebra.readthedocs.io/en/latest/> ) and integrated it
into sympy. I removed it from sympy because I was not up to providing
the needed Sphinx documentation. Some geometric algebra enthusiasts
(Cambridge University ) found my distribution on github and started
improving it and documenting it in Sphinx. Since then (last five years)
I have learn the Asymptote (software for generating technical
publication quality drawings and plots) coding language (Asymptote
Software <https://asymptote.sourceforge.io/>). Currently I am developing
sympy classes for piecewise functions (on a fixed grid) that allow
convolution of piecewise functions (I was calculating the inverse
Fourier Transforms of powers of the sinc function) and classed to
convert sympy/python code to Asymptote code to be able to plot sympy
symbolic functions in Asymptote along with proselytizing Asymptote every
change I get (I do the same for sympy).
On 3/22/23 11:26 PM, Aaron Meurer wrote:
On Sun, Mar 19, 2023 at 7:09 PM brombo<[email protected]> wrote:
First I think there is a problem with ccode doing what it is supposed to do.
Consider the following code -
(x,y,th) = symbols(r"x' y' \theta")
then
x' = ccode(x)
y' = ccode(y)
\theta = ccode(th)
I don't think x', y', and \theta are legal program variables in c.
I think this functionality exists in some of the other printers. It
does exist in lambdify, so it shouldn't be too hard to port to the C
printer.
Also I have looking at codegen examples and wish to know if the following
conclusion is correct. If I have a python function (example) -
def W(x):
s = 1
for i in range(10):
s += x**i
return s
there is no simple way (if any) to convert it to -
Starting with Python code is harder, but you can represent this sort
of thing using the codegen ast nodes in sympy.codegen module.
Aaron Meurer
double W(double x)
{
double s = 1;
int i;
for (i=0;i<10;++i)
{
s = s+pow(x,i);
}
return s;
}
On Saturday, March 18, 2023 at 11:14:20 AM [email protected] wrote:
You can make custom printers for any SymPy function to return what you desire.
Subclass the C printer and overwrite/create methods for your functions. The
current c code printer does not target any specialized C libraries (but that
would be a nice addition!).
Jason
moorepants.info
+01 530-601-9791
On Sat, Mar 18, 2023 at 3:18 PM brombo<[email protected]> wrote:
I have looked further and while ccode(expr) can export functions like sin, cox,
exp it cannot export special functions such as bessel, elliptic, etc.. Is there
a way to export special functions into c-code?
On Saturday, March 18, 2023 at 9:52:48 AM UTC-4 brombo wrote:
Does the C code generator generate special function calls with the same syntax
that is used in the gsl (GNU Scientific Library). For example is the sympy
call besselj(nu,z) translated to J(nu,z) etc.?
--
You received this message because you are subscribed to the Google Groups
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email
[email protected].
To view this discussion on the web
visithttps://groups.google.com/d/msgid/sympy/73a99292-df6c-420a-804a-b2a52dfae437n%40googlegroups.com.
--
You received this message because you are subscribed to the Google Groups
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email
[email protected].
To view this discussion on the web
visithttps://groups.google.com/d/msgid/sympy/8dd42cf4-470d-4d78-9b99-71a617b0ff25n%40googlegroups.com.
--
You received this message because you are subscribed to the Google Groups
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/sympy/2acb7aeb-5af4-6b04-d455-e377266ab843%40gmail.com.