Git Product home page Git Product logo

numericalmethods's Introduction

NumericalMethods

Solving ODEs and PDEs using numerical analysis in Matlab.

Figure: Solution of Laplace equation for boundary conditions u(0, y) = u(1, y) = y , for 0 < y < 1; u(x, 0) = u(x, 1) = x , for 0 < x < 1;

As defined in spec.pdf, as part of ELEC95018 Mathematics 2C: Numerical Analysis, we were tasked to work on five different exercises, focusing on the numerical analysis of ordinary and partial differential equations with the help of MATLAB.

Three second order Runge-Kutta methods are covered throughout the course of this project, namely Heun’s method, midpoint method, and a method of our choice. Following this, we applied the Gauss-Seidel relaxation method, followed by an adaptation of it with Successive Over-Relaxation (SOR).

Numerical methods are mathematical methods that find/approximate the solution to complicated problems, by reducing it to a series of addition, subtraction, or multiplication operations. It provides a fast solution to many mathematical problems which are present in various fields of engineering.

By annotating the relevant MATLAB code, explaining the results, and elaborating the mathematical processes behind the results in our Project Report, we aim to provide a concise explanation of how numerical methods can be used to solve problems faced by engineers in the modern world.

Setup

First, if you haven't already, make sure you have MATLAB installed on your local machine! This link should help facilitate that.

Next, ensure you have this project locally. Run this command in terminal, from the folder you would like the file to be in.

git clone https://github.com/RaphaelBijaoui/NumericalMethods.git

Open Matlab and from there, open the folder you just downloaded.

Now onto the fun stuff!

Running Scripts

All scripts can be run from the Matlab application. This is a general guide of what each script does:

  • RK.m: a matlab function that implements Heun’s method, the midpoint method and a new method we devised.
  • RK2_script.m: contain calls to the function RK.m, for a number of different examples, as outlined in spec.pdf page 2.
  • error_script.m: error analysis for the solution of an RC circuit, basic case with R, C, qC(0) as above, with a cosine wave as input.
  • RLC_script.m: solves the ODE from an RLC circuit for a range of input functions. See Exercise 3 from spec.pdf for more.
  • RK4.m: a matlab function that implements the classic fourth-order Runge-Kutta algorithm for any system of two coupled first order equations. Needs to be passed arguments.
  • relaxation.m: implements the Gauss-Seidel relaxation method for Laplace’s equation on the unit square, with boundary conditions u(0, y) = u(1, y) = y , for 0 < y < 1; u(x, 0) = u(x, 1) = x , for 0 < x < 1;
  • SOR.m: a more computationally efficient solution of Laplace's equation using Successive Over-Relaxation (SOR.m)

Final Comments

For a more in-depth analysis of these numerical methods, have a look at ProjectReport.pdf, which details our findings along this exciting project defined in spec.pdf for ELEC95018 Mathematics 2C: Numerical Analysis, completed alongside George Chen, Archibald Crichton, Karl K Melaimi, Samuel Sim, and Stacey Wu.


... and as usual, if anything, the door is always open. Contact details in bio!

Enjoy :)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.