Re: [sympy] Re: C Code Generator

2023-03-19 Thread brombo
nctions. 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 <(530)%20601-9791> > > > On Sat, Mar 18, 2023 at 3:18 PM brombo wrote: > >> I have looked fu

[sympy] Re: C Code Generator

2023-03-18 Thread brombo
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 c

[sympy] C Code Generator

2023-03-18 Thread brombo
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.

[sympy] Question about printing from my classes?

2023-03-15 Thread brombo
Is the following correct? As long as the classes I write have _sympystr and _latex members the printing using sympy and my objects is transparent. One more question. I am running Ubuntu 22.04 and have not been able to set a PYTHONPATH to include the directories with my code in them. Has

[sympy] Grouping Terms

2023-01-16 Thread brombo
I have a sum of terms some of which are multiplied by cos(th). I want to group these terms together (in parenthesis) and have the terms not multiplied by cos(th). A complicating issue is that the sum is a numerator in a fraction. Consider the following expression: (A*cos(th)+B*cos(th)+C)/D

[sympy] Custom Printing

2022-12-08 Thread brombo
I understand how to create a custom latex printer for my classes using _latex(). My question is there an acceptable way for me to create a custom latex printer for sympy class objects? For example a custom latex printer for sympy functions or derivatives that would override the sympy printer

[sympy] An Improved Interface (API) for differentiation

2022-09-27 Thread brombo
I am developing an improved API for differentiation in sympy which is a class for scalar differential operators (a linear combination of sympy expressions and partial derivatives). The code (test_dop.py attached) produces the following output - [image: test_dop-1.jpg] To run this code also

[sympy] Printing and str()

2022-09-25 Thread brombo
In my class I have _latex and _sympystr. Your latex() function uses my _latex but str() does not use _sympystr I have to define __str__() in my class to print correctly. How should I use _sympystr to return the correct string. def _sympystr(self,printer): if self.order == 0:

[sympy] sympy printer for custom class

2022-09-09 Thread brombo
"latex" function to access my _latex and get the following error message: File "/home/brombo/.local/lib/python3.8/site-packages/sympy/printing/printer.py", line 309, in _print return getattr(expr, self.printmethod)(self, **kwargs) TypeError: _latex() takes 1 positional argument b

[sympy] Evaluation of symbolic integrals

