The Naked Scientists
  • Login
  • Register
  • Podcasts
      • The Naked Scientists
      • eLife
      • Naked Genetics
      • Naked Astronomy
      • In short
      • Naked Neuroscience
      • Ask! The Naked Scientists
      • Question of the Week
      • Archive
      • Video
      • SUBSCRIBE to our Podcasts
  • Articles
      • Science News
      • Features
      • Interviews
      • Answers to Science Questions
  • Get Naked
      • Donate
      • Do an Experiment
      • Science Forum
      • Ask a Question
  • About
      • Meet the team
      • Our Sponsors
      • Site Map
      • Contact us

User menu

  • Login
  • Register
  • Home
  • Help
  • Search
  • Tags
  • Member Map
  • Recent Topics
  • Login
  • Register
  1. Naked Science Forum
  2. Non Life Sciences
  3. Physics, Astronomy & Cosmology
  4. What is an exponential, and how could you calculate it?
« previous next »
  • Print
Pages: [1]   Go Down

What is an exponential, and how could you calculate it?

  • 17 Replies
  • 1688 Views
  • 0 Tags

0 Members and 1 Guest are viewing this topic.

Offline Bored chemist (OP)

  • Naked Science Forum GOD!
  • *******
  • 27468
  • Activity:
    84.5%
  • Thanked: 922 times
    • View Profile
What is an exponential, and how could you calculate it?
« on: 15/02/2021 17:08:06 »
Quote from: vhfpmr on 15/02/2021 15:09:50
Quote from: Bored chemist on 13/02/2021 00:42:56
it's much better to model it as an exponential
An exponential is a polynomial.
Not really, no.
x^e is not the same as e^x

Moderator's Note: This was split off from a thread which looked at current through a diode as an exponential function, see: https://www.thenakedscientists.com/forum/index.php?topic=81689.0
« Last Edit: 16/02/2021 23:00:11 by evan_au »
Logged
Please disregard all previous signatures.
 



Offline alancalverd

  • Global Moderator
  • Naked Science Forum GOD!
  • ********
  • 14520
  • Activity:
    100%
  • Thanked: 1099 times
  • life is too short to drink instant coffee
    • View Profile
Re: What is an exponential, and how could you calculate it?
« Reply #1 on: 15/02/2021 18:05:06 »
10x is an exponential but not a polynomial. e-kt is a common exponential decay curve which can be approximated as a polynomial, to any required degree of accuracy. 
Logged
helping to stem the tide of ignorance
 

Offline evan_au

  • Global Moderator
  • Naked Science Forum GOD!
  • ********
  • 10343
  • Activity:
    36.5%
  • Thanked: 1245 times
    • View Profile
