[sympy] Order of terms in polynomial with symbolic coefficients?

2018-02-22 Thread Matthias Geier
Dear SymPy list. I'm playing around with polynomials in the context of spline curves. I want to use a cubic polynomial with yet unknown coefficients like this: >>> import sympy as sp >>> t, a0, a1, a2, a3 = sp.symbols('t, a:4', real=True) >>> a3 * t**3 + a2 * t**2 + a1 * t + a0 a0 + a1*t + a2*t*

Re: [sympy] Re: Order of terms in polynomial with symbolic coefficients?

2018-02-23 Thread Matthias Geier
single Jupyter output cell? > The printing module has a number of printers which support a number of > settings. Thanks for the reference to http://docs.sympy.org/latest/modules/printing.html, that's a very helpful page. cheers, Matthias > On Thursday, February 22, 2018 at 2:02:20

[sympy] Solving for a matrix?

2018-03-10 Thread Matthias Geier
Dear list. I have this equation: a = M * b, where a and b are column vectors and M is a 4x4 matrix. a and b consist of quite simple expressions, M is unknown: >>> import sympy as sp >>> a0, a1, a2, a3 = sp.symbols('a:4') >>> a = sp.Matrix([a3, a2, a1, a0]) >>> b = sp.Matrix([a0, a3 + a2 + a

Re: [sympy] Re: Solving for a matrix?

2018-03-14 Thread Matthias Geier
+ a1 + a2 + a3) - M_1_2*a1 - M_1_3*(a1 + > 2*a2 + 3*a3) + a2)/a0, M_0_0: (-M_0_1*(a0 + a1 + a2 + a3) - M_0_2*a1 - > M_0_3*(a1 + 2*a2 + 3*a3) + a3)/a0} > > which, as previously mentioned, is a lot of solutions. You can plug in some > arbitrary numbers for the free variables here. > &g

Re: [sympy] Re: Solving for a matrix?

2018-03-14 Thread Matthias Geier
inverse of a matrix is to invert that matrix. It's often said > (correctly) that solving a linear system is more efficient than inverting > its matrix. But here, the task was really to find the inverse of a 4 by 4 > matrix. > > > On Wednesday, March 14, 2018 at 7:21:27 AM UTC-4, Mat

[sympy] Polynomials: missed opportunity to simplify?

2018-06-26 Thread Matthias Geier
Dear list. Sorry for the strange title, I couldn't come up with anything more meaningful ... I'm working with non-uniform cubic splines and I created a simple polynomial where the input t in the range [t0, t1] is mapped to the range [0, 1]: >>> import sympy as sp >>> t, t0, t1 = sp.symbols('t t:

[sympy] Having to call trigsimp() twice?

2019-12-04 Thread Matthias Geier
Dear list. I stumbled upon a case where one invocation of trigsimp() doesn't completely simplify an expression, but calling trigsimp() a second time on the result leads to further simplification. Is this normal? I know that for simplify() there are arguments like "ratio" and "measure" for specif

Re: [sympy] We need some community input on the desired behavior of an equation class...

2021-02-04 Thread Matthias Geier
Hi all. First of all, thanks for all the effort all of you are putting into SymPy in general and into the upcoming Equation class specifically! I'm not sure whether I fully understand either side of the contentious questions mentioned in this thread, but let me nevertheless add my opinion: I thi

Re: [sympy] We need some community input on the desired behavior of an equation class...

2021-02-06 Thread Matthias Geier
ever additional behavior is needed. cheers, Matthias > > Jonathan > On Thursday, February 4, 2021 at 4:51:31 PM UTC-6 asme...@gmail.com wrote: >> >> On Thu, Feb 4, 2021 at 2:18 PM Matthias Geier wrote: >> > >> > Hi all. >> > >> > First of all, th

Re: [sympy] Introducing Equation module

2021-05-13 Thread Matthias Geier
Hi Jonathan. On Thu, May 13, 2021 at 3:02 PM gu...@uwosh.edu wrote: > > Jisoo, > > If you can get it to work that would be great. I tried to squash everything > into one commit in PR #21333, but I could not get GIT to do it. I'm not sure > why. If you do get it to work, please let me know how.

Re: [sympy] Introducing Equation module

2021-05-13 Thread Matthias Geier
On Thu, May 13, 2021 at 6:47 PM gu...@uwosh.edu wrote: > > Having tried various versions of what Matthias suggests, I think the solution > for my case is probably what Chris suggests. Using the one command I suggested, this takes less than a minute and there is no way I can forget to add anything

Re: [sympy] Numbering in init_printing(latex_mode='equation')

2024-01-16 Thread Matthias Geier
Hi Glenn, all. On Mon, Jan 15, 2024 at 11:06 PM Aaron Meurer wrote: > On Mon, Jan 15, 2024 at 1:48 PM Glenn Ramsey > wrote: > > On 8/01/24 11:57, Glenn Ramsey wrote: [...] > > A question now is if I did that and referred to that in the markdown with > > something like this: $\@ref(foo)$, woul

[sympy] How to avoid distributing a constant factor after differentiation?

2024-02-18 Thread Matthias Geier
Hi all. I have a simple expression: >>> import sympy as sp >>> a, b, t, t0 = sp.symbols('a b t t0') >>> expr = a*(t - t0)**3 + b*(t - t0)**2 And I would like to differentiate it with respect to t: >>> expr.diff(t) 3*a*(t - t0)**2 + b*(2*t - 2*t0) Why is the constant "2" distributed in the seco

Re: [sympy] How to use MatplotlibBackend?

2024-11-12 Thread Matthias Geier
hange. The first example still doesn't work at this point in the history. It just shows an empty plot (only the axes are visible). I wanted to go further back in history, but I wasn't able to install a combination of SymPy/NumPy/Matplotlib/Python that worked. Is there anything else I sh

[sympy] How to use MatplotlibBackend?

2024-11-09 Thread Matthias Geier
Hi all. A few years ago, I have documented how to create Matplotlib animations from SymPy plots: https://nbviewer.org/github/mgeier/python-audio/blob/master/sympy/sympy-matplotlib-animations.ipynb This has worked quite well (as can be seen in the link), but in the meantime, the behavior/usage of

Re: [sympy] How to use MatplotlibBackend?

2024-11-21 Thread Matthias Geier
On Tue, Nov 12, 2024 at 11:38 AM Matthias Geier > wrote: > > > > Hi Aaron. > > > > On Mon, Nov 11, 2024 at 8:38 PM Aaron Meurer wrote: > > > > > > I haven't followed all the changes to plotting. Do you know what the > > > PR SymPy was that