Re: [sympy] multiply numerator and denominator of rational expression

2016-11-17 Thread Scott Calabrese Barton
s, you can use cancel() or factor() (the latter will also > factor the numerator and denominator). > > Aaron Meurer > > > On Thu, Nov 17, 2016 at 8:23 AM, Scott Calabrese Barton > <koo...@gmail.com > wrote: > > Unfortunately that image will not render. Her

Re: [sympy] multiply numerator and denominator of rational expression

2016-11-17 Thread Scott Calabrese Barton
Unfortunately that image will not render. Here's a link to it: https://goo.gl/J1wn0P On Thursday, November 17, 2016 at 8:17:33 AM UTC-5, Scott Calabrese Barton wrote: > > Aaron, thanks, that's definitely the right idea, but doesn't work, > probably because of simplificatio

Re: [sympy] multiply numerator and denominator of rational expression

2016-11-17 Thread Scott Calabrese Barton
Aaron, thanks, that's definitely the right idea, but doesn't work, probably because of simplification. Here's an example: What I really want is a k3/k1 term in the denominator that can be substituted. Any way to achieve this? On Thursday, November 10, 2016 at 3:54:30 PM UTC-5, Aaron Meurer

Re: [sympy] multiply numerator and denominator of rational expression

2016-11-17 Thread Scott Calabrese Barton
wrote: > > SymPy expressions are immutable. You have to create a new expression. > I would recommend something like > > def mul_and_div_factor(expr, factor): > n, d = expr.as_numer_denom() > return (n*factor)/(d*factor) > > Aaron Meurer > > On Th

[sympy] multiply numerator and denominator of rational expression

2016-11-10 Thread Scott Calabrese Barton
Hi, I wonder if there is an easy way to multiply the numerator and denominator of a rational expression by the same factor. I'd like to do this to group terms so that I can make a substitution. I tried making a function to do this: def tb(exp,factor): if exp.func==Mul and

[sympy] Substitution on Function Iteration

2015-03-24 Thread Scott Guthery
Any insight into the following will be greatly appreciated. Many thanks. from sympy import * x = symbols('x', integer=True) def main(fns, q0): for fn in fns: print(fn) print(fn.subs([x,q0])) if __name__ == '__main__': f1=x f2=x+2 main([f1,f2], 3) yields x

Re: [sympy] Substitution on Function Iteration

2015-03-24 Thread Scott Guthery
Yep. Thanks much, Sudhanshu Cheers, Scott On Tuesday, March 24, 2015 at 5:44:47 PM UTC-4, Sudhanshu Mishra wrote: Hi Scott, It looks like your subs call is wrong. It should be fn.subs(x, q0) Hope this helps. Sudhanshu Mishra On Wed, Mar 25, 2015 at 3:06 AM, Scott Guthery sgut

[sympy] Re: Getting transcendental rather log form of integral

2011-10-12 Thread Scott
at 11:31 AM, Scott scotta_2...@yahoo.com wrote: Mateuz, Did might you push your patch to a git fork?  Where did your local patch go? V/R Scott On Oct 6, 1:04 pm, Mateusz Paprocki matt...@gmail.com wrote: Hi, On 6 October 2011 11:57, Scott scotta_2...@yahoo.com wrote: How do

[sympy] sympy-sympy-71127e3 does not install physics.mechanics module

2011-10-12 Thread Scott
wigner.py sid@rlrvsxaskeys001:~/Documents/git/sympy-sympy-2d8f7a8$ V/R Scott -- You received this message because you are subscribed to the Google Groups sympy group. To post to this group, send email to sympy@googlegroups.com. To unsubscribe from this group, send email to sympy+unsubscr

[sympy] Re: Getting transcendental rather log form of integral

2011-10-07 Thread Scott
Mateuz, Did might you push your patch to a git fork? Where did your local patch go? V/R Scott On Oct 6, 1:04 pm, Mateusz Paprocki matt...@gmail.com wrote: Hi, On 6 October 2011 11:57, Scott scotta_2...@yahoo.com wrote: How do I coerce integrate(a/(a**2+b*a+b*c*x**2),x) to yield

[sympy] Getting transcendental rather log form of integral

2011-10-06 Thread Scott
Scott -- You received this message because you are subscribed to the Google Groups sympy group. To post to this group, send email to sympy@googlegroups.com. To unsubscribe from this group, send email to sympy+unsubscr...@googlegroups.com. For more options, visit this group at http

[sympy] Re: python printer output for scipy/numpy

2010-12-30 Thread Scott
Thank you for pointing me away from the python printer and towards lambdify. Cheers, Scott On Dec 30, 7:12 am, Vinzent Steinberg vinzent.steinb...@googlemail.com wrote: On 29 Dez., 23:29, Scott scotta_2...@yahoo.com wrote: Is there a clever way to export a Matrix of sympy symbols

