The main loop was next. I was able to loop through all 10 iterations without any problems because I took my time on that first iteration. I printed out the results and it matched the output from the example in the book. All that took about 4 hours. It is tough to translate from a math book to a computer program, but I guess with practice one probably gets faster at it.
After that I wrapped the code in a C object and created an interface to the function. I followed the same interface as the Runge-Kutta module I previously did.
After that I wrapped the code in a C object and created an interface to the function. I followed the same interface as the Runge-Kutta module I previously did.
I solved a homework problem as well, and print out the results from the actual function.
The source code:
As I find problems in the code I will update the git repository.
Left to do:
This solves a specific order (order 2) of higher order problems. To be truly general this should be made into a general function where you can add a function and matching initial values one at a time, then tell it solve all the levels, no matter how wide.
In that case this should solve when you tell it to print or try to pull out a value from the solved array. It should not allocate the arrays for the work or the temp k values until you know how level of order you need.
Left to do:
This solves a specific order (order 2) of higher order problems. To be truly general this should be made into a general function where you can add a function and matching initial values one at a time, then tell it solve all the levels, no matter how wide.
In that case this should solve when you tell it to print or try to pull out a value from the solved array. It should not allocate the arrays for the work or the temp k values until you know how level of order you need.
No comments:
Post a Comment