Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Oct 19 23:10
    smichr commented #22328
  • Oct 19 23:07
    asmeurer commented #22324
  • Oct 19 23:03
    smichr commented #22324
  • Oct 19 23:00
    smichr commented #22324
  • Oct 19 22:51
    sympy-bot commented #22327
  • Oct 19 22:51
    smichr synchronize #22327
  • Oct 19 22:45
    asmeurer commented #22324
  • Oct 19 22:43
    sympy-bot commented #22324
  • Oct 19 22:43
    asmeurer edited #22324
  • Oct 19 22:07
    github-actions[bot] commented #22286
  • Oct 19 21:31
    eagleoflqj opened #22328
  • Oct 19 21:03
    bjodah commented #22326
  • Oct 19 21:03
    bjodah commented #22326
  • Oct 19 20:55
    smichr synchronize #22327
  • Oct 19 20:36
    smichr synchronize #22286
  • Oct 19 20:03

    oscarbenjamin on master

    add strict/weak to Relational simplify Or(x?=y,And(x?y, z)) a… Merge pull request #22317 from … (compare)

  • Oct 19 20:03
    oscarbenjamin closed #22317
  • Oct 19 20:03
    oscarbenjamin closed #22300
  • Oct 19 19:54
    smichr synchronize #22286
  • Oct 19 19:48
    MarkCBell commented #21016
fakuivan
@fakuivan
what I have now is convert_to(expr, system._base_units) and then xreplace the base units
Emil Jiří Tywoniak
@EmilJ_gitlab
Hi, is there a way of defining a PDE with curl? It seems to me like curl operates by just... trying to compute the curl immediately.
H = Function('H')(x,y,z)
# H = cross.x * 
print(type(curl(H)))
this tells me the curl of this unknown function is VectorZero
fakuivan
@fakuivan
doit=False maybe?
print(type(curl(H, doit=False)))
Emil Jiří Tywoniak
@EmilJ_gitlab
Hmm, right now H is acting like a scalar field, but how do I make it not... be that... without defining it
Emil Jiří Tywoniak
@EmilJ_gitlab
Hx = Function('Hx')(x,y,z)
Hy = Function('Hy')(x,y,z)
Hz = Function('Hz')(x,y,z)
delop = Del()
T = CoordSys3D(r'$\bot')
H = Hx*T.x + Hy*T.y + Hz*T.z
print(type(delop.cross(H)))
AttributeError: 'Add' object has no attribute 'dot'
no clue.
Kalevi Suominen
@jksuom
H is an Add object whose arguments are Mul objects, not a vector.
In [10]: srepr(H)                                                               
Out[10]: "Add(Mul(T.x, Function('Hx')(Symbol('x'), Symbol('y'), Symbol('z'))), Mul(T.y, Function('Hy')(Symbol('x'), Symbol('y'), Symbol('z'))), Mul(T.z, Function('Hz')(Symbol('x'), Symbol('y'), Symbol('z'))))"
Samuel Lelièvre
@slel
On the SymPy page at PyPI, the "SymPy Banner" image does not display properly.
1 reply
Felix Hildén
@felix-hilden

Hi, I'd like to express a vector norm with indexed variables for differentation, but I don't quite know how. Every search I came up with led to matrix norms, which aren't really in question here. The variables are indeed vectors, but I don't care about the dimensionality in this case. Formulating a difference is easy enough, but I'm not sure how to continue.

# || x_a - y_b ||

x = sp.IndexedBase('x')
a = sp.Idx('a')
y = sp.IndexedBase('y')
b = sp.Idx('b')

diff = (x[a] - y[b])

How could this be achieved? I'm open for any other formulations as well! Much appreciated.

hackman01
@hackman01
i was trying to solve this issue #21463 but was not able to find source code of convert_to
Kalevi Suominen
@jksuom
sympy/physics/units/quantities.py: def convert_to(self, other, unit_system="SI")
samsja
@samsja:matrix.org
[m]
HI everybody, I am looking for a way to symbolically minimize a multivariate function. The sympy maximize function only work on monovariate function ( or at least what I understand out of the documentationI). What could I do ? I already try the approach of resolving the system where the gradient equal zero and then take the min of it however it does not include solution with unbound variable like the maximise function do by outputing things like infinity. Thanks in advance 🙂
Vishesh Mangla
@Teut2711
import sympy as sm
from sympy import I
w = sm.symbols("omega")
exp = 20/(I*w+1)/(I*w+2)/(I*w+3)
sm.simplify(exp)
image.png
how to simplify it? I want the w corresponding to which the imaginary part is 0
sm.solve(sm.arg(exp)) gives []
image.png
here too
image.png
Isuru Fernando
@isuruf
You need to add the assumption that omega is real.
Vishesh Mangla
@Teut2711
w = sm.symbols("omega", real=True ) sorry no effect
image.png
Isuru Fernando
@isuruf
try expanding
Vishesh Mangla
@Teut2711
image.png
better but not exactly what I require
image.png
this is good but
thanks @isuruf
Vishesh Mangla
@Teut2711
thanks again
Vishesh Mangla
@Teut2711
image.png
abs gives whats expected but sm.arg doesn't , what else can be done to get the argument?
image.png
some function which does this is required
Vishesh Mangla
@Teut2711
image.png
I m trying to make a table like this, where each many cells of the matrix should contain unevaluated determinants
gives
Vishesh Mangla
@Teut2711
row += [sm.Mul(sm.Matrix([
              [row1[0], row2[k] ],
              [row2[0], row2[k]]    
              ]), -1/row2[0], evaluate=False)]
image.png
so I did get a Matrix in matrix as expected but the evaluate=False didnt work. What is that am I doing wrong?
Aaron Meurer
@asmeurer
you probably need to use MatMul
Gaurav Dhingra
@gxyd

Hey guys, I'm trying to use parse_latex function as below:

In [1]: from sympy.parsing.latex import parse_latex

In [2]: r = "5^0 - 4^0"

In [3]: parse_latex(r)
ANTLR runtime and generated code versions disagree: 4.9.2!=4.7.2
ANTLR runtime and generated code versions disagree: 4.9.2!=4.7.2
Out[3]: -1 + 5**0

Is there anyway, I can stop parse_latex to render it as 5^ 0 - 4^0 and now evaluate 4^0 as 1?

Vishesh Mangla
@Teut2711

you probably need to use MatMul

yes , that was it. thanks

Kalevi Suominen
@jksuom
@gxyd On this line, we have lh = 5**0 and rh = 4**0 but -1 * rh will be evaluated to -1. If you want to preserve rh, it looks like -1 * rh should be replaced by Mul(-1, rh, evaluate=False).
3 replies
Madhava Jay
@madhavajay
Hi, does anyone know if its possible to do the floating point evaluation with fixed-precision / Fixed-point integer-valued calculations?
1 reply
Madhava Jay
@madhavajay

From what I can see Rational inherits from Number which defines evalf as :

    def _eval_evalf(self, prec):
        return Float._new(self._as_mpf_val(prec), prec)

So I assume that all the calculations are resolved using Floats?

famubu
@famubu:matrix.org
[m]
Does sympy support python2? Which is the earliest version of python3 that is supported? Would 3.5 be okay?
Kalevi Suominen
@jksuom
@famubu:matrix.org The oldest supported version is 3.6 though 3.5 may often work.
1 reply