[sympy] Re: Ideas for the new assumptions system

2009-01-26 Thread nico
I think that could be something like a global assumption. But it's true that I am still not convinced we need global assumptions. I agree with Vinzent about global assumptions. If x refers to a real in a whole session, I think it would be really fastidious to use 'assume(x in R)' or something

[sympy] determinant of a 3x3 matrix hangs

2010-07-30 Thread Nico
-- is that a bug in SymPy; using v0.6.7 here. Any hints? Cheers, Nico = *snip* = #! /usr/bin/env python # -*- coding: utf-8 -*- ''' Calculates the J^{-1} J{-T} for where J is the Jacobian of the bilinear mapping of the reference quadrilateral (-1,1)^2

[sympy] Re: determinant of a 3x3 matrix hangs

2010-07-31 Thread Nico
with that huge *polynomial* in xi, eta, which I want to integrate over (-1,1)^2 -- seems to be a trivial thing to do, but now, the code hangs there forever. Can you confirm this? Any workarounds? Cheers, Nico === *snip* === #! /usr/bin/env python

[sympy] convert array to C(++) code: function body extraction?

2015-06-24 Thread Nico
into C code using codegen, and then after that _regexp_ the function body out. Then from the four function bodies, I build the C++ function. Is there a better way to do this, in particular one that works without regexping around the output code? Cheers, Nico -- You received this message

[sympy] adding attributes to sympy objects

2015-07-13 Thread Nico
objects (such as Add, Symbol) with extra attributes? Cheers, Nico -- 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

[sympy] deriving from sympy.Function

2015-07-14 Thread Nico
be easier to add the function definition straight in the initializer. However ``` class MyTest(sympy.Function): def __init__(self, name, fun): self.fun = fun return a = MyTest('a', lambda x: x) ``` does *not* work. Any idea why that is and how to fix it? Cheers, Nico [1] https

[sympy] Re: deriving from sympy.Function: object not callable

2015-07-16 Thread Nico
Got it: As outlined in [1], what is mathematically perceived as a function is a class in terms of sympy, not an instance thereof. --Nico [1] http://docs.sympy.org/latest/modules/functions/index.html On Thursday, July 16, 2015 at 9:53:17 AM UTC+2, Nico wrote: Following up on question [1

[sympy] deriving from sympy.Function: object not callable

2015-07-16 Thread Nico
= MyTest('b') b(x) # object is not callable ``` doesn't work: `b` is reported not to be callable here. Any hints why this might be and how to fix it? Cheers, Nico [1] https://groups.google.com/forum/#!topic/sympy/5mLEq4Gbyfk -- You received this message because you are subscribed to the Google

[sympy] live shell on the website

