FE 'tkGooie' Utilities


Tk script CODE of

the 'ODEtools' group

(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 comets
crashing into planets --- galaxies colliding. Chaos is
carpet bombing. Chaos looks more like Brownian motion.
This is not chaos. Mathematicians, please use another term.
For example: Instability theory. Don't be so overly melodramatic.
The 'chaos' terminology just seems foolish in many cases.
Better to call this behavior furcation, rather than 'chaos'.

FE Home Page > FE Downloads Page > FE 'tkGooies' Description Page > This Page

! Preliminary ! A few more 'tkGooies' ODE-utilities 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 (toolchests) such as

  • 3Dtools
  • AUDIOtools
  • FILEmanagers
  • IMAGEtools
  • INTERNETtools
  • MATHtools
    • ODEtools
    • MATHed
    • 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). To aid in finding the book on library shelves, some library ID numbers are provided --- Library of Congress call numbers.

List of Links to pages that present the CODE of '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 (to-be-done-with-Tk-GUI's) 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 system, 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 plane (2D) 2-BODY PROBLEM, with animation of orbits

  • Integration of ODE's for plane (2D) 3-BODY PROBLEM, with animation of orbits

  • Integration of ODE's for *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

  • 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 intentionally and many unintentionally)

  • Integration of a system of first-order ODE's for PHARMACOKINETICS simulation --- 2-compartment, plasma-tissue model, for a chemical and up to 2 metabolites, oral and/or intravenous administration, for various mammals (ex: 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)
    which 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)
    which 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)
    which 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)
    which 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)

Some REFERENCES that 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 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 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 the Links to FE 'tkGooies' Code - 'ODEtools' (Ordinary Differential Equations, Numerical Integration) group page.

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 List, above. >
< Go to Top of Page, above. >
< Go to FE 'tkGooies' Description page >
< Go to FE Home page. >

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.)