• Register

Težava pri simbolnem integriranju

+11 votes
135 views

Ko poskušam simbolno integrirati izraz mi vrne ValueError. Zanima me, kako bi lahko uspešno simbolno integriral tak izraz. x je poljubno ne negativno število. 

Koda:

i = 3*sym.exp(3*x - 2*y)*sym.sin(2*x - 3*y)

sym.integrate(i, y)

Error:

ValueError: expected an expression convertible to a polynomial in Polynomial ring in _x0, _x1, _x2, _x3, _x4 over ZZ(exp(x))[_A0,_A1,_A2,_A3,_A4,_A5,_A6,_A7,_A8,_A9,_A10,_A11,_A12,_A13,_A14,_A15,_A16,_A17,_A18,_A19,_A20,_A21,_A22,_A23,_A24,_A25,_A26,_A27,_A28,_A29,_A30,_A31,_A32,_A33,_A34,_A35,_A36,_A37,_A38,_A39,_A40,_A41,_A42,_A43,_A44,_A45,_A46,_A47,_A48,_A49,_A50,_A51,_A52,_A53,_A54,_A55] with lex order, got -_x4**2*_A1 - _A10*_x0*_x4 - _A17*_x0*_x1 - _x3**2*_A18 - _A21*_x4 - _A22*_x0 - _x1**2*_A23 - 2*_A28*_x2*_x4 - _A3*_x3 - _A30*_x1*_x4 - 2*_A31*_x1*_x2 - _A33*_x3*_x4 - 2*_A38*_x0*_x2 - _A40 - _A41*_x1 - _A46*_x0*_x3 - 2*_A47*_x2 - 3*_x2**2*_A52 - _x0**2*_A53 - 2*_A54*_x2*_x3 - _A55*_x1*_x3 + _x0*_x1 - 3*_x1*(2*_A1*_x2*_x4 + _A10*_x0*_x2 + 2*_A11*_x3*_x4 + _x3**2*_A13 + _x1**2*_A14 + _A15 + _A21*_x2 + _A24*_x1 + 2*_A26*_x0*_x4 + _A27*_x0*_x1 + _x2**2*_A28 + _x0**2*_A29 + _A30*_x1*_x2 + _A33*_x2*_x3 + _A34*_x3 + _A36*_x0 + _A37*_x0*_x3 + 2*_A44*_x1*_x4 + 3*_x4**2*_A45 + 2*_A48*_x4 + _A8*_x1*_x3) + 2*_x3*(_x4**2*_A11 + 2*_A12*_x3 + 2*_A13*_x3*_x4 + _A16*_x0 + 2*_A18*_x2*_x3 + 2*_A20*_x1*_x3 + _A3*_x2 + _x1**2*_A32 + _A33*_x2*_x4 + _A34*_x4 + _A37*_x0*_x4 + _A46*_x0*_x2 + _A49*_x1 + _A5 + 2*_A50*_x0*_x3 + _x2**2*_A54 + _A55*_x1*_x2 + _A6*_x0*_x1 + 3*_x3**2*_A7 + _A8*_x1*_x4 + _x0**2*_A9) + 2*_x3*(_A10*_x2*_x4 + _A16*_x3 + _A17*_x1*_x2 + _A2 + _A22*_x2 + _A25*_x1 + _x4**2*_A26 + _A27*_x1*_x4 + 2*_A29*_x0*_x4 + _A36*_x4 + _A37*_x3*_x4 + _x2**2*_A38 + 2*_A4*_x0*_x1 + 3*_x0**2*_A42 + 2*_A43*_x0 + _A46*_x2*_x3 + _x3**2*_A50 + _x1**2*_A51 + 2*_A53*_x0*_x2 + _A6*_x1*_x3 + 2*_A9*_x0*_x3)*exp(3*x) + 3*_x4*(2*_A14*_x1*_x4 + _A17*_x0*_x2 + _A19 + _x3**2*_A20 + 2*_A23*_x1*_x2 + _A24*_x4 + _A25*_x0 + _A27*_x0*_x4 + _A30*_x2*_x4 + _x2**2*_A31 + 2*_A32*_x1*_x3 + 2*_A35*_x1 + 3*_x1**2*_A39 + _x0**2*_A4 + _A41*_x2 + _x4**2*_A44 + _A49*_x3 + 2*_A51*_x0*_x1 + _A55*_x2*_x3 + _A6*_x0*_x3 + _A8*_x3*_x4)

 

asked May 2, 2017 by vrecek96 (8,140 points)
minimalna koda ni celovita; ni jasno kako sta definirana x in y.
x in y sta simbola:

x, y = sym.symbols('x y')
Pozdravljeni! Imate prav, integral bi moralo izračunati. Sem odprl issue pri tukaj: https://github.com/sympy/sympy/issues/12614

1 Answer

+2 votes
 
Best answer
Gre za napako v sympy, ki je z zadnjo verzijo odpravljena!

Naredite sledeče (v notebooku):
!!conda update conda
!!conda update --all
Predvsem zadnje lahko traja cca 10min, ker bo posodobilo vse pakete na zadnjo verzijo.
answered May 6, 2017 by janko.slavic (74,430 points)
Sedaj deluje.
Hvala
...