Contents    Page-10    Prev    Next    Page+10    Index   

Generating Code from Equations

The first programming language, FORTRAN, is an abbreviation for FORmula TRANslation. There is a long history of similarity between equations and programs.

Suppose that we have a set of physics equations, and we want a program to calculate a desired variable from given variable values.

Each time an equation is solved for a new variable,

If the variable that is solved for was the desired variable, cons a return statment onto the code.

At the end, reverse the code ( reverse).