[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

[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 +

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

2018-02-23 Thread Matthias Geier
dules/printing.html, that's a very helpful page. cheers, Matthias > On Thursday, February 22, 2018 at 2:02:20 PM UTC-5, Matthias Geier wrote: >> >> Dear SymPy list. >> >> I'm playing around with polynomials in the context of spline curves. >> >> I want to us

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

2018-03-14 Thread Matthias Geier
2 + 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. > > > > On Saturday, March 10, 2018 at 7:38:0

[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 +

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

2018-03-14 Thread Matthias Geier
y to > find the 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

[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

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

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

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

2021-02-06 Thread Matthias Geier
ers, 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, thanks for all the effort all of you are p

[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

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)$,