[sympy] Hanging search function of docs.sympy.org (firefox, chromium)

2017-07-13 Thread Carsten Knoll
Hi all, a colleague just indicated to me that they are not able to perform a search on with firefox on Windows 8. IE works. I can reproduce this on Debian with FF (52.2.0 (64-Bit)) and Chromium (59.0.3071.86). Example: http://docs.sympy.org/latest/search.html?q=diff

[sympy] strange behavior with Integral.diff

2016-05-24 Thread Carsten Knoll
Hi all, I've encountered an error when deriving an integral expression which contains a derivative and has variable bounds. My setup looks like this: > In [1]: from sympy import * > In [2]: init_printing() > In [3]: x, xi = symbols("x, xi"); k = Function("k") > In [4]: exp = Integral(k(x,

Re: [sympy] Can sympy solve this equation?

2016-02-23 Thread Carsten Knoll
On 02/23/2016 05:46 PM, Carl Sandrock wrote: > ... > This matches your method. So this has saved me some tedious algebra, > but not the effort of finding the order in which to evaluate the > equations. I wish that sympy could do this automatically. I agree. Maybe this could be added to

Re: [sympy] Can sympy solve this equation?

2016-02-23 Thread Carsten Knoll
Hi, I already had similar problems. The system of equation is of order 3 which might be too hard. But there is a linear part and if this is solved first and then plugged into the remaining 2 equations, sympy can manage it. I documented my attempt here:

Re: [sympy] integrate tan(x) for real argument

2016-02-22 Thread Carsten Knoll
Thanks. Both variants are helpful! Carsten On 02/19/2016 08:23 PM, Aaron Meurer wrote: > It looks like the meijerg algorithm gives the better form: > > In [33]: integrate(tan(x), x, meijerg=True) > Out[33]: -log(cos(x)) > > Aaron Meurer > > On Fri, Feb 19, 2016 at 2:21 PM, Ondřej Čertík

[sympy] integrate tan(x) for real argument

2016-02-19 Thread Carsten Knoll
I want to calculate the antiderivative for tan(x) In [4]: x = sp.Symbol('x', real=True) In [5]: sp.integrate(sp.tan(x), x) Out[5]: -log(sin(x)**2 - 1)/2 This result is technically correct, but I would (for didactic purposes) prefer something like -log(cos(x)). How can I achieve this?

Re: [sympy] matrix rank, svd and mpmath

2015-09-09 Thread Carsten Knoll
On 09/08/2015 10:45 PM, Aaron Meurer wrote: > On Mon, Sep 7, 2015 at 5:37 PM, Carsten Knoll <carstenkn...@gmx.de> wrote: >> Hi, >> >> I want to write a routine to determine the rank of a symbolic matrix and >> it seems to be a quite tricky task. >> >

[sympy] matrix rank, svd and mpmath

2015-09-07 Thread Carsten Knoll
Hi, I want to write a routine to determine the rank of a symbolic matrix and it seems to be a quite tricky task. The routine is required to be applicable for matrices whose entries are "big expressions", hence calling simplify is not an option. My strategy: extracting all occurring symbols and

[sympy] simplification of exp(x*log(y))

2015-07-18 Thread Carsten Knoll
Hi, due to various substitutions I have a bulky expression of the following structure A + exp(B*log(C) + D) I want sympy to simplify this to A + C**B*exp(D) I think it boils down to the simplification of exp(B*log(C)) which I also can't perform: from sympy import exp, log,

Re: [sympy] How to equip a Symbol with an additional attribute?

2015-05-19 Thread Carsten Knoll
On 05/19/2015 07:48 AM, Joachim Durchholz wrote: An external dictionary isn't ideal but better than this, at least from the maintainer's perspective. Maybe we can give you better help if you describe your use case in some more detail. At some point I create symbols from which I know,

Re: [sympy] How to equip a Symbol with an additional attribute?

2015-05-19 Thread Carsten Knoll
On 05/19/2015 02:39 AM, Aaron Meurer wrote: On Mon, May 18, 2015 at 12:29 PM, Joachim Durchholz j...@durchholz.org wrote: Am 18.05.2015 um 15:56 schrieb Carsten Knoll: I want to equip an Symbol with an additional attribute to store some specific information right in place. For 'normal

Re: [sympy] How to equip a Symbol with an additional attribute?

2015-05-18 Thread Carsten Knoll
On 05/18/2015 04:12 PM, Amit Saha wrote: On Mon, May 18, 2015 at 11:56 PM, Carsten Knoll carstenkn...@gmx.de wrote: I want to equip an Symbol with an additional attribute to store some specific information right in place. For 'normal' Python classes it is no problem to dynamically create

[sympy] How to equip a Symbol with an additional attribute?

2015-05-18 Thread Carsten Knoll
I want to equip an Symbol with an additional attribute to store some specific information right in place. For 'normal' Python classes it is no problem to dynamically create an additional attribute for an already existing instance. However, for sympy Symbols if I try x = Symbol('x') x.k = 0 I

Re: [sympy] How to equip a Symbol with an additional attribute?

2015-05-18 Thread Carsten Knoll
On 05/18/2015 04:48 PM, Carsten Knoll wrote: On 05/18/2015 04:12 PM, Amit Saha wrote: On Mon, May 18, 2015 at 11:56 PM, Carsten Knoll carstenkn...@gmx.de wrote: I want to equip an Symbol with an additional attribute to store some specific information right in place. Equipping that class

Re: [sympy] How to equip a Symbol with an additional attribute?

