2-Input-2-Output Fuzzy Logic Based Hemodynamic Controller Incorporate in a Non-Linear Canine Circulatory System Model Non-Linear Circulatory Model originally developed by Clement Yu Fuzzy-Logic Based Controller by Claudio Held Pascal-to-C Translation by Johnnie Huang Created on Nov. 3, 1994 Last Revised on Feb. 8, 1995 Please address all correspondences to: Dr. Howard Kaufman Department of Electrical, Computer, and System Engineering Rensselaer Polytechnic Institute Troy, NY 12180 USA kaufmh@rpi.edu Dr. Rob J. Roy Department of Biomedical Engineering Rensselaer Polytechnic Institute Troy, NY 12180 USA royr@rpi.edu This is document accompanies the controller and the model program which can be FTPed from the following site: ftp.rpi.edu/pub/biomed/fuzmodel.zip or download via hypertext transfer protocol from: http://www.eng.rpi.edu:80/dept/biomed/WWW/roy_sftwr.html For any inquries concerning this model or the embedded fuzzy controller, please contact: huangj5@rpi.edu haha1234@aol.com For information on customization of this program for testing other prototype hemodynamic controller, please refer to CUSTOM.TXT text file included with this program. This text file contains the specifications and descriptions on compiling and executing this program. --------- RUNNING THE PROGRAM- This program may be compiled with any ANSI C compiler. When compiled on an UNIX system, use the following command: gcc -lm simulate.c -osimulate.exe USER PROMPTS- The program will ask the user for several inputs: 1: Enter filename for initializing circulatory values [*.nlm]: Enter: The filename for one of the accompanied circulatory parameters data files. These files have extension, *.nlm Example: Type 'new70.nlm' 2: Enter filename for initializing control values [*.fuz]: Enter: The filename for one of the accompanied controller parameters. These files have extension, *.fuz Example: Type 'c5_35.fuz' 3: Enter data file name ('temp' for default): Enter: A filename which the output data will be dumped for analysis. Default will be tempfile. Example: Type 'collect.dat' Note- If a "Segmentation fault" error occurs, please check if all the parameter files are in the same directory. Also note that the program may be case sensitive (depending on your system). DISPLAYED DATA- The program will start running as soon as all the parameters are entered correctly. Each row displayed represents one controller intervention. The first column of the data represents the simulated time in minutes. The second and third columns of the data represent the mean arterial pressure (MAP) and cardiac output (CO). The last two columns are the infusion rates in ug/kg/min for sodium nitroprusside (SNP) and dopamine (DPM) as set by the controller. CONFIGURING THE PROGRAM- There are several parameters that can be modified in the codes for further testing of the model and the controller when needed. The default duration of the simulation is 20 minutes. This value can be modified at line#153 The circulatory model values can be modified. These are declared early in the program. However, modifying these values may cause serious changes to the entire model. A Gaussian White Noise may be added to the simulation. This can be accomplished by removing the remark signs at line#575-581 line#677-698 line#728-739 line#1465-1471 These lines include a 4th order Hamming Window which will filter the noisy inputs to the controller. The circulatory parameters which have the extension of *.nlm represent different states in the model. The file NEW70.NLM represents a healthy dog with 100% heart contractility, with no congested heart failure (CHF). Any values below 70 represents a diminished value for the heart contractility thus indicating the occurance of CHF. For example, NEW15.NLM represents 15/70*100%=21.4% of normal contractility. There is only one controller parameter set, C5_35.FUZ included with this demo packge. CUSTOMIZATION- To further customize the program, please refer to the attached CUSTOM.TXT text file for more information. NOTICE: All floating-point variables in the program are declared using the delcarator: LONG DOUBLE. This will allow more digits to be computed in order to achieve a higher precision. However, some compilers will not allow so much memory be allocated to variable delcarations. Therefore, you may changed LONG DOUBLE to FLOAT and %lf to %f. The changes will not cause great differences in the overall performances. ---------------- REFERENCES on the Non-Linear Model and/or the Fuzzy Logic Controller: Gopinath R, Bequette BW, Kaufman H, Held CM, Huang JW, Roy RJ. "Drug Delivery Control System Challenge", Proc. of IEEE Conf. on Decision and Control, 1995. Held CM, Roy RJ, "Multiple Drug Hemodynamic Control by Means of a S upervisory-Fuzzy Rule Based Adaptive Control System: Validation on a Model," IEEE Trans. Biomed. Eng., April 1995, pp371-385 Yu C, Roy RJ, Kaufman H. "A Circulatory Model for Combined Nitroprusside- Dopamine Therapy", Medical Progress Through Technology, 16:77-88, Kluwer Academic Publishing,1990