Integration of a Series Sum

1 vue (au cours des 30 derniers jours)
Thomas
Thomas le 12 Déc 2012
I want to write a series sum in terms of a variable that I will integrate numerically:
syms q
fun = @(k) symsum(k*q,q,0,10)
integral(fun,0,1)
How can this be done?

Réponse acceptée

Walter Roberson
Walter Roberson le 12 Déc 2012
Modifié(e) : Walter Roberson le 12 Déc 2012
sum(k*q,q,0,10) is going to be k * sum(q,q,0,10) which is going to be k * (10 * (10+1) / 2) which is going to be 45*k
integral(45*k, k, 0, 1) is going to be 45*k^2/2 evaluated at 1, which will be 45/2 .
Anyhow:
syms k q
fun = matlabFunction( symsum(k*q, q, 1, 10), 'vars', k);
and then integrate fun
  1 commentaire
Thomas
Thomas le 12 Déc 2012
Unfortunately, the real series is rather more complicated, but thanks to your quick response, I hope Matlab will be able to handle it numerically. Thanks again.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Programming dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by