Giter Club home page Giter Club logo

numerical-mooc's Introduction

Practical Numerical Methods with Python

This project started in 2014 as a multi-campus, connected course (plus MOOC) on numerical methods for science and engineering.

In Fall 2015 and 2016, second and third run of the connected courses, we had these instructors participating (using the materials as part of their syllabus):

"Practical Numerical Methods with Python" is an open, online course hosted on an independent installation of the Open edX software platform for MOOCs. The MOOC (massive open online course) was run in 2014 for the first time by Prof. Barba at the George Washington University. At the same time, two other participating instructors ran a local course, for credit at their institution.

The MOOC

You can register for the MOOC at any time in the GW Online Open edX platform to experience the complete course (including quizzes, examples and discussion board).

All content is open —really open, i.e., you can use, share, mod, remix— and most is available outside the course platform also (on GitHub and YouTube).

Find the list of IPython Notebooks, with links to nbviewer, in the Wiki.

Getting Started

  1. Introduction to the command line: OS X version; RedHat version
  2. Installing Jupyter
  3. Introduction to Jupyter notebooks
  4. Introduction to git

Course Modules

  1. The phugoid model of glider flight. Described by a set of two nonlinear ordinary differential equations, the phugoid model motivates numerical time integration methods, and we build it up starting from one simple equation, so that the unit can include 3 or 4 lessons on initial value problems. This includes: a) Euler's method, 2nd-order RK, and leapfrog; b) consistency, convergence testing; c) stability Computational techniques: array operations with NumPy; symbolic computing with SymPy; ODE integrators and libraries; writing and using functions.
  2. Space and Time—Introduction to finite-difference solutions of PDEs. Starting with the simplest model represented by a partial differential equation (PDE)—the linear convection equation in one dimension—, this module builds the foundation of using finite differencing in PDEs. (The module is based on the “CFD Python” collection, steps 1 through 4.) It also motivates CFL condition, numerical diffusion, accuracy of finite-difference approximations via Taylor series, consistency and stability, and the physical idea of conservation laws. Computational techniques: more array operations with NumPy and symbolic computing with SymPy; getting better performance with NumPy array operations.
  3. Riding the wave: convection problems. Starting with an overview of the concept of conservation laws, this module uses the traffic-flow model to study different solutions methods for problems with shocks: upwind, Lax-Friedrichs, Lax-Wendroff, MacCormack, then MUSCL (discussing limiters). Reinforces concepts of numerical diffusion and stability, in the context of solutions with shocks. It will motivate spectral analysis of schemes, dispersion errors, Gibbs phenomenon, conservative schemes.
  4. Spreading out: diffusion problems. This module deals with solutions to parabolic PDEs, exemplified by the diffusion (heat) equation. Starting with the 1D heat equation, we learn the details of implementing boundary conditions and are introduced to implicit schemes for the first time. Another first in this module is the solution of a two-dimensional problem. The 2D heat equation is solved with both explicit and implict schemes, each time taking special care with boundary conditions. The final lesson builds solutions with a Crank-Nicolson scheme.
  5. Relax and hold steady: elliptic problems. Laplace and Poisson equations (steps 9 and 10 of “CFD Python”), seen as systems relaxing under the influence of the boundary conditions and the Laplace operator. Iterative methods for algebraic equations resulting from discretizign PDEx: Jacobi method, Gauss-Seidel and successive over-relaxation methods. Conjugate gradient methods.

Planned modules:

  • Perform like a pro: making your codes run faster Getting performance out of your numerical Python codes with just-in-time compilation, targeting GPUs with Numba and PyCUDA.
  • Boundaries take over: the boundary element method (BEM). Weak and boundary integral formulation of elliptic partial differential equations; the free space Green's function. Boundary discretization: basis functions; collocation and Galerkin systems. The BEM stiffness matrix: dense versus sparse; matrix conditioning. Solving the BEM system: singular and near-singular integrals; Gauss quadrature integration.

Sponsors

The initial deployment of the GW SEAS Open edX instance and the creation of the first course in the platform (Fall 2014) were funded with a seed grant from the GW VP for Online Education and Academic Innovation, TA support from the GW School of Engineering and Applied Sciences, and additional support from Nvidia Corp. Academic Programs and Amazon AWS (donated cloud credits for the first year).

numerical-mooc's People

Contributors

aa-savelyev avatar aitatanit avatar anushkrish avatar bknaepen avatar cdcooper84 avatar dmcdougall avatar frenchkheldar avatar gforsyth avatar ianhawke avatar isakfalk avatar josephcslater avatar ketch avatar labarba avatar mesnardo avatar mghadam avatar mglerner avatar morrill avatar ncclementi avatar piyueh avatar rbonvall avatar tingyu66 avatar yurlungur avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

numerical-mooc's Issues

uniform library imports

Hi all,

I'd like to suggest, as per the Google Python Style Guide that we not use

import numpy as np

and instead just

import numpy

Also per the style guide,

import matplotlib.pyplot as plt

