FE 'tkGooie' Utilities

A Menu of
Tk script CODE
for some


(Ordinary Differential Equations,
Numerical Integration)

(FE = Freedom Environment)

Lorenz attractor orbits which
are often used as an
example of 'chaos'.
This does not look like chaos
to me --- just continuous,
smooth instability.

Chaos is asteroids
crashing into planets.
Chaos is galaxies colliding.
Chaos is carpet bombing.
Chaos is mass shootings.
Chaos looks more like
Brownian motion.
This is not chaos.

please use another term.
Don't be so overly
The 'chaos' terminology just
seems foolish in many cases.
Better to call this behavior
'furcation' or 'divergence',
or 'forking' or 'branching',
rather than 'chaos'.

FE Home Page > FE Downloads Page >

FE 'tkGooies' Description Page >

This ODEtools CODE Menu Page

! Note !
More 'tkGooie' ODE-utility scripts may be added
--- and the scripts here may be revised occasionally.

< Go to Code-Links List, below. >

OVERVIEW of 'ODEtools'
--- in the FE 'tkGooies' system :

A description of the FE 'tkGooies' system is available via a 'tkGooies' Description page.

That page points out that the 'tkGooies' are a collection of utilities in categories (and toolchests) such as

  • 3Dtools
  • AUDIOtools
  • FILEmanagers
  • IMAGEtools
  • INTERNETtools
  • MATHtools
    • MATHed
    • ODEtools
    • Converter-SELECTORtools
  • PLOTtools
  • SELECTORtools
  • SYSTEMtools
  • TEXTtools
  • VIDEOtools
  • Tk-GAME menus
  • Tk-WIKI demos
  • MORE

Just below is a list of links to pages that present the source code of a collection of the 'ODE utilities' in the FE 'tkGooies' system.

Some sources (books, etc.) for ODE coding projects are shown in a section at the bottom of this page.

These sources include equations, methods, and, in some cases, code.

Many of the books can be found in a university library --- a real university, not one of those just-to-rip-off-the-student universities --- like Trump University.

To aid in finding the book on library shelves, some library ID numbers are provided --- Library of Congress call numbers.

ODEtools Menu

(List of Links to pages that present descriptions
and CODE for 'ODEtools' 'tkGooie' scripts)

  • tkSimulateSinglePendulumNoFriction
    Integration of ODE's for a simple (wide-swinging, 'non-linear') pendulum, including an animation of the solution. A non-linear system simulation.

  • tkSimulateBouncing Ball
    Integration of ODE's for a bouncing ball, including an animation of the solution. An algebraic 'velocity-flipping' technique combined with a typical integration method.

  • tkSimulatePopulationGrowthLimit
    Integration of a first-order ODE for population growth subject to limit --- with a plot of the population curve on a Tk 'canvas'.

The following ODE utilities
are on a 'to-do' list.

  • Integration of ODE's for projectile flight (including air/fluid resistance), with animation of solution

  • Integration of ODE's for (non-linear) spring-mass-damper systems, with animation of solution

  • Integration of ODE's for free fall with air/fluid resistance leading to a terminal velocity, with animation of solution

  • Integration of ODE's for the plane (2D) 2-body problem, with animation of orbits

  • Integration of ODE's for the plane (2D) 3-body problem, with animation of orbits

  • Integration of ODE's for the *3D* 3-body problem, with trajectories output to 3D-line-segments in a 'Wavefront' OBJ file ---
    for use in a 3D model-file viewer utility, like a 'tkGooie' for 3D model file viewing

  • A GUI to integrate general first-order ODE's of the form u' = f(t,u) --- with a listbox of sample right-hand-sides to choose from. This includes ODE's whose solutions are the exponential and logarithmic functions.

  • A GUI to integrate general accleration-type 2nd-order ODE's of the form u'' = f(t,u,u') --- with a listbox of sample right-hand-sides to choose from. This includes ODE's whose solutions are sinusoidal.

  • Integration of ODE's for a double pendulum (wide-swinging, 'non-linear'), with animation of solution (seemingly chaotic motion)

  • Integration of a system of first-order ODE's
    to model predator-and-prey populations

  • Integration of a system of first-order ODE's to model extinction of species due to human population growth
    --- where the species is essentially the prey and the humans are essentially the predator
    (some humans being predators intentionally ---
    and many unintentionally)

  • Integration of a system of first-order ODE's for pharmacokinetics simulation ---
    2-compartment, plasma-tissue model,
    for a chemical with zero, one, or two metabolites,
    oral and/or intravenous administration,
    for various mammals
    (mouse, rat, rabbit, dog, human, horse)

  • and more

End of List of Code-Links.

How the code samples are presented :

Use the list-of-links (above) to go directly to web pages that contain source code along with code-descriptions and screenshots.

The Tk script files (and other auxiliary files, if any) are in text files that can be down-loaded to your computer and implemented.

