Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I want to simplify the sum

smp.Sum(smp.Sum(smp.Indexed('x',i), (i, 0, n)),(j,0,n))

where x, i, j, and n are standard defined sympy variables. Note that this is a double sum, but the variable being summed over (x_i) only depends on i. Hence, when simplifying this expression, I should get n*sum_i x_i but this is not the case. In other words

smp.Sum(smp.Sum(smp.Indexed('x',i), (i, 0, n)),(j,0,n)).simplify()

Does not remove the outer sum (over j) and replace it with a multiplicative factor of n, like it should.

Am I using simplification wrong here? Or is this not implemented in sympy yet...?

question from:https://stackoverflow.com/questions/66058091/double-summation-simplifcation-in-sympy

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
474 views
Welcome To Ask or Share your Answers For Others

1 Answer

Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...