is totally fine, as that's preposterously long to write out each time, but I do think it helps people better understand the libraries they're using (as they start out) to have to call them explicitly, just as we're doing with sympy in the first notebook.

I know the import numpy as np is a convention, but it's a bad convention.

A suggestion for module 2 lesson 4

In the jupyter notebook file here, the script is using numpy.pi in In [8], which will return a 6.28 for two pi.

In this case, I would suggest using sympy.pi instead, which would be neater, and it will do the same work with numpy.pi.

CFL number defined without u_max

Sets a trap for the students -- needs to be changed in all notebooks (after explanation in notebook 1 "Beware the CFL") in module 3

Two suggestions about Badges

Hello

I've finished all the modules and claimed for the badges. I have two suggestions:

First, It'd be a great idea to have an overall badge entitled "Numerical Mooc" issued for the users who have passed all the modules.

Second, the badges verification system is currently running on port 5000 (openedx.seas.gwu.edu:5000) which might be blocked by some university firewalls. It's possible to use rewrite rules to serve the badges over the standard port (e.g. openedx.seas.gwu.edu/badges/).

Thank you for this great work
Hope to see CFD-Mooc (FVM, FEM and CVFEM) soon

[Module 5, Lesson 4] Mismatch between mathematical equation and implementation

Notebook: Lesson 4 of Module 5.

Problem: In the section "More difficult Poisson problems", there is a mismatch in the last of the source term between the mathematical equation (with cos) and the Python implementation (with sin).

Solution: We need to fix the last term of the Python implementation (sin -> cos).

Reword section on SymPy root finding in Module 3 Lesson 3

It seems that the roots are returned in a non-deterministic order -- either this is a machine-by-machine thing or has to do with recent changes before SymPy 1.0.

Not a huge deal, but to avoid confusion, we should rewrite that section a bit and then automatically choose the positive root.

[Module 5—Lesson 1] Fix L2-norm equations

Use something like

$$ \begin{equation} \parallel \mathbf{p}^{k+1} - \mathbf{p}^k \parallel_{L_2} = \sqrt{\sum_{i, j} \big| p_{ij}^{k+1} - p_{ij}^k \big|^2} \end{equation} $$

l2_norm

and for the relative L2 norm:

$$ \begin{equation} \frac{\parallel \mathbf{p}^{k+1} - \mathbf{p}^k \parallel_{L_2}}{\parallel \mathbf{p}^k \parallel_{L_2}} = \frac{\sqrt{\sum_{i, j} \big| p_{ij}^{k+1} - p_{ij}^k \big|^2}}{\sqrt{\sum_{i, j} \big| p_{ij}^k \big|^2}} \end{equation} $$

relative_l2_norm

Develop a new module on Monte Carlo methods

In email conversation, @bknaepen said his curriculum included Monte Carlo, a topic we've not covered in numerical-mooc. Recently, I talked with @afeiguin (Adrian) who teaches a computational physics course at Northeastern University:
http://www.northeastern.edu/afeiguin/phys5870/

I introduced Adrian to Jupyter and he is enthusiastic about adopting Python for his course. We have an opportunity here to collaborate in the development of a new module on Monte Carlo methods — @IanHawke was also interested, and he's got some Python code for one of the NGCM modules.

Let's start a discussion here about how a module on MC might look like and how to pull our resources together to make it happen!

Module 1 coding assignment (Rocket flight) issue

Hello,

I have developed the code for the assignment. I think there are several parts that are ambiguous:
1- It is not clear from the figure that what is the propellant burn rate at t=5. Is it 20 or 0?
2- When using Euler method, f(u) has to be evaluated at t=n (and not t=n+1 or n+1/2).Is it right?
3- Using the dt=0.1 of the assignment, there is no discrete point with h=0 to find when the rocket impacted the ground. Shall I use linear interpolation to find associated time and velocity of h=0 point?

I got the following results by assuming mdot=20 at t=5 and evaluate f(u) at t=n

Vmax is: 237.2
t @ Vmax is: 5.1
h @ Vmax is: 546.73
hmax is: 1372.04
t @ hmax is: 15.9

but the system doesn't approve them.

Thanks

Update your remote

I've just pushed the master branch from the private repo to here. To start using this repo, you'll want to do something like:

git remote rename origin old
git remote add origin [email protected]:numerical-mooc/numerical-mooc.git

Once everybody is comfortably set up with the new repo, I'll close this.

02_01_1DConvection: round-off

The third python cell of the above notebook reads:

u = numpy.ones(nx) #numpy function ones()
u[.5/dx : 1/dx+1]=2 #setting u = 2 between 0.5 and 1 as per our I.C.s

print(u)

Is it safe to assume that .5/dx and 1/dx + 1 will always convert to the intended integer values? Isn't it better to call the round function to make sure as in?


u = numpy.ones(nx) #numpy function ones()
start = round(.5/dx)
end = round(1/dx)
u[start : end +1] = 2 #setting u = 2 between 0.5 and 1 as per our I.C.s

print(u)

Cheers,
Bernard.

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.