2015-08-24 Thread Nico
], the live shell opens with seemingly unrelated code (I didn't ask for this!), and after hiding it, I find myself on another place in the documentation. Yikes! Other than that great work. I particularly appreciate the helpfulness of this mailing list. Cheers, Nico [1] http://docs.sympy.org/ -- You

[sympy] generate code for Boolean expressions

2015-08-24 Thread Nico
this, I'll be happy to hear about it.) This works alright, but fails in the most simple cases, e.g., ``` expr = True ``` with ``` TypeError: The first argument must be a sympy expression. ``` Quite understandable. Is there a better way/hack to support this kind of code generation? Cheers, Nico

Re: [sympy] node.func.__name__ on UndefinedFunctions?

2016-04-05 Thread Nico
t; an object. Roughly speaking, Function('u') is syntatic sugar for > > class u(Function): > pass > > (except it also sets the metaclass as UndefinedFunction) > > In other words, if you have a = u(x), then a.func is u. > > Aaron Meurer > > > On Tue, Apr 5, 2

[sympy] Re: sympy.Function that returns a function

2016-04-05 Thread Nico
Thanks Anton for the tip! I'll see what'll work best for me. (As a dirty workaround, I now defined the function to take two arguments, e.g., op(u, x).) Cheers, Nico -- You received this message because you are subscribed to the Google Groups "sympy" group. To unsubscribe from

[sympy] node.func.__name__ on UndefinedFunctions?

2016-04-05 Thread Nico
I need to get the name (as a string) of certain given functions, and I've typically done it like ``` node.func.__name__ ``` That works, except for UndefinedFunctions. Is that an oversight? How to get the 'hello' from u in ``` u = sympy.Function('hello') ``` ? Cheers, Nico -- You received

[sympy] distinguishing own from intrinsic functions

2016-04-13 Thread Nico
defined myself (`f`) the ones that come from elsewhere. I though about subclassing `sympy.Function`, but apparently it's not exactly meant to be used that way [1]. Any hints? Cheers, Nico [1] https://groups.google.com/forum/#!topic/sympy/pU81Trc_Xr8 -- You received this message because you

[sympy] sympy.Function that returns a function

2016-04-05 Thread Nico
) ``` With the naïve definition above, I'm getting ``` TypeError: 'op' object is not callable ``` Any hints? Cheers, Nico -- 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, sen

Patch for issue 1481

2009-06-24 Thread nico
Hi, this patch needs review : http://code.google.com/p/sympy/issues/detail?id=1481start=100 Thanks, Nicolas --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups sympy-patches group. To post to this group, send email

Patch to review for issue 1694 (solvers)

2009-11-14 Thread nico
Please review the patches attached here : http://code.google.com/p/sympy/issues/detail?id=1694 Thanks a lot ! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups sympy-patches group. To post to this group, send email

[Solver] Fix issue 1694

2010-07-02 Thread nico
Hi, patch for issue 1694 needs review. It enhances solver capabilities and fix issues concerning fractions : ex: solve(1/x, x) [] solve(ln(x)/x, x) [1] solve(ln(x)/(x-1), x) [] Thanks, Nicolas -- You received this message because you are subscribed to the Google Groups sympy-patches

Re: [sympy] determinant of a 3x3 matrix hangs

2010-07-30 Thread Nico Schlömer
don't understand here which is where the actual complication sits. I'm more worried about actually calculating the inverse of that matrix; I'm also gonna need that. Cheers, Nico On Sat, Jul 31, 2010 at 12:58 AM, Aaron S. Meurer asmeu...@gmail.com wrote: Hi! I ran your script in SymPy 0.6.7

Re: [sympy] relate x[0] back to x

2015-08-19 Thread Nico Schlömer
There is also the MatrixSymbol class that may be better here. Quite interesting! Is there such a thing as a VectorSymbol as well? (I saw the `is_Vector` property here but never saw it True, neither for MatrixSymbols nor for DeferredVectors.) --Nico On Wed, Aug 19, 2015 at 10:20 PM Jason

[sympy] Re: distinguishing own from intrinsic functions

2016-04-13 Thread Nico Schlömer
I guess one thing I could do is taint the function class object as > > ``` f = Function('f') f.my_custom_function = True ``` -- 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

Re: [sympy] distinguishing own from intrinsic functions

2016-04-14 Thread Nico Schlömer
e imported from > sympy.core.function). You can find custom functions with > y.atoms(AppliedUndef). > > Aaron Meurer > > > On Wed, Apr 13, 2016 at 8:35 AM, Nico <nico.sc...@gmail.com > > wrote: > > To get all function from an expression, one can do > > ``` > > fro

[sympy] C code from IndexedBase

2016-04-14 Thread Nico Schlömer
>From an object like `sin(u[k]) + u0[k]` I would like to get the corresponding C code as a string. Since `k` is a variable, I cannot use `MatrixSymbol`, but there's always `IndexedBase` of course. With ``` u = IndexedBase('u') u0 = IndexedBase('u0') k = Symbol('k') y = sin(u[k]) + u0[k] ```

[sympy] Re: C code from IndexedBase