Re: What is an exponential, and how could you calculate it?
« Reply #2 on: 16/02/2021 02:15:59 »
Quote from: alancalverd
10x is an exponential but not a polynomial. e-kt is a common exponential decay curve which can be approximated as a polynomial, to any required degree of accuracy.
Using a Taylor Series, we can calculate the exponential function ex as a polynomial of infinite degree, to any desired accuracy:
ex = 1 + x + x2/2! + x3/3! + x4/4! + x5/5! + ...
- This polynomial series converges for all real values of x (and also all imaginary values, but let's leave that for another time...)
See: https://en.wikipedia.org/wiki/Taylor_series#Exponential_function

We can calculate an exponential decay e-kt using the same polynomial by substituting x=-kt.

We can calculate the exponential 10z using the same polynomial by substituting x=z/LN(10) = z/2.3026.... (or x=z*2.3026..., depending on which way you are going.)

So they are all variations on the same exponential function and polynomial calculation method.
« Last Edit: 16/02/2021 07:32:51 by evan_au »
Logged
 

Offline Bored chemist (OP)

  • Naked Science Forum GOD!
  • *******
  • 27468
  • Activity:
    84.5%
  • Thanked: 922 times
    • View Profile
Re: What is an exponential, and how could you calculate it?
« Reply #3 on: 16/02/2021 08:53:35 »
So, by doing an indefinitely large amount of work calculating higher and higher order terms, we can show that vhfpmr is still wrong, but only a little bit.

I wonder; how many polynomial terms do you need to use to get a reasonable degree of accuracy for calculating a simple obvious exponential function like 10^x where x=3 using a Taylor series?

As a polynomial, I can calculate 10^3 as being 1000 "by inspection", but I wonder how much work it takes to calculate as an expansion.

Logged
Please disregard all previous signatures.
 

Offline alancalverd

  • Global Moderator
  • Naked Science Forum GOD!
  • ********
  • 14520
  • Activity:
    100%
  • Thanked: 1099 times
  • life is too short to drink instant coffee
    • View Profile
Re: What is an exponential, and how could you calculate it?
« Reply #4 on: 16/02/2021 08:58:33 »
I was being pedantic, but as we discussed in another thread, the difference between a continuous analytic function and a polynomial approximation can be significant.
Logged
helping to stem the tide of ignorance
 



Offline Bored chemist (OP)

  • Naked Science Forum GOD!
  • *******
  • 27468
  • Activity:
    84.5%
  • Thanked: 922 times
    • View Profile
Re: What is an exponential, and how could you calculate it?
« Reply #5 on: 16/02/2021 09:05:33 »
Quote from: alancalverd on 15/02/2021 18:05:06
10x is an exponential but not a polynomial. e-kt is a common exponential decay curve which can be approximated as a polynomial, to any required degree of accuracy. 
I think your polynomial might struggle if k is complex or imaginary
Logged
Please disregard all previous signatures.
 

Offline alancalverd

  • Global Moderator
  • Naked Science Forum GOD!
  • ********
  • 14520
  • Activity:
    100%
  • Thanked: 1099 times
  • life is too short to drink instant coffee
    • View Profile
Re: What is an exponential, and how could you calculate it?
« Reply #6 on: 16/02/2021 11:18:08 »
We have no problem calculating  e-iπ, or even proving that e-iπ =  eiπ analytically, but as you say it would be a heck of a task to demonstrate the mutual convergence of series!
Logged
helping to stem the tide of ignorance
 

Offline vhfpmr

  • Sr. Member
  • ****
  • 435
  • Activity:
    6%
  • Thanked: 29 times
    • View Profile
Re: What is an exponential, and how could you calculate it?
« Reply #7 on: 16/02/2021 15:49:29 »
Quote from: Bored chemist on 16/02/2021 08:53:35
So, by doing an indefinitely large amount of work calculating higher and higher order terms, we can show that vhfpmr is still wrong, but only a little bit.
So how do you calculate  e  exactly?
Logged
 

Offline alancalverd

  • Global Moderator
  • Naked Science Forum GOD!
  • ********
  • 14520
  • Activity:
    100%
  • Thanked: 1099 times
  • life is too short to drink instant coffee
    • View Profile
Re: What is an exponential, and how could you calculate it?
« Reply #8 on: 16/02/2021 16:03:06 »
Same way as you calculate π - you can't!

The difference is that
π is absolutely defined as the ratio of circumference to diameter of a circle, is provably irrational, and can be approximated by various infinite series, but
e is absolutely defined as the sum of one infinite series (and is provably irrational).
Logged
helping to stem the tide of ignorance
 



Offline Bored chemist (OP)

  • Naked Science Forum GOD!
  • *******
  • 27468
  • Activity:
    84.5%
  • Thanked: 922 times
    • View Profile
Re: What is an exponential, and how could you calculate it?
« Reply #9 on: 16/02/2021 20:02:15 »
Quote from: vhfpmr on 16/02/2021 15:49:29
Quote from: Bored chemist on 16/02/2021 08:53:35
So, by doing an indefinitely large amount of work calculating higher and higher order terms, we can show that vhfpmr is still wrong, but only a little bit.
So how do you calculate  e  exactly?
Do you mean "exactly how do you go about calculating it?" or do you mean "how do you calculate the exact value of it?"
The answers are
I don't bother and you can't.
Logged
Please disregard all previous signatures.
 

Offline evan_au

  • Global Moderator
  • Naked Science Forum GOD!
  • ********
  • 10343
  • Activity:
    36.5%
  • Thanked: 1245 times
    • View Profile
Re: What is an exponential, and how could you calculate it?
« Reply #10 on: 16/02/2021 21:06:48 »
Quote
So how do you calculate  e  exactly?
If you need to specify the exact value, use the pronumeral e.

If you want to approximate it, calculate e1
ex = 1 + x + x2/2! + x3/3! + x4/4! + x5/5! + ...
e1 = 1 + 1 + 12/2! + 13/3! + 14/4! + 15/5! + ...
= 1 + 1 + 1/2! + 1/3! + 1/4! + 1/5! + ...
= 2.718281828...

This series converges quite quickly, because the factorial function n! gets very big, very quickly (ie 1/n! gets small very quickly).
I remember calculating this to over 100 digits accuracy on my first home computer (and it consumed most of the memory...)
(Oops - overlap with Bored Chemist...)

Quote from: Bored Chemist
calculating a simple obvious exponential function like 10^x where x=3 using a Taylor series
10 = e2.3026
103 = (e2.3026)3 = e3x2.3026 = e6.9

The first 6 terms grow, and it starts to converge after the 7th term = 6.97/7!

Of course, if you had to calculate 10^7.654, it wouldn't be so obvious, and I would recommend using a calculator (log tables being no longer found in every scientist's desk).

