Although Mathematica has many fundamentally important uses, I want to demonstrate one of the more versatile features of the complete system - using Mathematica as a C.A.S.E. development tool. To do this, I will use a classical principal from physics.
Suppose that we start with Newton's second law of motion, which states that the acceleration "a" of an object is proportional to the force "F" exerted on it. This law is usually expressed in equation form as
If we define the forcing function "F(t)" and assign a value to the rest mass "m", then we will have a second order ordinary differential equation to solve. The general theory of equations like this states that if "F(t)" is continuous on some interval, say [a,b], then there exists a unique solution to this differential equation for any numbers r and s, with the initial position x(a) = r and the initial velocity x'(a) = s.
Using the package defined below, we will produce a complete C program containing this solution. The source file will be called "test.c" and it will contain one C function, called "main()", which will compute specific values of the solution to the above differential equation.
:[font = input; preserveAspect; ]
BuildCRoutine["test.c","main()",cfunction];
:[font = text; inactive; preserveAspect; ]
Mathematica allows you to escape (!) to the unix shell and execute some unix commands and it has a special escape (!!) for displaying files, so let's display the C routine we just defined.