2022-09-07 Thread brombo
I calculated an integral g when printed grives: Piecewise((sin(w/2)/w - 2*cos(w/2)/w**2 + 4*sin(w/2)/w**3, Ne(w, 0)), (2/3, True)) + 2*Piecewise((-sin(w/2)/(2*w) + cos(w/2)/w**2 + sin(w/2)/w**3 - sin(3*w/2)/w**3, Ne(w, 0)), (1/6, True)) First, how can I extract from g (without cutting and

[sympy] Re: Piecewise functions and Convolution

2022-09-06 Thread brombo
Attached is the output of the latest piecewise.py (I got convolution, latex printing, and Asymptote ploting working) On Monday, September 5, 2022 at 11:42:49 AM UTC-4 brombo wrote: > Would this be of any interest to anyone (see and run attached). I have > written a piecewise function

[sympy] Piecewise functions and Convolution

2022-09-05 Thread brombo
Would this be of any interest to anyone (see and run attached). I have written a piecewise function class (not like the one already in sympy) where the piecewise function is defined on an ordered numerical grid (see attached). The class in not finished but I can calculate the convolved

[sympy] Optimum factoring of multinomial expression

2022-02-16 Thread brombo
Does sympy have the capability to optimally factor (minimum number of numerical operations) a polynomial or better yet a multinomial for numerical evaluation. The simple example for a polynomial would be consider the polynomial - y = a*x**3+b*x**2+c*x+d then the optimal factorization

[sympy] Plotting

2021-11-10 Thread brombo
This is a subject that is more general than sympy but is relevant to sympy and I don't know where else to ask this question. For plotting in sympy and python for that matter we pretty much make do with mathplotlib. The software package Asymptote https://asymptote.sourceforge.io/ is much

[sympy] Reintegration of geometric algebra into sympy and documentation requirements

2019-04-02 Thread brombo
After GSOC is over I have someone to help me reintegrate geometric algebra/calculus into sympy. The biggest problem is documentation (all of it is in LaTeX). I know that sympy uses sphinx. Can one use nbsphinx so they can launch tutorial notebooks directly from the documentation or is the

[sympy] Is there a simple way to use sympy in google colab?

2019-03-13 Thread brombo
Is there a simple way to use sympy in google colab? https://colab.research.google.com/notebooks/welcome.ipynb -- 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

[sympy] sympy docs

2019-02-14 Thread brombo
Where are the instructions on how to document sympy code with sphinx? -- 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 sympy+unsubscr...@googlegroups.com. To post to

[sympy] nbsphinx

2019-02-13 Thread brombo
Does the installed version of sympy use nbsphinx for documentation - https://nbsphinx.readthedocs.io/en/0.4.2/ so that the documentation (sphinx) can launch a jupyter notebook? In documenting my code I would like to use notebook as part of the documentation. -- You received this message

[sympy] Between 1.2 and 1.4 simplify stopped working for me for some cases

2018-11-08 Thread brombo
To start with I cannot give a simple example using only sympy. I have only been able to generate this failure using my modules. Below is code and output showing as simple an example as I can generate with some diagnostics. If you could suggest any other diagnostics I would appreciate it.

[sympy] Testing for Types

2018-11-02 Thread brombo
If you want to test a sympy expression to see if it is a real scalar (combination real of numbers, functions, symbols, etc.) how would you do it? -- You received this message because you are subscribed to the Google Groups "sympy" group. To unsubscribe from this group and stop receiving emails

Re: [sympy] Re: Real Functions

2015-09-19 Thread brombo
is_real = True > > Aaron Meurer > > On Sat, Sep 19, 2015 at 2:47 PM, brombo <abrom...@gmail.com > > wrote: > > Your method works for a function, but not the derivative of a function - > > > > x = Symbol('x',real=True) > > > > f = RealFun

[sympy] Re: Real Functions

2015-09-19 Thread brombo
suggestions? On Saturday, September 19, 2015 at 12:58:53 PM UTC-4, brombo wrote: > > How do I define a real function of a real variable? > > X = symbols('x y z',real=True) > > f = Function('f',real=True)(*X) > > "real=True" in Function doesn't do anything. >

[sympy] Real Functions

2015-09-19 Thread brombo
How do I define a real function of a real variable? X = symbols('x y z',real=True) f = Function('f',real=True)(*X) "real=True" in Function doesn't do anything. -- You received this message because you are subscribed to the Google Groups "sympy" group. To unsubscribe from this group and stop

[sympy] sympy will be used at AGACSE 2015 (Applied Geometric Algebra in Computer Science and Engineering 2015) at Barcelona

2015-07-10 Thread brombo
Sypmy will be used in courses at AGACSE 2015 in Barcelona during July and August (http://www-ma2.upc.edu/agacse2015/) with galgebra (https://github.com/brombo/galgebra) during a course and laboratory session given by Alan Macdonald (http://www-ma2.upc.edu/agacse2015/summer-school.html). See

[sympy] Absolute value removal

2015-07-09 Thread brombo
Is there a simple way of removing all absolute values from an expression. For example if the expression is (Abs(sin(w))/cos(w)) + Abs(w) return (sin(w)/cos(w)) + w. -- You received this message because you are subscribed to the Google Groups sympy group. To unsubscribe from this group and

[sympy] Strange behavior from custom matrix printer

2015-07-02 Thread brombo
I have implemented a custom matrix printer with _print_MatrixBase(self, expr). I am running jupyter notebook with the output of _print_MatrixBase(self, expr) being given by - def _print_MatrixBase(self, expr): rows = expr.rows cols = expr.cols out_str = ' \\left [

[sympy] Print latex formatted matrix from ipython notebook

2015-06-17 Thread brombo
Is there anyway to print a nicely latex formatted matrix in ipython notebook? When I try I just get the test version printed out while the latex formatting for the other objects I am printing works fine. -- You received this message because you are subscribed to the Google Groups sympy

[sympy] Functional dependence

2015-06-06 Thread brombo
If I have a sympy expression, g, that is a function of sympy symbols (say x, y, z, and t) how can I determine that g is not dependent on any other symbols. The context for this is that I wish to determine if I have a metric tensor that tensor is a function only of x, y, z, and t and not a