We now begin working on the first few interactive lab programs. They will allow you to experiment with optimal control problems and see the solutions. Most of the labs are based on current applied mathematical research, dealing with an array of biological problems. The first is the problem from the preceding chapter, and the code used is exactly what we developed there. Before preceding, however, we need to clarify a few details about the programs and MATLAB. First, while MATLAB is needed to run the provided programs, it is certainly
not needed to solve optimal control problems in general. Any mathematical programming language, such as FORTRAN or C++, is capable of the calculations needed. MATLAB was chosen for this text because, in the opinion of the authors, it is easily accessible and has superior graphing tools. On that note, however, the programs used in this workbook are designed
so that no knowledge of MATLAB is required. For each problem, there is a user-friendly interface that will guide you through. Each lab consists of two different MATLAB programs, lab .m and code .m. For example, there are two programs associated with Lab 1, lab1.m and code1.m. Here, *.m is the extension given to all files intended for use in MATLAB. The file code1.m is the Runge-Kutta based, forward-backward sweep solver we built in the previous chapter. It takes as input the values of the various parameters in the problem and outputs the solution to the optimality system. The file lab1.m is the userfriendly interface. It will ask you to enter the values of the parameters one by one, compile code1.m with these values, and plot the resulting solutions. All the files must be in the directory that MATLAB treats as the home directory. This is usually the Work directory. If you have experience with MATLAB, you may wish to not use the interface
and instead use only the actual codes. They operate as standard MATLAB function files, with the parameters entered as input. This will allow you a little more freedom than the interface. However, the interface, especially when going through the labs, is very convenient and will most likely save time. If you do choose to use only the code files, you will need to run the interface a few times before starting the labs in order to see exactly what they do, so that you can emulate them on your own.