[sympy] python printer output for scipy/numpy

2010-12-29 Thread Scott
characters. lambdify has the option to use numpy or python.math libraries. Is this feature hidden somewhere and I simply missed it? V/R Scott -- You received this message because you are subscribed to the Google Groups sympy group. To post to this group, send email to sy...@googlegroups.com

[sympy] Re: Chop Polynomial Coefficients Close to Zero

2010-10-07 Thread Scott
On Oct 5, 11:55 pm, smichr smi...@gmail.com wrote: On Oct 5, 9:46 pm, Scott spectre...@gmail.com wrote: On Oct 4, 5:48 pm, Ondrej Certik ond...@certik.cz wrote:    return Add(term for term in expr.as_Add() if term.as_coeff_terms() Add wants items, not a generator:     return Add

[sympy] Re: Chop Polynomial Coefficients Close to Zero

2010-10-05 Thread Scott
On Oct 4, 5:48 pm, Ondrej Certik ond...@certik.cz wrote: On Mon, Oct 4, 2010 at 5:40 PM, Scott spectre...@gmail.com wrote: Hello.  I some very large polynomials.  Some coefficients are very small (E-16) and I'd like to get rid of these terms.  I found a previous method with a solution

[sympy] Large Polynomial Integration

2010-10-05 Thread Scott
Hello everyone! I'm trying to do an integration of a large polynomial. Though it is large, it should be a pretty simple integration (simple/linear terms if it is fully expanded). I've run this exact polynomial through maxima and it computes the output extremely quick (and evern longer

[sympy] Re: Large Polynomial Integration

2010-10-05 Thread Scott
On Oct 5, 10:16 am, Ondrej Certik ond...@certik.cz wrote: On Tue, Oct 5, 2010 at 9:57 AM, Scott spectre...@gmail.com wrote: Hello everyone! I'm trying to do an integration of a large polynomial.  Though it is large, it should be a pretty simple integration (simple/linear terms

[sympy] Chop Polynomial Coefficients Close to Zero

2010-10-04 Thread Scott
is not iterable. Does anyone have any other ideas of how I can chop off the terms with very small coefficients? Thanks, Scott -- You received this message because you are subscribed to the Google Groups sympy group. To post to this group, send email to sy...@googlegroups.com. To unsubscribe from this group

[sympy] interactive geometric algebra?

2010-06-30 Thread Scott
Does the geometric algebra module work interactively? When I run the following code in an ipython shell it seem to not like the basis format. I can run the demo scripts form http://docs.sympy.org/modules/galgebra/GA/GAsympy.html with latex output with no trouble. Cheers, Scott from

[sympy] Re: interactive geometric algebra?

2010-06-30 Thread Scott
A python shell behave exactly as the ipython shell did. In both case MV.setup(basis,metric) is a string rather than an object with lots of attributes. I was trying to use GA to run some text book inner outer and geometric product while I was reading. Thanks for the help. Scott In [25]: g

[sympy] Re: cot(0)=0? and x * cot(x) evaluated near 0

2010-06-05 Thread Scott
In [74]: a=(x/sin(x)).series(x, 0, 8) In [75]: Poly(a.removeO(),x).coeffs Out[75]: (31/15120, 7/360, 1/6, 1) The remove0 method is perfect. The Poly.all_coeffs() does not exist in my sympy 0.6.6 but coeffs did work. Cheers Scott -- You received this message because you are subscribed

[sympy] cot(0)=0? and x * cot(x) evaluated near 0

2010-06-02 Thread Scott
What is the best way to evaluate x * cot(x) evaluated for x=0-pi/2 with sympy? Is there a better option than coding the Taylor series approximation? Also with the sympy that shipped with Ubuntu 10.04 sympy.cot(0) is 0 rather than infinity. V/R Scott -- You received this message because you

[sympy] Re: cot(0)=0? and x * cot(x) evaluated near 0

2010-06-02 Thread Scott
[41]: 1 + x**2/6 + 7*x**4/360 + 31*x**6/15120 + O(x**7) On Jun 2, 12:41 pm, Aaron S. Meurer asmeu...@gmail.com wrote: On Jun 2, 2010, at 9:12 AM, Scott wrote: What is the best way to evaluate x * cot(x) evaluated for x=0-pi/2 with sympy? I am not too sure what you mean by 0-pi/2, but you

[sympy] Re: cot(0)=0? and x * cot(x) evaluated near 0

2010-06-02 Thread Scott
The sinc function in mpmath meets most of my needs. I inspected the source code for sympy.sin but the algorithm for determining the approximations of sin(X) escaped my attention. I am still having trouble find examples of moving between polynomials and their coefficient arrays. Cheers Scott

[sympy] Re: sympy.nsolve, mpmath.findroots how to pass args to the function?

2010-02-02 Thread Scott
Below is my fast and dirty approach for making an mpmath friendly nonlinear system from one configured for scipy.optimize.fsolve. Thanks for the tips. import sympy as sy import numpy sy.var('x1,x2,a,b') global a,b # assume f_list is a long list of functions generated by another sympy script #

[sympy] Re: sympy.nsolve, mpmath.findroots how to pass args to the function?

2010-01-31 Thread Scott
Ondrej, I will use your global parameter suggestion in the short term and take a look at patching the code to allow an 'args' argument like in scipy.optimize.fsolve . Vinzent By residual I meant the system of nonlinear equations I am trying to find the roots of. Such as [a*x1**2 + x2,

[sympy] Re: sympy.nsolve, mpmath.findroots how to pass args to the function?

2010-01-31 Thread Scott
Making my function, F4, play interface with findroot required that I be more verbose than desired. (F4 runs under scipy fsolve) def F4(dof2): global dof1,m,G,a,dt args=tuple(dof1)[:-cons]+tuple(dof2)+(m,G,a,dt) return F3(*args) dof1 is a list of symbols ,list([x12, z12,

[sympy] sympy.nsolve, mpmath.findroots how to pass args to the function?

2010-01-30 Thread Scott
, parameters=(a,b),(0, 0)) matrix( [['-0.618033988749895'], ['-0.381966011250105']]) V/R Scott -- You received this message because you are subscribed to the Google Groups sympy group. To post to this group, send email to sy...@googlegroups.com. To unsubscribe from this group

[sympy] Re: symbolic one and 2d tensors

2009-12-05 Thread Scott
Alan, Thanks Now that it goes I can investigate if it does what I want. I was able to run the newest script on sympy 6.4 as a script. I was unable to manipulate rotor.py or http://wiki.sympy.org/wiki/Geometric_Algebra_Module#Rotations samples using isympy7 or ipyhton with the git 7 clone.

[sympy] Re: symbolic one and 2d tensors

2009-12-04 Thread Scott
On Dec 4, 1:42 pm, Alan Bromborsky abro...@verizon.net wrote: Alan Bromborsky wrote: Scott wrote: .T turns the column vector into a row vector. The integrands that involve the rotation tensors are functions of t or x , not both.    int^x1_x0 int ^t0_t1 (dot(del_a(t)).T* R *b ) dt dx

[sympy] Re: symbolic one and 2d tensors

2009-12-04 Thread Scott
)() --- NameError Traceback (most recent call last) /home/sid/ipython console in module() NameError: name 'a1' is not defined On Dec 4, 3:48 pm, Scott scotta_2...@yahoo.com wrote: When I run the script I

[sympy] Re: symbolic one and 2d tensors

2009-12-03 Thread Scott
the del terms yielding a nonlinear system. At this point the tensors are populated. On Dec 1, 3:28 pm, Scott scotta_2...@yahoo.com wrote: Is there a sympy function for making symbolic tensors? Basically I want to treat 3x3 rotation tensor symbol that is constant inside of an integral while

[sympy] Re: symbolic one and 2d tensors

2009-12-03 Thread Scott
sample code complete? It did not run (with sagge-python and ipyhton from sage) when I pasted it into a new file. V/R Scott On Dec 3, 11:17 am, Alan Bromborsky abro...@verizon.net wrote: Alan Bromborsky wrote: Scott wrote: My integral has several pieces  like this: int^x1_x0 int ^t0_t1

[sympy] symbolic one and 2d tensors

2009-12-01 Thread Scott
. Is there a built in function for converting a 3*1 tensor to a skew antisymetric cross product matrix then back again? V/R Scott -- You received this message because you are subscribed to the Google Groups sympy group. To post to this group, send email to sy...@googlegroups.com. To unsubscribe from this group

[sympy] ubuntu 8.10 AMD_64 sympy.6.deb

2009-02-25 Thread Scott
Where can I find I ubuntu 8.10 AMD_64 sympy.6.deb? I had one and lost and now I cannot find a replacement. V/R Scott --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups sympy group. To post to this group, send email

[sympy] Re: ubuntu 8.10 AMD_64 sympy.6.deb

2009-02-25 Thread Scott
Problem solved. Found it at the debian.org. Cheers Scott Scott wrote: Where can I find I ubuntu 8.10 AMD_64 sympy.6.deb? I had one and lost and now I cannot find a replacement. V/R Scott --~--~-~--~~~---~--~~ You received this message because you

[sympy] Re: replaceing symbols in a formula with array elements

2008-12-04 Thread Scott
veversion .6.3 Cheers Scott def F0(dof,d_dof,U,dt): h1=dof[0];theta1=dof[1];v_h1=dof[2];v_theta1=dof[3] delta_h=d_dof[0];delta_theta=d_dof[1];delta_v_h=d_dof [2];delta_v_theta=d_dof[3] res=-delta_v_h/2 - delta_v_theta/20 + dt*(-2*h1/25 - delta_h/25 - 3*U

[sympy] pprint a Symbol as merged greek letters (ie variation of theta)

2008-11-25 Thread Scott
How can i create one symbol such that the pprint and/or latex output will be merged special characters? What is the X such that: x= symbol('X') pprint(x) produce standard output equivilent that looks like$ \delta \theta_1 $ in tex aka the variation of theta subscript 1 Thanks Scott

[sympy] Re: Substitution syntax

2008-11-25 Thread Scott
How do you bend subs syntax to substitute and and array of symbols? a,b,x,y=symbols('a','b','x','y') q=a,b p=x,y f= a**2 + b ?? f.subs({p:q})?? x**2+y On Nov 11, 1:31 pm, llarsen [EMAIL PROTECTED] wrote: It seems like it would be nice where possible to make the sympy syntax as natural as

[sympy] Re: pprint a Symbol as merged greek letters (ie variation of theta)

2008-11-25 Thread Scott
I meant deltatheta_1 or like \delta\theta_1 in latex and also omega_theta , omege subscript theta . Thanks Scott On Nov 25, 12:29 pm, Ondrej Certik [EMAIL PROTECTED] wrote: On Tue, Nov 25, 2008 at 3:44 PM, Scott [EMAIL PROTECTED] wrote: How can i create one symbol such that the pprint

[sympy] Re: Substitution syntax

2008-11-25 Thread Scott
Either syntax , I currently use version 0.6.2 but will upgrade to 0.6.3 as soon as I find .deb file. My goal is to swap easy to type sympols with symbol that pprint well. V/R Scott On Nov 25, 12:27 pm, Ondrej Certik [EMAIL PROTECTED] wrote: Hi Scott, On Tue, Nov 25, 2008 at 4:25 PM, Scott

[sympy] Re: pprint a Symbol as merged greek letters (ie variation of theta)

2008-11-25 Thread Scott
. http://en.wikipedia.org/wiki/Phonetic_Extensions perhaps. As for merging 2 greek symbols in the absence of an LaTeX type wizardry, I will do without. I will look at the pprint cod to try to glean the mark characters sucha as _ . Thanks Scott On Nov 25, 6:17 pm, Ondrej Certik [EMAIL PROTECTED

[sympy] Re: pprint a Symbol as merged greek letters (ie variation of theta)

2008-11-25 Thread Scott
I'll give your extended latex printer a go. My goal is in the theme of making pprint prettier and being able to have my script output match the conventions of the people I work with. Thanks On Nov 25, 6:54 pm, Alan Bromborsky [EMAIL PROTECTED] wrote: Ondrej Certik wrote: 2008/11/25 Scott

[sympy] Re: Substitution syntax

2008-11-25 Thread Scott
Does subs have a list of vector functionallity? f.subs(p,q) where p is a list and q is a list? I believe the answer is no. It sounds like subs only operates term wise. There perhaps an arraysubs or vsubs type command? V/R Scott On Nov 25, 6:21 pm, Ondrej Certik [EMAIL PROTECTED] wrote

[sympy] Re: Substitution syntax

2008-11-25 Thread Scott
My apologies, I think the dict(zip(p,q)) will solve my problem. Cheers, Scott On Nov 25, 8:24 pm, Scott [EMAIL PROTECTED] wrote: Does subs have a list of vector functionallity? f.subs(p,q) where p is a list and q is a list? I believe the answer is no. It sounds like subs only operates term

[sympy] simplification commands, what are the and how do i find them?

2008-10-22 Thread Scott
What simplify expand, reduce and reduce type functions are available in sympy? Where in the docs is this sort of information? Thanks Scott --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups sympy group. To post

[sympy] Re: Mathematica to sympy diff() problem

2008-10-20 Thread Scott
the subs attribute. Is there a better way to handle this than a lot of Matrix(diff(Matrix(rdotarray).subs(xdot,s)[:],s)).subs(s,xdot) ? Where in the Docs am I most likely to find the answers to my question? I am using sympy 6.2 now. Thanks again Scott diff((z*zdot).subs(xdot, s), s) On Oct

[sympy] Mathematica to sympy diff() problem

2008-10-18 Thread Scott
What is the sympy translation of the following Mathematica syntax? When I try to code this in sage or sympy xdot and zdot remain as a diff object and I cannot us them in symbolic manifulations. My sympy version is 5.15 (ubuntu 8.10) or whatever is embedded in sage 3.1.2. V/R Scott x=q[t]; z