Quote from: bored chemist
I think your polynomial might struggle if k is complex or imaginary
The exponential function converges for all imaginary values, too.
- You can express the answer in terms of COS(θ) + iSIN(θ).

You can see this in the similarity between the Taylor series for the exponential function EXP(x), SIN(x) & COS(x).
- SIN and COS are what you get if you use the EXP function with complex inputs
- Remembering that i2 = -1

EXP(x) = 1 + x + x2/2! + x3/3! + x4/4! + x5/5! + ...
SIN(x) =     x         - x3/3!        + x5/5! - ...
COS(x) = 1     - x2/2!         + x4/4! - ...

« Last Edit: 16/02/2021 21:09:54 by evan_au »
Logged
 
The following users thanked this post: Bored chemist

Offline Bored chemist (OP)

  • Naked Science Forum GOD!
  • *******
  • 27468
  • Activity:
    84.5%
  • Thanked: 922 times
    • View Profile
Re: What is an exponential, and how could you calculate it?
« Reply #11 on: 16/02/2021 22:45:48 »
Quote from: evan_au on 16/02/2021 21:06:48
The first 6 terms grow, and it starts to converge after the 7th term = 6.97/7!
But how long does it take before it converges to within 1% of 1000 ?
Also, I think we may have possibly drifted away from the core of the topic slightly.
« Last Edit: 16/02/2021 22:49:12 by Bored chemist »
Logged
Please disregard all previous signatures.
 

Offline alancalverd

  • Global Moderator
  • Naked Science Forum GOD!
  • ********
  • 14520
  • Activity:
    100%
  • Thanked: 1099 times
  • life is too short to drink instant coffee
    • View Profile
Re: What is an exponential, and how could you calculate it?
« Reply #12 on: 16/02/2021 23:39:25 »
Quote from: evan_au on 16/02/2021 21:06:48
10 = e2.3026

Er, no, it's closer to e2.3025850929940456840179914546844 or, as we say in my world, e2.3025+1/-0
Logged
helping to stem the tide of ignorance
 



Offline evan_au

  • Global Moderator
  • Naked Science Forum GOD!
  • ********
  • 10343
  • Activity:
    36.5%
  • Thanked: 1245 times
    • View Profile
Re: What is an exponential, and how could you calculate it?
« Reply #13 on: 17/02/2021 08:39:33 »
My observation is that most people get surprised by the speed of exponential growth.
- Once it is big enough to be noticeable, it just explodes on the scene
- Until it runs into some fundamental limit (like a virus that infects the whole population)

A comment from some epidemiologists: For every day you delay the start of a lockdown, you add a week to the time to lift it
Rationale:
- At the start of an outbreak, the number of infections is growing exponentially; with a 5-day lag between infection and showing symptoms, the number of cases is far higher than you see
- As you try to control an outbreak, the number of cases falls off as a negative exponential. The rate of fall is far lower than the rate of increase (if you plot case numbers on a logarithmic graph)


In the following thread, there is some spreadsheet modeling of the near-exponential growth of the early days of the COVID-19 pandemic (warning: New Theories, with sometimes dodgy assumptions!):
https://www.thenakedscientists.com/forum/index.php?topic=81624.msg629376#msg629376

Logged
 

Offline vhfpmr

  • Sr. Member
  • ****
  • 435
  • Activity:
    6%
  • Thanked: 29 times
    • View Profile
Re: What is an exponential, and how could you calculate it?
« Reply #14 on: 17/02/2021 16:04:29 »
Quote from: alancalverd on 16/02/2021 16:03:06
Same way as you calculate π - you can't!
I know. That's my point.

He was carping that a polynomial is a lot of work for an approximate answer, but it's a lot of work summing a series all the way to infinity, so any attempt at numerical evaluation of a transcendental function is an approximation.
Logged
 

Offline evan_au

  • Global Moderator
  • Naked Science Forum GOD!
  • ********
  • 10343
  • Activity:
    36.5%
  • Thanked: 1245 times
    • View Profile
Re: What is an exponential, and how could you calculate it?
« Reply #15 on: 17/02/2021 19:56:52 »
Quote from: bored chemist
But how long does it take before it converges to within 1% of 1000 ?
As shown below, the Taylor series for ex takes 17 terms to converge within 1% of 103
- But 26 terms to converge within 1% of 10-3: The terms are the same size, but alternating + & -
- And it's not a good idea to subtract large numbers that are close to each other: You lose a lot of accuracy
- In theory, the Taylor series is infinitely accurate (within a "radius of convergence"), but it takes forever to get there
- In practice, different coefficients are used that give you a finite accuracy, but in a finite time

