Year: 2014

Merry Christmas

Tagged with: ,

Fortran Build Tools

Let’s face it, make is terrible.  It is especially terrible for large modern Fortran projects, which can have complex source file interdependencies due to the use of modules.  To use make with modern Fortran, you need an additional tool to generate the

Tagged with: , , , ,

Speeding up SPICE

The SPICE Toolkit software is an excellent package of very well-written and well-documented routines for a variety of astrodynamics applications.  It is produced by NASA’s Navigation and Ancillary Information Facility (NAIF).  Versions are available for Fortran 77, C, IDL, and Matlab. To speed up

Tagged with: , ,

Rocket Equation

The rocket equation describes the basic principles of a rocket in the absence of external forces.  Various forms of this equation relate the following fundamental parameters: engine thrust (), the engine specific impulse (), the engine exhaust velocity (), the initial mass

Tagged with: , ,

Porkchop Plots

A porkchop plot is a data visualization tool used in interplanetary mission design which displays contours of various quantities as a function of departure and arrival date.  Example pork chop plots for 2016 Earth-Mars transfers are shown here.  The x-axis is the Earth departure

Tagged with: , , ,

Complex Step Differentiation

Complex step differentiation is a method for estimating the derivative of a function  using the equation: Unlike finite-difference formulas, the complex-step formula does not suffer from roundoff errors due to subtraction, so a very small value of the step size can be

Tagged with: , ,

Lambert’s Problem

Lambert’s problem is to solve for the orbit transfer that connects two position vectors in a given time of flight.  It is one of the basic problems of orbital mechanics, and was solved by Swiss mathematician Johann Heinrich Lambert. A standard

Tagged with: , ,

Fortran & C Interoperability

The ISO_C_BINDING intrinsic module and the BIND attribute introduced in Fortran 2003 are very handy for producing standard and portable Fortran code that interacts with C code. The example given here shows how to use the popen, fgets, and pclose routines

Tagged with: , ,

Midpoint Circle Algorithm

The Midpoint circle algorithm is a clever and efficient way of drawing a circle using only addition, subtraction, and bit shifts.  It is based on the Bresenham line algorithm developed by Jack Bresenham in 1962 at IBM. The algorithm was also independently discovered by

Tagged with: , , ,

Python Fortran Rosetta Stone has a nice page showing side-by-side comparisons of the same code in both NumPy and Fortran.  Aside from a few weird quirks (see the array slice examples), Python code should be easily understandable by a Fortran programmer.

Tagged with: ,