Skip to content

viniciuspiotto/ordinary-differential-equations-methods

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Numerical Methods for Ordinary Differential Equations

This repository contains a collection of numerical methods for solving ordinary differential equations (ODEs). The methods are implemented in C, and the results can be visualized using a Python script.

Methods Implemented

The following numerical methods are implemented:

  • Explicit Euler
  • Implicit Euler
  • Implicit Midpoint
  • Implicit Trapezoidal
  • Runge-Kutta 2
  • Adams-Bashforth 2
  • Adams-Moulton 2
  • BDF2 (Backward Differentiation Formula 2)

How to Build and Run

The project uses a Makefile to compile and run the C code.

Prerequisites

  • gcc compiler
  • make
  • python3
  • matplotlib

Building the Project

To compile the source code, run the following command:

make

This will create an executable file named edos in the bin directory.

Running the Simulation

To run the simulation, use the following command:

make run

This will execute the edos program, which will generate an output.txt file containing the results of the ODE solvers.

Plotting Results

The plot.py script can be used to visualize the results from the output.txt file.

Usage

To generate plots of the results, run the following command:

./plot.py output.txt

This will create a plots directory and save the generated graphs in PNG format.

Project Structure

.
├── include/              # Header files for the C source code
├── src/                  # C source code for the numerical methods
├── Makefile              # Makefile for building and running the project
├── methods.py            # Python script for running the methods (if any)
├── plot.py               # Python script for plotting the results
└── README.md             # This file

Cleaning Up

To remove the compiled files, the output.txt file, and the plots directory, run:

make clean

About

EDO methods for the Mathematics and Applied Mathematics Workshop

Topics

Resources

Stars

Watchers

Forks

Contributors