2016-04-14 Thread Nico Schlömer
, isinstance(s, IndexedBase)) ``` Hm... On Thursday, April 14, 2016 at 8:59:46 AM UTC+2, Nico Schlömer wrote: > > From an object like `sin(u[k]) + u0[k]` I would like to get the > corresponding C code as a string. Since `k` is a variable, I cannot use > `MatrixSymbol`, but th

[sympy] Re: C code from IndexedBase

2016-04-14 Thread Nico Schlömer
Once again, atoms to the rescue. ``` y.atoms(IndexedBase) ``` will give you all IndexedBase object from an expression. On Thursday, April 14, 2016 at 9:25:09 AM UTC+2, Nico Schlömer wrote: > > It seems that, unfortunately, the information of whether or not a variable > is an IndexedBa

[sympy] Simplification with dot products

2017-02-27 Thread Nico Schlömer
I have a somewhat large expression in inner products, ``` zeta = ( - * * + 4 * * * + ( + * + * +

Re: [sympy] Simplification with dot products

2017-02-27 Thread Nico Schlömer
Thanks for the reply. > I assume e0, e1, and e2 are arbitrary vectors. Indeed, they can be anything. (I'm looking at 3 dimensions here but given the fact that everything is a dot product I assume that doesn't play much of a role.) Cheers, Nico On Monday, February 27, 2017 at 6:37:59

Re: [sympy] Simplification with dot products

2017-02-27 Thread Nico Schlömer
Thanks for the suggestions. The noncommutative option is probably too strict since `<a,b><c, d> != <c,d><a,b>` then. Or can I make only some multiplications noncommutative? > You might need to write a naive factor Is there any documentation on this? Cheers, Ni

[sympy] 1.0.1 point release?

2017-03-15 Thread Nico Schlömer
Hi everyone, Are there plans for a point release of sympy? I'm eager for it because of the (fixed) regression [1]. Cheers, Nico [1] https://github.com/sympy/sympy/issues/12132 -- You received this message because you are subscribed to the Google Groups "sympy" group. To unsubs

[sympy] Rational with Symbol

2017-10-04 Thread Nico Schlömer
to support integer and symbolic fractions from one interface? Cheers, Nico -- 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.co

Re: [sympy] simplifying combinatorial sum

2017-11-26 Thread Nico Schlömer
ived some > improvements in master. > > You can also try using SymPy to evaluate the sum. > > Aaron Meurer > > On Thu, Nov 23, 2017 at 2:43 AM, Nico Schlömer <nico.schloe...@gmail.com> > wrote: > >> Given natural numbers n, r, 0<=r<=n, I'm dealing with the

[sympy] simplifying combinatorial sum

2017-11-23 Thread Nico Schlömer
Given natural numbers n, r, 0<=r<=n, I'm dealing with the expression I have the strong suspicion that this can be simplified to a product of binomial coefficients.

Re: [sympy] Re: lambdify function with array of parameters

2018-03-22 Thread Nico Schlömer
mbdify and DeferredVector (which apparently isn't removed because > everyone forgot about it). > > On Mon, Mar 19, 2018 at 6:29 PM, Nico Schlömer <nico.schloe...@gmail.com> > wrote: > > I see! > > I also noticed that I can use `DeferredVector`s instead of > `MatrixSym

[sympy] lambdify function with array of parameters

2018-03-19 Thread Nico Schlömer
Given the degrees in numerator and denominator I would like to represent a Padé polynomial à la ``` P(x) = (a[0] + a[1]*x + a[2]*x**2 + ...) / (1 + b[1]*x + b[2]*x**2 + ...) ``` in sympy and let it do the heavy lifting, e.g., computation of derivatives. Operations that I'll need to do: *

[sympy] Re: lambdify function with array of parameters

2018-03-19 Thread Nico Schlömer
I see! I also noticed that I can use `DeferredVector`s instead of `MatrixSymbol`s to get avoid those dict shenanigans. This ``` import numpy import sympy a = sympy.DeferredVector('a') b = sympy.DeferredVector('b') x = sympy.Symbol('x') P = (a[0] + a[1]*x) / (1 + b[0]*x + b[1]*x**2 + b[2]*x**3)