Institute of Earth Sciences Coders

Let's code!



Introduction to Genetics Algorithm (GA) (Part 2)

To find a basic introduction of GA, the first part can be found here. III. Examples using Genetics Algorithm In these examples, we will use Matlab and its function ga to apply GA for the optimization problem. For the manual... Continue Reading →

Introduction to Genetics Algorithm (GA) (Part 1)

I. Introduction In daily life as well as in doing research, we might come to problems that require a lowest/highest value of variables, e.g.:  find the shortest way from home to work, buying household items with a fixed amount of money,... Continue Reading →

Best-fit quadratic surface from given points in 3D using Matlab

In Earth Science research, sometimes we need to construct 3D surfaces from given points, for example: creating the fault surface, locating a subducting slab from earthquake hypocenters, etc.  in a region of interest in X-Y plane. In this example, we... Continue Reading →

Simple 1D velocity model inversion from P arrival time

Refer to Chapter 5, Introduction to Seismology, Shearer 2009. Problem: From the P-wave travel time data below (note that the reduction velocity of 8km/s), inverse for the 1D velocity model using T(X) curve fitting (fit the T(X) curve with lines,... Continue Reading →

Ray tracing through a 1-D velocity model

Refer to Chapter 4 of Shearer, Introduction to Seismology. For a ray piercing through Earth, the ray parameter (or horizontal slowness) p is defined by several expressions: where u = 1/v is the slowness, θ is the ray incidence angle, T is... Continue Reading →

Modeling a wave on a string using finite differences

Based on problem 3.7 chapter 3 of Introduction to Seismology (Shearer) (COMPUTER) In the case of plane-wave propagation in the x direction within a uniform medium, the homogeneous momentum equation (3.9) for shear waves can be expressed as ,where u... Continue Reading →

Introduction to Python Part II

I. Type of objects in Python: In Python, every object has its own class - or type of data. The in-depth tutorial can be found on the web, for example, In this tutorial, I will introduce some basic type... Continue Reading →

Introduction to Python (Part I)

Python is a high-level, general-purpose, interpreted programming language. It can be used to do some different purpose: from managing large data, simple to complex calculations to very specific objectives by using the pre-written packages. There are 2 most common used versions... Continue Reading →

Tool to download large HTML file

Sometimes when you need to download catalog data using a web browser (Chrome, Firefox, etc.), it will take some time and might cause crash or lag. Here is some ways to do it: I. Using wget + Install if you do not... Continue Reading →

Powered by

Up ↑