MATLAB & Simulink



The following are some of the models that I have developed and solved using MATLAB & Simulink.

MATLAB - MATLAB for Chemical Engineering

Examples from Chemical Reaction Engineering
1 Solving simultaneous differential equations:
tworxns.m; tworxns.mat
2Dynamics of Semibatch Reactor:
semibatch.m
3Dynamics of CSTR:
cstrrxns.m; cstrrxns.mat
Examples from Chemical Engineering Thermodynamics
4 Using two dimensional interpolation function 'interp2' to find Compressibility Factor(Z) of a gas
Zvalue.m; CompressFactor.mat
5Volume of Nonideal gases from Various equations of State:
assign1.m; pvt_data.mat; v_vander.m; v_redlich.m; Z.m; pvt_result.mat; pvt_result.dat
6Bubble point & Dew point calculautions:
sat_pr_antoine.m - Vapor pressure from Antoine equation
sat_temp_antoine.m - Saturation temperature from Antoine equation
BUBL_P.m - Bubble point vapor composition and Pressure
BUBL_T.m - Bubble point vapor composition and Temperature
DEW_P.m - Dew point liquid composition and Pressure
DEW_T.m - Dew point liquid composition and Temperature

Simulink

View SnapshotDownload Simulink .mdl file

Laplace Domain Dynamics:

Second order Transfer function - Step change in set pointSecondOdrTransferFunction.mdl
Feedback control of two first order in seriesFeedbackControl.mdl
PID controllerPID_Controller.mdl
PID controller - Step change in set pointPID_StepChangeInSetPoint.mdl
PID controller - Step change in load - 1PID_StepChangeInLoad_1.mdl
PID controller - Step change in load - 2PID_StepChangeInLoad_2.mdl

Time Domain Dynamics:

Solution to First order ODEFirstOrderODE.mdl
Liquid level DynamicsLiquidLevelDynamics.mdl
Solution to Two first order Equations - 1TwoFirstOrderODE_1.mdl
Solution to Two first order Equations - 2TwoFirstOrderODE_2.mdl
Solution to Second order ODE - 1SolutionToSecondOrderODE_1.mdl
Solution to Second order ODE - 2SolutionToSecondOrderODE_2.mdl
Feedback Control of tank levelTimeDomain_ControlofTankLevel.mdl
Impulse input to two non-interacting tanks in seriesTwoTanksInSeriesImpulseInput.mdl
Soltion to Simultaneous non-linear equations
Concentration of A, B, C & D in a CSTRNonLinearEquations.mdl
simult.mat - this is the data file having the rate constants and initial conditions.
Bubble point & Dew point Calculations
Vapor Pressure from Antoine Equation ConstantsVapPress.mdl
Saturation Temperature from Antoine Equation ConstantsSat_Temp.mdl
Dew Pressure and CompositionDEW_PX.mdl
Bubbl Pressure and CompositionBUBL_PY.mdl

Instructions for using these files (for the beginners):

  • If these files are opened as text files by your browser, just save them as .mdl files.

  • Using Simulink you can open the files, and run the simulation to get the results.

  • The results are in the form of either display in scope or as output to a .mat file.

  • In case of scope output just doubleclick the scope-icon to get the graphical output.

  • In case of .mat file output, from Matlab command prompt, issue the command load filename and then type the variable name to get the output. These variable name is obtained by seeing the paramaters in the .mat file.