Progress Log

A log concerning my current projects at MSU's 2010 Solar and Space Physics REU program.


7th Week - 5th Week - 3rd Week


3rd Week

June 18, 2010
 
This week has been devoted to understanding more about certain MATLAB techniques and capabilities, including the vectorization of loops to create more efficient code, the use of the ordinary differential equation solvers such as ODE45 and ODE113, and the creation of functions that interface directly with these solvers. This overview will help me ease into the programming by identifying useful code in the original CUBESIM program and cleaning up my own code in the FIREBIRD simulator from last summer.
 
In order to better understand the high-level MATLAB code that makes use of vectorized functions, I have worked through several example problems that involve converting the slower for loops into vectorized operations. Usually, the conversion requires a good working knowledge of the vector capabilities of MATLAB (creating, modifying, sorting, and performing operations on arrays); more often than not, a conversion requires extreme ingenuity and could be time-consuming. The trade-off is usually worth the effort, as MATLAB is written to perform vector operations efficiently. Executed vectorized code can run tens to hundreds of times faster than code within loops. My aim is to be able to modify old and inefficient code, where appropriate; at the very least, I hope to better understand the way MATLAB does math.
 
In addition to this, I have looked at the ODE solvers in MATLAB. I have worked through some simple programs, and working through the forums at Matlab Central have shown me to some more complicated examples of the ODE solvers in action; I still have not been able to address some important details.
I need to fully understand the limitations of the solvers, and not blindly rely on their capabilities instead on my own coded numerical methods. I also must learn more about ODESET, which will let me call non-differential equations into the solvers and let me perform many other operations (such as calling in models for gravity, magnetics, and atmosphere).
 
The next few weeks should be focused on the physics behind advanced Earth models, and how to integrate that into a program that uses the ODE solvers and resembles my old FIREBIRD orbital simulator. Then, I will learn more about the methods to perform hysteresis stabilization calculations used in the CUBESIM program.