* Taylor_Convergence.png (31.15 kB . 419x618 - viewed 1668 times)
Logged
 

Offline Bored chemist (OP)

  • Naked Science Forum GOD!
  • *******
  • 27468
  • Activity:
    84.5%
  • Thanked: 922 times
    • View Profile
Re: What is an exponential, and how could you calculate it?
« Reply #16 on: 17/02/2021 21:06:24 »
Quote from: evan_au on 16/02/2021 21:06:48
The exponential function converges for all imaginary values, too.
Yes it does- sort of.
Euler's formula tells you that exp (i x)  = i sin (x) + cos (x)

And the thing about that is that (even just the real part of it)  waves  up and down forever as x increases.
And the only way to get a polynomial to do that is to have a polynomial of infinite order.
Even a bad approximation to the function needs an infinite number of terms.

Over the range 0 to  tenth of a radian you can approximate sin (x) as x and not get a bad answer.
You can get a bit more sophisticated and subtract x^3/3! and get a pretty good approximation over the range 0 to 1

But if you want to cover the range 0 to 3 you need a 7th order polynomial.

And it gets rapidly worse, which is why I said

Quote from: Bored chemist on 16/02/2021 09:05:33
your polynomial might struggle if k is complex or imaginary


An ordinary exponential function (of a real number) is monotonic but if you include i in the equation it can bounce up and down forever.
An nth order polynomial can  only bounce about n times
Logged
Please disregard all previous signatures.
 



Offline evan_au

  • Global Moderator
  • Naked Science Forum GOD!
  • ********
  • 10343
  • Activity:
    36.5%
  • Thanked: 1245 times
    • View Profile
Re: What is an exponential, and how could you calculate it?
« Reply #17 on: 18/02/2021 20:01:18 »
Playing around with it, I graphed the convergence of the Taylor series for EXP(x) when x=10^3 and x=10^-3.
- The terms have the same values, but oscillate + & - when x < 0.

* Taylor_convergence_graph.png (22.99 kB . 586x353 - viewed 1616 times)

The magnitude of positive and negative terms are both around 500; but their difference introduces significant errors.
- The following table only looks at the first 26 terms in the Taylor series for EXP(x)
- It's better to calculate EXP(10^3) in both cases, and then calculate EXP(10^-3) = 1/EXP(10^3)

* Sum_26_Terms.png (10.27 kB . 312x299 - viewed 1612 times)

Most of us use computers which store floating point numbers in binary.
- In some ways, it's more straightforward to calculate functions like 2x and LOG2(x) and convert the base
- than calculate ex and LOGe(x) or 10x and LOG10(x)
Logged
 



  • Print
Pages: [1]   Go Up
« previous next »
Tags:
 

Similar topics (5)

How to calculate the volume of gas passing through an imaginary volume?

Started by scientizschtBoard Physics, Astronomy & Cosmology

Replies: 1
Views: 2228
Last post 09/07/2018 10:02:49
by Bored chemist
How do you calculate the total heat energy absorbed by a solid heated on 1 side?

Started by briliggBoard Physics, Astronomy & Cosmology

Replies: 5
Views: 9845
Last post 30/08/2012 22:37:11
by briligg
Calculate required force to move vehicles in circular motion (big loop)

Started by newrobertBoard General Science

Replies: 11
Views: 9519
Last post 18/11/2014 17:05:36
by newrobert
Can you calculate the speed of particles participating in a chemical reaction?

Started by CsManiacDanBoard Chemistry

Replies: 9
Views: 11104
Last post 16/11/2018 09:27:05
by evan_au
How do I calculate scattering and absorption coefficient of a colour polymer?

Started by woodBoard Physics, Astronomy & Cosmology

Replies: 0
Views: 6879
Last post 04/02/2005 03:47:33
by wood
There was an error while thanking
Thanking...
  • SMF 2.0.15 | SMF © 2017, Simple Machines
    Privacy Policy
    SMFAds for Free Forums
  • Naked Science Forum ©

Page created in 0.271 seconds with 75 queries.

  • Podcasts
  • Articles
  • Get Naked
  • About
  • Contact us
  • Advertise
  • Privacy Policy
  • Subscribe to newsletter
  • We love feedback

Follow us

cambridge_logo_footer.png

©The Naked Scientists® 2000–2017 | The Naked Scientists® and Naked Science® are registered trademarks created by Dr Chris Smith. Information presented on this website is the opinion of the individual contributors and does not reflect the general views of the administrators, editors, moderators, sponsors, Cambridge University or the public at large.