To download, simply 'right-click' on a text link and, in a popup window of your web browser, choose an option such as 'Save Link Target As ...'.

Runge-Kutta equations for numerical integration

Some SOURCES (books, etc.)
for ODE and other Math/Physics coding projects:

  • BOOK: 'FORTRAN for Physics'
    by Alfed M. Bork, 1967 (QC20.2.B734),
    includes examples such as:

    • Planetary motion,
      pages 15 and 33-plus

    • 3-body problem,
      pages 45 to 62 (code on page 56)

    • Harmonic oscillator,
      pages 11 and 27-plus

  • BOOK: 'Theoretical Physics on the Personal Computer'
    by Schmid, Spitz, and Losch, 1990 (QC20.7),
    includes FORTRAN code with a 'RUNGE' subroutine

  • BOOK: 'Applied Differential Equations'
    by Murray Spiegel, 1st ed. 1958,
    3rd ed. 1981 (QA371.S82),
    lots of examples

  • BOOK: 'Modelling with Differential Equations'
    by Burghes and Borrie, 1981 (QA372.B955),
    nice examples

  • BOOK: 'Periodic Motions'
    by Miklos Farkas, 1994 (QA371.F),
    includes examples such as:

    • Lotka-Volterra predator-prey model,
      pages 114 to 121

    • Predator-prey model with memory,
      pages 439 to 456

    • Linear systems
      (constant coefficient; periodic coefficient; forced)

    • Hill's and Mathieu's equations

    • Lienard's equation
      (autonomous ; periodically forced)

    • Duffing's equation
      (autonomous ; periodically forced)

    • Van der Pol's equation

  • BOOK: 'Short History of Mathematical Population Dynamics' by Nicolas Bacaer (HB849.51.B33)

  • BOOK: 'Physics and Computers'
    by Robert Ehrlich, 1973 (QC20.2.E33),
    includes examples such as:

    • Solution of Schrodinger equation
    • Analysis of bubble chamber photos
      (calculation of mass)
    • Discharge of capacitor in an RC circuit
    • RLC series circuit (free and forced)
    • Waves in 2 dimensions
      (moving source and shock waves)
    • Superposition of waves
      (Fourier synthesis)
    • Equipotential plot for 2 point charges
    • Potential for a charged thin wire
    • Simulation of a chain reaction
    • Least squares line fit of data
    • Monte Carlo calculation of center of mass
  • BOOK: 'Solved Problems in Classical Mechanics'
    by DeLange and Pierrus (QA809.D43)

  • BOOK: 'The Mechanics Problem Solver'
    by Fogiel, 1980 (QA809)

may give some insight on ODE's

A related area to ODE's is 'Calculus of Variations' :

Some WebSite Sources

Some free e-books may be available from freebookcentre.net (no registration required!! no attempts to keep you on their web pages!! no annoying popups!!) in the areas of Physics and Mathematics --- in particular in the areas of

A similar 'free ebooks' site is (or was) at e-booksdirectory.com.
See the Mathematics and Science-Physics categories.

Some 'free ebooks' and 'free HTML sites' in the math and physics categories are/were at physicsdatabase.com.

At openlibrary.org, you can use the Search field at the bottom of the math and physics pages to find books on specific topics. You can sort the results by 'most recent' (newest) or 'first published' (oldest).

Also, see the Mathematics and Physics 'bookshelves' on the Science Bookshelf page of gutenberg.org --- for some classic volumes (generally more than 80 years old).

A list of problem and excercise books in physics may still be available at the University of Wisconsin library.

For some links to more sources of 'freely available physics books', see this link at physics.stackexchange.com.

Bottom of this Menu page of
Links to pages of description-and-CODE
for FE 'tkGooie' scripts in the 'ODEtools' group
(Ordinary Differential Equations, Numerical Integration).

To return to a previously visited web page location, click on the Back button of your web browser a sufficient number of times. OR, use the History-list option of your web browser.
OR ...

< Go to Code-Links Menu, above. >

< Go to Top of Page, above. >

Page history:

Page was created 2014 May 11.

Page was changed 2015 Oct 05.
(Updated the 'tkGooies' categories list.)

Page was changed 2016 Jul 07.
(Implemented 'tkSimulateSinglePendulumNoFriction'.)

Page was changed 2016 Jul 17.
(Implemented 'tkSimulateBouncingBall'.)

Page was changed 2016 Aug 09.
(Implemented 'tkSimulatePopulationGrowthLimit'.)

Page was changed 2016 Sep 26.
(Added the 'Sources' section.)

Page was changed 2016 Oct 02.
(Changed image and text at top of page.)

Page was changed 2018 Aug 19.
(Added css and javascript to try to handle text-size for smartphones, esp. in portrait orientation.)

Page was changed 2019 Feb 24.
(Minor reformatting of this page.)

Page was changed 2019 Jun 13.
(Specified an image width in percents to size the image according to width of the browser window.)