Re: [sympy] "Can not convert to an Integer"

2015-08-14 Thread saad khalid
Oh, I see, my mistake. Thanks! On Friday, August 14, 2015 at 3:06:42 PM UTC-5, Aaron Meurer wrote: > > Are you using SymPy at all here or just mpmath? If it's just mpmath, you > may have better luck on the mpmath mailing list > https://groups.google.com/forum/#!forum/mpmath. > > Aaron Meurer >

Re: [sympy] Units in the electronic context

2015-08-14 Thread Thiago Costa de Paiva
OK, so I have a work around here: from sympy.physics import units as u class MyVars: def __init__(self): '''create a dict of units of interest''' self.my_units = {} self.my_units[u.V] = 'V' self.my_units[u.W] = 'W' self.my_units[u.A] = 'A' self.

Re: [sympy] "Can not convert to an Integer"

2015-08-14 Thread Aaron Meurer
Are you using SymPy at all here or just mpmath? If it's just mpmath, you may have better luck on the mpmath mailing list https://groups.google.com/forum/#!forum/mpmath. Aaron Meurer On Fri, Aug 14, 2015 at 12:56 PM, saad khalid wrote: > Hello everyone! My professor challenged me to show him t

Re: [sympy] Mathematical substitution in SymPy

2015-08-14 Thread Aaron Meurer
subs is limited on how smart it is. I think it only works for numerical coefficients. Also note that exp(a*x) != exp(x)**a in general (take x = 2*pi*I and a = 1/2). It should be true if a is an integer, though (but subs doesn't handle it if you set a = Symbol('a', integer=True)). If you know what

[sympy] "Can not convert to an Integer"

2015-08-14 Thread saad khalid
Hello everyone! My professor challenged me to show him that non-mathematica applications could do the computing that he needs(I'm trying to convert the college from Mathematica to something open source). He wants a plot of q-gamma with x=.5, and q going from 0 to .99. My code is as follows: f

Re: [sympy] Mathematical substitution in SymPy

2015-08-14 Thread Adrián Ashley
Hi, Thanks for the workaround, but subs doesn't work here: >>> sin(exp(a*x)).subs({exp(x): x}) >>> sin(exp(a*x)) Best, Adrian On Saturday, August 15, 2015 at 12:11:31 AM UTC+5:30, Aaron Meurer wrote: > > xreplace only does exact structural replacement (the "x" stands for > "exact"). To g

Re: [sympy] Mathematical substitution in SymPy

2015-08-14 Thread Aaron Meurer
xreplace only does exact structural replacement (the "x" stands for "exact"). To get mathematical replacement, use subs: >>> print(exp(5*x).subs(exp(x), sin(x))) sin(x)**5 Aaron Meurer On Fri, Aug 14, 2015 at 5:17 AM, AMiT Kumar wrote: > I am also Interested in getting the solution for this. >

[sympy] Getting a No Convergence error running q-gamma

2015-08-14 Thread saad khalid
Hello everyone! My professor challenged me to show him that non-mathematica applications could do the computing that he needs(I'm trying to convert the college from Mathematica to something open source). He wants a plot of q-gamma with x=.5, and q going from 0 to .99. My code is as follows: fro

[sympy] Parsing string with equation that contains speciality function

2015-08-14 Thread dan
Sorry if this ends up being a re-post, I submitted a similar question and I do not think it went through. I am working on a project that uses a statistical modelling program whose output is a linear regression model. THe program has a unique way of representing various well know equations such a

[sympy] User defined function being used from parse_expr

2015-08-14 Thread dan
THe project I am currently working on creates statistical models and provides the linear regression model as an equation. It has some package centric ways for defining polynomials and other functions, for instance: 68.1223e-02*VB_POLY(var_to_use,0.79425485,0.0074458634,-3.659e-05) I'm trying

Re: [sympy] Mathematical substitution in SymPy

2015-08-14 Thread AMiT Kumar
I am also Interested in getting the solution for this. *AMiT Kumar* On Friday, August 14, 2015 at 12:08:25 PM UTC+5:30, Gaurav Dhingra wrote: > > Do you want something like replacing some function f1 (say `exponential > function` you mentioned `{exp(x): x}` ) with some other f2 (say linear > fu