2015-05-18 Thread Carsten Knoll
That happens because we use __slots__ for performance reasons. I was not aware of the __slots__ mechanism. Now I know. However, storing attributes in that way is a bad idea in general, because you risk name conflicts with future versions of SymPy. (That's also the reason why using

[sympy] Matrices with noncommutative symbols

2015-05-11 Thread Carsten Knoll
Hello, I wonder about the following behavior In [1]: import sympy as sp In [2]: x, y = sp.symbols('x, y', commutative = False) In [3]: M1 = x*sp.eye(2) In [4]: M2 = y*x*sp.eye(2) In [5]: y*M1-M2 Out[5]: Matrix([ [x*y - y*x, 0], [0, x*y - y*x]]) I would have expected that

Re: [sympy] dsolve - strange boundaries of Integral object

2015-04-13 Thread Carsten Knoll
Thanks for the clarifications, On 04/13/2015 06:28 PM, Aaron Meurer wrote: On Fri, Apr 10, 2015 at 3:54 AM, Carsten Knoll carstenkn...@gmx.de wrote: 1. What does an object like Integral(F(t), (t, 0)) mean? It means the integral of F(t), evaluated at t = 0. It's the same as Integral(F(t

[sympy] dsolve - strange boundaries of integrate

2015-04-08 Thread Carsten Knoll
I have the following problem In [1]: from sympy import * In [3]: x, F, t = symbols('x, F, t') In [4]: ode = x(t).diff(t) - F(t) In [5]: sol = dsolve(ode).rhs In [7]: sol Out[7]: C1 + Integral(F(t), t) In [8]: sol.subs(t, 0) Out[8]: C1 + Integral(F(t), (t, 0)) I want the last expression to

[sympy] return types of solve?

2015-01-21 Thread Carsten Knoll
I try to include sympy in teaching material. When doing this, the focus is not on programming nor implementation details. The CAS should be as transparent as possible. The CAS-using code should read like the math done in a textbook. I think sympy is very close to this. However, there are some

[sympy] solve() for unsolveable system returns a nonempty dict

2014-03-08 Thread Carsten Knoll
Until today I thought, if solve returns a nonempty dict, then there is a (complete) solution to the provided system. However this is apparently not the case: solve([y, x], x) {x:0} Moreover, this behavior seems not to be consistent solve([x, y], y) [] (results from SymPy 0.7.4.1 on

Re: [sympy] Re: sympify(MutableMatrix) - ImmutableMatrix

2013-11-08 Thread Carsten Knoll
avoids creating a mutable object. On Thursday, November 7, 2013 7:44:37 PM UTC+1, Carsten Knoll wrote: Hi all, I just stumbled on the following behavior: type(eye(2)) class′sympy.matrices.dense.MutableDenseMatrix′ type(sympify(eye(2))) class

[sympy] diffgeom: wedgeproduct

2013-04-17 Thread Carsten Knoll
Hi everyone, I just realized that sympy is able to deal with 1-forms and wedge products and such stuff. Thats really great! I have a tow questions: In [3]: from sympy.diffgeom import WedgeProduct In [4]: from sympy.diffgeom.rn import R3_r as R3 In [5]: WedgeProduct(R3.dx, R3.dx) Out[5]:

Re: [sympy] diffgeom: wedgeproduct

2013-04-17 Thread Carsten Knoll
Thank you for your comments and hints. I was thinking about evaluating the Wedgeproducts with base vectors to get the Information, but I guess there must be a intern way.. There is actually no intern way. This design decision was based on the requirement to be able to write stuff like

[sympy] Bug in trigsimp(matrix, method=fu)?

2013-03-29 Thread Carsten Knoll
Hi, in current master (python 2.7) this works for me: trigsimp(Matrix([sin(x), cos(x)])) It is equivalent to the call: trigsimp(Matrix([sin(x), cos(x)]), method = matching) however the following do not: trigsimp(Matrix([sin(x), cos(x)]), method = fu) trigsimp(Matrix([sin(x), cos(x)]),

[sympy] trigsimp - cos(x+y)

2012-12-05 Thread Carsten Knoll
Hi there, today I stumbled on a trigsimp problem: In [4]: trigsimp(cos(x+y).expand(trig=True)) Out[4]: -sin(x)*sin(y) + cos(x)*cos(y) In [5]: simplify(cos(x+y).expand(trig=True)) Out[5]: -sin(x)*sin(y) + cos(x)*cos(y) In other words: the identity -sin(x)*sin(y) + cos(x)*cos(y) == cos(x+y)

Re: [sympy] Experiences with sympy in teaching?

2012-08-01 Thread Carsten Knoll
We gave a python course for engineering students this semester (and in Spring 2011). It was quite mechanical-oriented (3D Visualization, Multibody-Systems, ...) but included one lecture about sympy (Lagrangian equations). This maybe might serve as a application example. see

Re: [sympy] latex expressions as symbol strings?

2012-02-21 Thread Carsten Knoll
Hi Aaron, On 02/20/2012 09:25 PM, Aaron Meurer wrote: The easiest way to do this is to use the symbol_names flag that was recently added to latex(). I think this may have been added since 0.7.1, so you'll need to use a development version to get it (see

Re: [sympy] latex expressions as symbol strings?

2012-02-21 Thread Carsten Knoll
On 02/21/2012 11:27 AM, Aaron Meurer wrote: Yes, that's a great idea. Can you submit a pull request implementing it? Aaron Meurer I'll try it in the next days. in printing/tests there is no file covering the preview module. So I think it will not be necessary to implement a test.

[sympy] latex expressions as symbol stings?

2012-02-20 Thread Carsten Knoll
Hi, I am writing a script in which I generate the an expression. This expression I want to use 1) with preview and 2) with lambdify. Lets say expr = phidd**2 And I want preview to use the latex code '\ddot{\varphi}' for rendering of phidd. Therfore I defined: phidd =