Department of Chemical Engineering
School of Energy Technology
Pandit Deendayal Energy University
Subject Name & Code: Process Modeling and Optimization(20CH410P)
Experiment No.: 1
Title: Reacquaint with GUI of computational software and basic computation (open source
and proprietary)
Theory:
Computational software like MATLAB offers graphical user interfaces (GUIs) to simplify
the tasks of data analysis, matrix operations, programming, visualization, and simulation.
These platforms integrate menus for file handling, workspace management, plotting, and
debugging. A clear understanding of their GUI allows users to access powerful built-in
functions, libraries, and toolboxes for varied chemical engineering applications. Both opensource (like Python, Scilab) and proprietary (like MATLAB) tools support advanced
computation and visualization, data import/export, and basic programming, enabling
chemical engineers to model processes efficiently and avoid repetitive manual calculations.
Algorithm:
1. Launch the computational software.
2. Locate the command window, editor, workspace, and plotting tools in the GUI.
3. Create a new script file.
4. Type basic operations (like addition, multiplication) and matrix creation.
5. Save and run the script; observe results in output panels.
6. Search for help/documentation on a function (e.g., “plot”).
7. Try plotting a simple graph.
8. Save your script and workspace for future use.
1
23BCH023
Department of Chemical Engineering
School of Energy Technology
Pandit Deendayal Energy University
Subject Name & Code: Process Modeling and Optimization(20CH410P)
Code:
a)Basic Matrix operations
Output
2
23BCH023
Department of Chemical Engineering
School of Energy Technology
Pandit Deendayal Energy University
Subject Name & Code: Process Modeling and Optimization(20CH410P)
b) tan plot
Output
3
23BCH023
Department of Chemical Engineering
School of Energy Technology
Pandit Deendayal Energy University
Subject Name & Code: Process Modeling and Optimization(20CH410P)
Plot
Lab assignment 1
A. Write a code to create two arrays A=[2 5 7; 9 0 8] and B=[7 55 6; 23 45 67] and
perform addition, subtraction and multiplication. Also generate a vector xε [-5pi
5pi]. The increment is pi/100. Plot graphs of sin x, cos x, tan x, cosec x, sec x, cot
x all in the same graphs. Make sure the graph types (dashed or symbols or
colours are all different for different graphs).
4
23BCH023
Department of Chemical Engineering
School of Energy Technology
Pandit Deendayal Energy University
Subject Name & Code: Process Modeling and Optimization(20CH410P)
5
23BCH023
Department of Chemical Engineering
School of Energy Technology
Pandit Deendayal Energy University
Subject Name & Code: Process Modeling and Optimization(20CH410P)
Output
Plot
6
23BCH023
Department of Chemical Engineering
School of Energy Technology
Pandit Deendayal Energy University
Subject Name & Code: Process Modeling and Optimization(20CH410P)
Conclusion
We explored the software's graphical user interface, set up script files, and successfully
executed basic arithmetic and matrix operations like addition, subtraction, and element-wise
multiplication. We also generated a vector across a defined trigonometric range and plotted
multiple functions like sine, cosine, tangent, cosecant, secant, and cotangent together on a
single graph using distinct colors, line styles, and a legend for clear visualization.
Student Declaration
I hereby declare that this report is prepared by me based on the experiment performed.
Roll no:23BCH023
Submitted to: Dr Shubhankar Roy
Date of performance: 27/07/26
Date of submission: 11/08/26
7
23BCH023
Department of Chemical Engineering
School of Energy Technology
Pandit Deendayal Energy University
Subject Name & Code: Process Modeling and Optimization(20CH410P)
Experiment No.: 2
Title: First and second order numerical differentiation of functions using forward, backward
and central FDE.
Theory:
Numerical differentiation is used to estimate derivatives of a function when only discrete data
or tabulated values are available, which is common in chemical engineering where readings
are taken at intervals. The three main approaches are:
● Forward Difference: Uses a point and its immediate next point. Suitable at the start of
a data set.
● Backward Difference: Uses a point and its previous point. Suitable at the end of a data
set.
● Central Difference: Uses points before and after, yielding better accuracy for interior
points.
These methods are widely used for analyzing rates of reaction, heat transfer rates, and other
process variables.
Algorithm:
1. Input or load vector of x values and corresponding f(x) values.
2. Compute the spacing h =𝓍₍ᵢ₊₁₎- 𝓍ᵢ
(ensure uniformity in equation).
3. For interior points, calculate:
- Forward difference: f'(𝓍ᵢ) = [f(xᵢ₊₁) - f(𝓍ᵢ)]/h
- Backward difference: f'(𝓍ᵢ) = [f(𝓍ᵢ) - f(xᵢ-₁)]/h
- Central difference: f'(𝓍ᵢ) = [f(xᵢ₊₁) - f(xᵢ-₁)]/2h
4. For second derivative (central): f''(xᵢ-₁) = [f(xᵢ₊₁) - 2f(𝓍ᵢ) + f(xᵢ-₁)]/h²
5. Store and optionally plot the derivatives as a function of x.
8
23BCH023
Department of Chemical Engineering
School of Energy Technology
Pandit Deendayal Energy University
Subject Name & Code: Process Modeling and Optimization(20CH410P)
Codes:
A)
9
23BCH023
Department of Chemical Engineering
School of Energy Technology
Pandit Deendayal Energy University
Subject Name & Code: Process Modeling and Optimization(20CH410P)
Plot:
Lab Assignment 2
A. Given f(x) = −0.1x4 − 0.15x3 − 0.5x2 − 0.25x + 1.2. Plot f, df/dx and d2f/dx2 in the range of
x ε [-20 35] using FDE. Take step size as your final two digits of roll number/100 (If your
roll number is 23BCH045, your stepsize h=0.45).
B. For same polynomial function plot analytical results of f, df/dx and d2f/dx2 and compare
with numerical solutions. Show your code and the plots.
10
23BCH023
Department of Chemical Engineering
School of Energy Technology
Pandit Deendayal Energy University
Subject Name & Code: Process Modeling and Optimization(20CH410P)
Assignment 2 codes (Part A)
Plot
11
23BCH023
Department of Chemical Engineering
School of Energy Technology
Pandit Deendayal Energy University
Subject Name & Code: Process Modeling and Optimization(20CH410P)
Part B
Plot
12
23BCH023
Department of Chemical Engineering
School of Energy Technology
Pandit Deendayal Energy University
Subject Name & Code: Process Modeling and Optimization(20CH410P)
Conclusion
We learned how to estimate first and second derivatives from discrete data points using
numerical differentiation techniques, specifically applying forward, backward, and central
finite difference equations (FDE). We also wrote scripts for a given polynomial function,
plotted its numerical derivatives alongside the original curve, and compared those results
directly with exact analytical solutions.
Student Declaration
I hereby declare that this report is prepared by me based on the experiment performed.
Roll no:23BCH023
Submitted to: Dr Shubhankar Roy
Date of performance: 27/07/26
Date of submission: 11/08/26
13
23BCH023
Department of Chemical Engineering
School of Energy Technology
Pandit Deendayal Energy University
Subject Name & Code: Process Modeling and Optimization(20CH410P)
Experiment No.: 3
Title: Curve fitting (using coding as well as toolboxes) and non-linear and polynomial
regression analysis of chemical engineering data for model development
Theory:
Curve fitting is the process of constructing a curve or mathematical function that has the best
fit to a series of data points. This is key in chemical engineering for model development,
parameter estimation, and experimental data analysis. Regression can be:
● Linear Regression: Fits a straight line, ideal for proportional relationships.
● Polynomial Regression: Fits quadratic or higher-order polynomials, used for complex
trends.
● Nonlinear Regression: Fits exponential, logarithmic, or other nonlinear models,
crucial in kinetic and thermodynamic data fitting.
A good fit minimizes the sum of squared differences between observed and predicted values.
Algorithm
1. Input x and y data vectors (experimental pairs).
2. Choose desired model (linear, nth order polynomial, or nonlinear).
3. For linear or polynomial:
●
Use least squares formula or toolbox fitting function.
4. For nonlinear:
●
●
Define the model and provide initial guess for parameters.
Use iterative minimization algorithm/toolbox to fit data.
5. Retrieve best-fit parameters; compute predicted y values.
6. Plot experimental data and fitted curve together.
7. Calculate goodness-of-fit metrics (e.g., R²).
14
23BCH023
Department of Chemical Engineering
School of Energy Technology
Pandit Deendayal Energy University
Subject Name & Code: Process Modeling and Optimization(20CH410P)
Code:
A)
15
23BCH023
Department of Chemical Engineering
School of Energy Technology
Pandit Deendayal Energy University
Subject Name & Code: Process Modeling and Optimization(20CH410P)
Output
16
23BCH023
Department of Chemical Engineering
School of Energy Technology
Pandit Deendayal Energy University
Subject Name & Code: Process Modeling and Optimization(20CH410P)
17
23BCH023
Department of Chemical Engineering
School of Energy Technology
Pandit Deendayal Energy University
Subject Name & Code: Process Modeling and Optimization(20CH410P)
Plot:
18
23BCH023
Department of Chemical Engineering
School of Energy Technology
Pandit Deendayal Energy University
Subject Name & Code: Process Modeling and Optimization(20CH410P)
B)
Output:
19
23BCH023
Department of Chemical Engineering
School of Energy Technology
Pandit Deendayal Energy University
Subject Name & Code: Process Modeling and Optimization(20CH410P)
Plot:
Lab Assignment 3:
20
23BCH023
Department of Chemical Engineering
School of Energy Technology
Pandit Deendayal Energy University
Subject Name & Code: Process Modeling and Optimization(20CH410P)
A) In an isothermal batch reactor, the liquid-phase decomposition of reactant A is
monitored over time. The percentage conversion of reactant A, denoted as X (%), is
recorded at regular time intervals t (min). The experimental dataset is given below:
Reaction Time, t (min)
Reactant Conversion, X (%)
1
15
2
28
3
40
4
50
5
58
21
23BCH023
Department of Chemical Engineering
School of Energy Technology
Pandit Deendayal Energy University
Subject Name & Code: Process Modeling and Optimization(20CH410P)
Assignment 3 Code
Part A
22
23BCH023
Department of Chemical Engineering
School of Energy Technology
Pandit Deendayal Energy University
Subject Name & Code: Process Modeling and Optimization(20CH410P)
23
23BCH023
Department of Chemical Engineering
School of Energy Technology
Pandit Deendayal Energy University
Subject Name & Code: Process Modeling and Optimization(20CH410P)
24
23BCH023
Department of Chemical Engineering
School of Energy Technology
Pandit Deendayal Energy University
Subject Name & Code: Process Modeling and Optimization(20CH410P)
Output
25
23BCH023
Department of Chemical Engineering
School of Energy Technology
Pandit Deendayal Energy University
Subject Name & Code: Process Modeling and Optimization(20CH410P)
Plot:
26
23BCH023
Department of Chemical Engineering
School of Energy Technology
Pandit Deendayal Energy University
Subject Name & Code: Process Modeling and Optimization(20CH410P)
Conclusion
We performed curve fitting and regression analysis on experimental datasets to develop
mathematical models. Using matrix formulations and least squares methods, we calculated
the parameters for both first-order linear models and second-order polynomial quadratic
models, computed conversion values and sum of squared errors (SSE), and plotted the fitted
curves against the experimental data points.
Student Declaration
I hereby declare that this report is prepared by me based on the experiment performed.
Roll no:23BCH023
Submitted to: Dr Shubhankar Roy
Date of performance: 03/08/26
Date of submission: 11/08/26
27
23BCH023