Why symsum does not provide the right result?

2 ビュー (過去 30 日間)
Serbring
Serbring 2021 年 5 月 18 日
コメント済み: Serbring 2021 年 5 月 18 日
Hi all,
I need to find the symbolic solution of the sum of the mathematical series, but symsum does not provide the right result. Here you an example with the serie: .
syms i
symsum(i,i)
ans =
i^2/2 - i/2
This is very different from the theretical result. However, if I limit the series as follows:
symsum(i,i,0,100)
ans =
5050
That is corect. However, it is differente than
subs(symsum(i,i),i,100)
ans =
4950
Why symsum does not provide the right result?

採用された回答

Jan
Jan 2021 年 5 月 18 日
syms i n
symsum(i,i, 1, n)
ans = 
If you define the sum without limits like in symsum(i,i) something different is calculated according to the documentation ( doc symsum ):
F = symsum(f,k) returns the indefinite sum (antidifference) of the series f with respect to the summation index k. The f argument defines the series such that the indefinite sum F satisfies the relation F(k+1) - F(k) = f(k).
  1 件のコメント
Serbring
Serbring 2021 年 5 月 18 日
It worked. thank you so much.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCalculus についてさらに検索

製品


リリース

R2020a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by