Monday, March 24, 2014

N order systems of equations.

I updated my previous 2 order problem solver and 1 order problem solver to work with N order systems of equations, where N > 0 and < 100.  At N = 1 you are doing Runge-Kutta order 4 estimation.

You just have to set up all the equations and then pass them in along with an initial value for each one.  Your functions will be passed an array of long doubles in u[] from 0 to n-1.

Source code is here:
https://github.com/BuckRogers1965/Examples/blob/master/Math/NumericAnalysis/SysEqNOrderTest.c
https://github.com/BuckRogers1965/Examples/blob/master/Math/NumericAnalysis/SysEqNOrder.h
https://github.com/BuckRogers1965/Examples/blob/master/Math/NumericAnalysis/SysEqNOrder.c

First you create an object, setting it's start, end, steps per unit, and title.
Next you add Orders one at a time, with the initial value and function to use at that order.
One all the orders are entered, call the  calculate function to generate the results.
Then call the print function to output the results.
There are also methods to get the results programatically.
Finally dispose of the object and you are done.

Thinking about adding an actual result function that, if present, will print out with the results as the first column.

No comments:

Post a Comment