Skip to content

tomeng70/RungeKutta

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

49 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Introduction

This repository contains code that demonstrates how an estimated solution to an ordinary differential equation can be generated using numerical methods. There are two projects within this repository. The project exponential/ demonstrates how the backwards Euler method can be used to obtain an estimated solution for the exponential growth rate problem. The project plots the population vs time for a colony that grows exponentially. The estimated results are compared to the exact (analytical) results in the plot.

The second project, logistic/, demonstrates how the Runge-Kutta 4th order (RK4) method can be used to obtain an estimated solution for the logistic growth rate problem. While the RK4 does not work well for modeling a system that grows exponentially, it can be used to model a system that experiences logistic growth. In logistic growth, the carrying capacity of the system limits the growth of the population and the RK4 method is able to more accurately model the population size as a function of time.

Requirements

In order to be able to the run the programs in this repository, you will need Python3 installed on your computer. You will also need the matplotlib package installed in your Python3 environment.

Exponential Growth

The folder exponential/ contains a Python program, ExponentialGrowth.py, which plots two curves that represent the exponential growth of a colony:

  • The data points that are marked with the "." symbols are the analytically derived values for population.
  • The data points that are marked with the "+" symbols are the estimated values that were calculated using an implicit iterative method.

Click here for a detailed description of the Exponential Growth problem.

Logistic Growth

The folder logistic/ contains a Python program, Logistic.py, which plots two curves that represent the logistic growth of a colony:

  • The data points that are marked with the "." symbols are the analytically derived values for population.
  • The data points that are marked with the "^" symbols are the estimated values that were calculated using the RK4 iterative method.

Click here for a detailed description of the Logistic Growth problem.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages