Professional Documents
Culture Documents
Process Simulation, Optimisation and Design
Process Simulation, Optimisation and Design
Process Simulation, Optimisation and Design
and design
P.S.O.D.
ORGANIZATION ISSUES
Course scope
Introduction
MathCAD
Introduction to CAPE
Simple simulation of heat exchange process
using common software
ChemCAD (by dr Robert Kubica)
Process simulation, optimisation
and design
Course objectives
Provide the students with:
– using specialized software for mathematical
problems solution
– clear understanding of what is a process
simulation, a process optimization and process
design
– using commonly available software to solve
simulation problems
– using specialized software for process simulation
Lectures are available on the web
address
www.chemia.polsl.pl/~jkocurek/Studenci.html
Introduction
All the simulation related issues
requires
A Model, what is it?
Manually
– We need:
» Knowledge
» Paper and pen
» Log tables, slide rule, calculator
Computer supported calculation
– We need:
» Knowledge
» PROGRAM
COMPUTER PROGRAM
DEFINITION
„Set of instructions in a logical sequence
interpreted and executed by a computer enabling
the computer to perform a required function;
also called software. Programs are the "thought
processes" of computers, without which they
cannot operate. Programs are written in various
languages, to conform with the operating system
of particular computers.”
Computer supported calculation
PROGRAM
– Written by user, using programming language:
» Low level (assembler)
» High level (C, Pascal, Fortran, Basic)
– Written by user, using common applications for
calculation
» Spreadsheets (Excel, Calc)
» Mathematical tools (MathLab, MathCAD)
– Specialized software for modeling and process
simulation (AspenOne, ProSIM, ChemCAD)
MathCAD
1.23·104
Variables notation
– Latin and Greek alphabet ( [ctrl] + [g] after
typing Latin letter)
– Case sensitivity: xX
– Subscripts (not vector/matrix subscripts) [.]
– Prim: x`, bis: x`` etc.
MathCAD intro
Assigning values and expressions (Pascal
like)
– One value assigned to one variable:
x:=5
keys: [x][:][5]
– Range of arithmetic progression assigned to
variable
» Default step: x:=0..3 (means numbers 0, 1, 2, 3)
keys [x][:][0][;][3]
» Defined step: x:=0,2..6 (means numbers 0, 2, 4, 6)
keys [x][:][0][,][2][;][6]
Has to be defined earlier
– Expression to variable:
y:=2·x+3
keys: [y][:][2][*][x][+][3]
MathCAD intro
Correct Incorrect
MathCAD intro
The expressions edition
– To change the position of edited place press
space bar
Global variable
Local variable
MathCAD functions
Range of arithmetic sequence (or vector)
MathCAD functions
Graphs:
– Function of one variable f(x)
keys: [f][(][x][)][shift]+[2][x]
MathCAD functions
Graphs:
– Default independent values range: -10 ÷ 10
– Can be edited
MathCAD functions
Graphs:
– Several functions of one independent variable range: f(x), g(x)@x
keys: [f][(][x][)][,] [g][(][x][)][shift]+[2][x]
MathCAD functions
Graphs:
– Several functions of several different independent variable range:
f(x), g(z)@x, z
keys: [f][(][x][)][,] [g][(][z][)][shift]+[2][x][,][z]
MathCAD functions
Graphs formatting:
MathCAD functions
Graphs formatting:
MathCAD functions
MathCAD functions
Show markers enabled
MathCAD – vectors and matrix
Matrix variable definition
vector – one column matrix
MathCAD – vectors and matrix
MathCAD – vectors and matrix
Matrix operations
– Multiply by constant
– Matrix transpose [ctrl]+[1]
– Inverse [^][-][1]
– Matrix multiplying
– Determinant
MathCAD – vectors and matrix
RESTICTION:
function arguments
have to bee integer
type
MathCAD 3D graphs
3D Graphs of function of real type
arguments
– Using procedure: CreateMesh(function,
lb_v1, ub_v1, lb_v2, ub_v2, v1grid, v2grid)
– Assign result to variable
– Plot of the variable like plot of matrix
([ctrl]+[2])
Contours colour
filled
MathCAD 3D graphs – formatting: line options
MathCAD 3D graphs – formatting: Lighting
MathCAD 3D graphs – formatting: Fog and
perspective
MathCAD 3D graphs – formatting: Backplane and
Grids
Predefined constants
or
MathCAD equation solving
Single equation (one unknown value)
2. Root procedure
methods:
1. Secant method
2. Mueller method
y1
x2 x3
x4 x2 y 2
y 2 y3
x2 x3 x5
x4
y3 x1
y2
xi 1 xi
xi 1 xi 1 yi 1
yi 1 yi
MathCAD equation solving
Single equation (one unknown value)
3. Special procedure: polyroots for the
polynomials. Argument of procedure is a
vector of polynomial coefficients (a0, a1...).
The result is a vector too.
Methods:
1. Laguerre's method
2. companion matrix
MathCAD, the system of equations solving
K
1
k1 2k2 k3 k4
6
yi 1 yi K O h 5
MathCAD differential equations
Single, first order differential equation
dy Initial
f ( x, y ) x x0 , y x x0 y0
dx condition
dy1 f x, y , y y1xx0 y 0
dx 0 1 1
y1xx0 y10
MathCAD differential equations
Single second order equation
x x0 , y x x0 y0
dy
2
d y Initial
f x, y , dy
dx 2
dx condition y0
dx x x0