Efficient Conversion of Sums to Integrals: Tips and Tricks for Mathematicians

  • Context: Graduate 
  • Thread starter Thread starter natski
  • Start date Start date
  • Tags Tags
    Integrals Sums
Click For Summary

Discussion Overview

The discussion revolves around the conversion of a sum to an integral, specifically focusing on a mathematical expression involving a function f and its behavior as the variable h approaches a limit. Participants explore the motivations for this conversion, potential methods, and the implications of accuracy in calculations.

Discussion Character

  • Exploratory
  • Technical explanation
  • Debate/contested
  • Mathematical reasoning

Main Points Raised

  • One participant seeks advice on converting a specific sum to an integral, expressing frustration with the current computational efficiency.
  • Another participant questions the necessity of converting the sum to an integral, suggesting it may be an assignment.
  • A participant proposes that the conversion could be approached by considering contour integrals and residues.
  • Concerns are raised about the precision of sums compared to integrals, with one participant arguing that integration would yield perfect precision as the number of terms increases.
  • There is a request for a clearer formulation of the problem, indicating that the initial expression was not well understood.
  • Participants discuss the formatting of the mathematical expression, with one suggesting the use of LaTeX for clarity.
  • A later reply highlights discrepancies between the original expression and what was included in a Mathematica notebook, indicating confusion about the problem's formulation.
  • Another participant offers to help improve the computational efficiency of the sum calculation, suggesting that the current time taken is impractical.

Areas of Agreement / Disagreement

Participants express differing views on the necessity and methods for converting the sum to an integral. There is no consensus on the best approach or the implications of the conversion.

Contextual Notes

Participants note limitations in the clarity of the problem statement and the need for precise definitions of terms used in the mathematical expressions. The discussion reflects varying levels of understanding and interpretation of the original problem.

natski
Messages
262
Reaction score
2
Hi guys,

I'm working on a project at the moment where I want to convert a sum to an integral but I am out of ideas. Basically I have something like:

Sum over h: [f(h+0.5dh)]^(-1) - [f(h-0.5dh)]^(-1)

where h goes from 0 to H.

Any tips would be appreciated!
 
Physics news on Phys.org
You can't sum that?

;0
 
I can sum it, yes. But I want the expression as an integral.
 
Ok yes, I tried to change it a bit to make it easier to post it. I have attached the mathematica notebook of the expression since I don't get on with latex. In the expression, I know the function f, which is only a function of one thing. Everything in the expression is a constant except j, which is the integer I am adding over.
 

Attachments

This sounds like an assignment of some kind, why would you want to express the sum as an integral?

The only thing I can think of is working backwards to a contour integral starting from the idea that this is a sum of the residues of some function.
 
The motivation for expressing it as an integral is that by using the sum, even by increasing the numbers of terms to say 1E6, the accuracy is still obviously not perfect. But an integration would give perfect precision. As I increase the number of terms in my sum, I am taking thinner and thinner slices and so the limit should be when the slices have thickness dh.

I can do the problem with the sum but it takes a lot of time to do 1E6 operations (around 4 minutes) and I think the integration will be nearly instantaneous.
 
Last edited by a moderator:
Let's get this into LaTeX.

natski said:
Sum over h: [f(h+0.5dh)]^(-1) - [f(h-0.5dh)]^(-1)

where h goes from 0 to H.

Is this it?

\sum_{h=0}^H\left(\frac{1}{f(h+0.5dh)}-\frac{1}{f(h-0.5dh)}\right)

I want to make sure that the "-1" exponents don't actually refer to inverse functions.
 
Last edited:
In the Mathematica notebook this is what he included:

\sum _{j=1}^N \sin ^{-1}\left(\frac{20<br /> \eta }{\left(\frac{H j}{N}+10\right)<br /> \left(f\left(\frac{H<br /> j}{N}\right)+f\left(\frac{H<br /> (j+1)}{N}\right)\right)}\right)-\sin<br /> ^{-1}\left(\frac{20 \eta<br /> }{\left(\frac{H j}{N}+10\right)<br /> \left(f\left(\frac{H<br /> (j-1)}{N}\right)+f\left(\frac{H<br /> j}{N}\right)\right)}\right)<br />

Which is nothing like what has appeared in the forum! By the way natski, look up the function TeXForm in Mathematica.

Natski, four minutes is really slow for doing the sum. Why don't you post for me the notebook where you calculate the sum? I will speed it up to be practical and efficient.
 

Similar threads

  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 16 ·
Replies
16
Views
4K
  • · Replies 18 ·
Replies
18
Views
2K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K