University of Tennessee
Department of Chemical Engineering



ChE 310 Library of MATLAB® Subroutines

I am a strong believer in learning by example, especially in programming. If you have an elementary program that shows the syntax for doing a job A and another elementary program that shows the syntax for doing a job B, then you have everything you need to know to write a program to do both A and B.

That is the philosophy behind providing these codes, rather than making you write them from scratch. I have written some basic subroutines (MATLAB® *.m files) and I expect you to use this library of subroutines to accomplish tasks more complicated than those explicitly done in the subroutines themselves.

Given the rapid rate at which new programs, software, and hardware are being developed, it is often the case that no manual or instruction exists. What one has to rely on is a few paltry examples posted on the web by other hardy souls braving the perils of novel and untested systems.

So, this experiment encourages you to use the examples available and requires you to be able to read, understand, and modify the code to suit your own purpose.


(These codes have been zipped with WinZip®.
You must unzip them and move them to your current working MATLAB directory in order to use them.)
  • Codes for Matlab version 6.0 (current version)
    Codes for Matlab version 5.1
    • name: sysodeNR.m
    • function: input ODE solver parameters
    • function: define initial conditions
    • function: Implements either the Classical 4rth order Runge-Kutta Method or the Euler Method
    • function: Implements iterative Non-linear rootfinding technique at each RK4 or Euler Step
    • function: Plots results
    • function: Prints tabular results to data file

    • name: sysodeNRinput.m (a sample input file)
    • function: input physical system parameters
    • function: input function form of ordinary differential equation to be solved

    • name: guess310.m
    • function: a set of RK4 parameters and initial conditions for the sample input file



back to ChE 310 Main Page
Contact:  Instructor