Introduce an integral function in a spreadsheet (Excel MS)

Click For Summary
SUMMARY

The discussion centers on integrating a specific function, $$ \int \frac{1}{ \sqrt{.443s^3+1}} ds $$, in Microsoft Excel. Participants suggest that Excel lacks a built-in integration function, recommending alternatives such as ExceLab's QUADF function, Desmos for online graphing, and user-defined functions in VBA using numerical methods like the Trapezoid Rule or Simpson's Rule. Additionally, tools like Wolfram Alpha and online calculators for cosmological models are mentioned as viable options for those unfamiliar with advanced programming languages.

PREREQUISITES
  • Basic understanding of integral calculus
  • Familiarity with Microsoft Excel and its functions
  • Knowledge of numerical integration methods (Trapezoid Rule, Simpson's Rule)
  • Experience with user-defined functions in VBA
NEXT STEPS
  • Learn how to implement numerical integration in Excel using VBA
  • Explore the QUADF function in ExceLab for integration tasks
  • Investigate online graphing tools like Desmos for visualizing integrals
  • Study Python or MATLAB for more advanced scientific computing capabilities
USEFUL FOR

This discussion is beneficial for students, hobbyists, and researchers interested in numerical integration, particularly those using Excel for scientific calculations or exploring cosmological models.

Peter Sterken
Homework Statement
introduce integral function in spreadsheet (Excel MS), to construct the Lambda-CDM model myself
Relevant Equations
"( .443s^3+1)^(-1/2) for the integrand, type in s for the variable and 1 to 2 for the limits. Press submit, then change 2→3→4→5 and repeat."
I found some interesting equations on cosmology and I was wondering how to introduce the integral in an excel sheet:
"Paste ( .443s^3+1)^(-1/2) in for the integrand, type in s for the variable and 1 to 2 for the limits. Press submit, then change 2→3→4→5 and repeat."
(from the thread https://www.physicsforums.com/threa...simplifying-the-standard-cosmic-model.811718/ )

Any suggestion would be greatly appreciated!
Greetings,
Peter
 
Physics news on Phys.org
I’m not 100% sure I understand what you want but I think this might sort it out…

I’m no Excel expert but I believe Excel doesn’t provide an integration function.

If you have ExceLab say, you can use the QUADF function for integration. Instructions are available online (including on YouTube).

Otherwise, you could use Desmos. Go here:
https://www.desmos.com/calculator/caqq1d7gsx
You’ll see I’ve already set it up for you (using ‘x’ rather then ‘s’) with integration limits from 1 to 2.

It’s a really useful free tool.
 
It would be pretty easy to have it compute some riemann sums for you by using some formulas.
 
Just to make sure I understand, your integral is the following, right?

$$ \int \frac{1}{ \sqrt{.443s^3+1}} ds $$

The gnarly thing here is that it is ##s^3##.

So, are you stuck on doing the integral? Or on getting it into Excel?
 
I think you implement F(x) = \int_1^x (0.443s^3+1)^{-1/2}\,ds as a user-defined function in VBA, with the integral approximated by either the Trapezoid Rule or Simpson's Rule.

Or you avoid Excel entirely, and use Wolfram Alpha or similar.
 
Steve4Physics said:
I’m not 100% sure I understand what you want but I think this might sort it out…

I’m no Excel expert but I believe Excel doesn’t provide an integration function.

If you have ExceLab say, you can use the QUADF function for integration. Instructions are available online (including on YouTube).

Otherwise, you could use Desmos. Go here:
https://www.desmos.com/calculator/caqq1d7gsx
You’ll see I’ve already set it up for you (using ‘x’ rather then ‘s’) with integration limits from 1 to 2.

It’s a really useful free tool.
thanks a lot @Steve4Physics the desmos tool looks great!
 
Office_Shredder said:
It would be pretty easy to have it compute some riemann sums for you by using some formulas.
that sounds pretty heavy @Office_Shredder :-D
 
BillOnne said:
Just to make sure I understand, your integral is the following, right?

$$ \int \frac{1}{ \sqrt{.443s^3+1}} ds $$

The gnarly thing here is that it is ##s^3##.

So, are you stuck on doing the integral? Or on getting it into Excel?
yes, that's the integral, and I'm stuck on both... Thanks @BillOnne :-D
 
pasmith said:
I think you implement F(x) = \int_1^x (0.443s^3+1)^{-1/2}\,ds as a user-defined function in VBA, with the integral approximated by either the Trapezoid Rule or Simpson's Rule.

Or you avoid Excel entirely, and use Wolfram Alpha or similar.
I'll have a look at that, thanks a lot @pasmith ! greetings
 
  • #10
If your goal is to investigate the ΛCDM model there are a few tools on the web e.g. https://light-cone-calc.github.io/ and https://cosmocalc.icrar.org/

If you want to duplicate these calculations yourself then I have three questions:
  1. Why (for example to learn more about how we use computers to solve problems in physics, or to learn more about the implications of the ΛCDM model)?
  2. How much do you already know about numerical analysis, and particularly numerical integration (usually known as quadrature)?
  3. What experience do you have with computer languages?
 
  • Like
Likes   Reactions: BvU
  • #11
pbuk said:
If your goal is to investigate the ΛCDM model there are a few tools on the web e.g. https://light-cone-calc.github.io/ and https://cosmocalc.icrar.org/

If you want to duplicate these calculations yourself then I have three questions:
  1. Why (for example to learn more about how we use computers to solve problems in physics, or to learn more about the implications of the ΛCDM model)?
  2. How much do you already know about numerical analysis, and particularly numerical integration (usually known as quadrature)?
  3. What experience do you have with computer languages?
Dear @pbuk , thank you for the links to the calculators!

My answers are :
1. pure fascination and a hobby
2. very little as I'm self-taught (even though I have already published 4+ peer-reviewed papers on physics and trees)... math is not my forte
3. just MS Excel, as Matlab and Phyton are beyond my current capabilities

best regards,
Peter
 
  • #13
Peter Sterken said:
3. just MS Excel, as Matlab and Phyton are beyond my current capabilities
Excel is not very suited for scientific computing. You have identified Matlab and Python as more advanced options and they can both be very useful. You do not need to know a lot to make basic use of them and there is a lot of help and reference available online.

To learn bit by bit based on interest is a good way to approach the issue and knowing either will be beneficial in many scenarios.

I’ll also just mention GNU Octave, which is largely compatible with Matlab but distributed for free under GPL.
 
  • Informative
Likes   Reactions: Peter Sterken
  • #14
Great, thanks for the support! :biggrin:
 

Similar threads

  • · Replies 5 ·
Replies
5
Views
1K
  • · Replies 277 ·
10
Replies
277
Views
23K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 2 ·
Replies
2
Views
4K
  • · Replies 105 ·
4
Replies
105
Views
11K
  • · Replies 7 ·
Replies
7
Views
3K
  • · Replies 2 ·
Replies
2
Views
14K
  • · Replies 28 ·
Replies
28
Views
7K
  • · Replies 32 ·
2
Replies
32
Views
7K
  • · Replies 12 ·
Replies
12
Views
4K