PSOD - PowerPoint PPT Presentation

About This Presentation
Title:

PSOD

Description:

Title: Process Simulation Last modified by: jkocurek Document presentation format: Pokaz na ekranie Other titles: Arial Arial Unicode MS Times New Roman Wingdings ... – PowerPoint PPT presentation

Number of Views:93
Avg rating:3.0/5.0
Slides: 48
Provided by: pols152
Category:

less

Transcript and Presenter's Notes

Title: PSOD


1
PSOD
  • Lecture 2

2
(No Transcript)
3
Matrices and vectors in Chemical Process
Engineering
  • Appear in calculations when process is described
    by the system of equations
  • Piping system
  • Cascade of
  • Reactors
  • Heat exchangers
  • Mixers
  • System of apparatus and streams in chemical plant

4
Matrices in Chemical Process Engineering
  • concentrations give 4-elements vector c
  • To find solution we need system of 4 equations
  • Equation parameters creates square matrix

5
Matrices in Chemical Process Engineering
6
Matrices in Chemical Process Engineering
7
MathCAD vectors and matrix
8
MathCAD vectors and matrix
  • Matrix operations
  • Multiply by constant
  • Matrix transpose ctrl1
  • Inverse -1
  • Matrix multiplying
  • Determinant

9
MathCAD vectors and matrix
  • To read the matrix elements Ar, k key r- row
    nr, k column nr
  • e.g. element A1,1 keystrokes A1,1
  • To chose matrix column Mltcol.nrgt
  • First column A( Alt0gt)keys Actrl60
  • Default first columnrow number is 0,
  • (to change Math/Options/Array Origin)

10
MathCAD vectors and matrix
  • Calculations of dot product and cross product of
    vectors

11
MathCAD vectors and matrix
  • Special definition of matrix elements as a
    function of row-column number Mi,jf(i,j)
  • E.g. Value of element is equal to product of
    column and row number

Constrain function arguments have to be integer
12
MathCAD 3D graphs
  • 3D graphs of function on the base of matrix
    ctrl2 M
  • M matrix defined earlier

13
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 is similar to plot of matrix
    (ctrl2)

Boundaries can be the real numbers. (def. 5,5)
Grids have to be integer numbers (def. 20)
14
MathCAD 3D graphs
15
MathCAD 3D graphs - formating
16
MathCAD 3D graphs formatting fill options
17
MathCAD 3D graphs formatting fill options
Contours colour filled
18
MathCAD 3D graphs formatting line options
19
MathCAD 3D graphs formatting Lighting
20
MathCAD 3D graphs formatting Fog and
perspective
21
MathCAD 3D graphs formatting Backplane and
Grids
22
MathCAD 3D scatter graphs
  • Data given as three vectors of each point
    coordinates
  • Equal vector size
  • Button on Graph toolbar 3D Scatter Plot
  • In the placeholder type in brackets the vectors
    names separated by comas

23
Predefined constants
  • e 2,718 natural logarithm base
  • g 9,81 m/s2 acceleration of gravity
  • ? 3,142 circle perimeter/diameter ratio

24
Solving of algebraic equation
  • When equation is implicit
  • When we dont want to separate variables

25
MathCAD equation solvers
  • Single equation (one unknown value)
  • Given-Find method
  • Input start point of variable
  • Type "Given"
  • Type equation with using (ctrl)
  • Type Find(variable)

26
MathCAD equation solving
  • Given-Find solving methods
  • Linear (function of type yc0x c1) starting
    point choice do not affects on results.
  • Nonlinear according to nonlinear equation.
    Obtained result could depend on starting point.
    Available methods
  • Conjugate Gradient
  • Quasi Newton
  • Levenberg-Marquardt
  • Quadratic
  • The choice of method is automatic by default.
    User can choose method from the pop-up menu over
    word Find.

27
MathCAD equation solving
  • Single equation (one unknown value)
  • Root procedureRoot(function, variable,
    low_limit, up_limit)
  • Values of function at the bounds must have
    different signs

or
28
MathCAD equation solving
  • Single equation (one unknown value)
  • Root proceduremethods
  • Secant method
  • Mueller method (2nd order polynomial)

y1
x3
x2
x5
x4
x1
y3
y2
29
MathCAD equation solving
  • Single equation (one unknown value)
  • Special procedure polyroots for the polynomials.
    Argument of procedure is a vector of polynomial
    coefficients (a0, a1...). The result is a vector
    too.
  • Methods
  • Laguerre's method
  • companion matrix

30
Laguerre's method
Polynomial p(x) of degree n. Starting from
assumed xk.
31
MathCAD, the system of equations solving
  • The system of linear equations
  • Solving on the base of matrix toolbar
  • Prepare square matrix of equations coefficients
    (A) and vector of free terms (B)
  • Do the operation xA-1B and show result x
  • Or
  • Use the procedure LSOLVE lsolve(A,B)

32
MathCAD, the system of equations solving
33
MathCAD, the system of equations solving
  • The system of nonlinear equation
  • Can be solved using given-find method
  • Assign starting values to variables
  • Type Given
  • Type the equations using sign (bold)
  • Type Find(var1, var2,...)

34
MathCAD, the system of equations solving
35
Differential eq. Solvers in MathCAD
36
Ordinary differential equations solving
  • Numerical methods
  • Gives only values not function
  • Engineer usually needs values
  • There is no need to make complicated
    transformations (e.g. variables separation)
  • Basic method implemented in MathCAD is
    Runge-Kutta 4th order method.

37
Ordinary differential equations solving
  • Numerical methods principle
  • Calculation involve bounded range of independent
    variable only
  • Every point is being calculated on the base of
    one or few points calculated before or given
    starting points.
  • Independent variable is calculated using step
  • xi1 x i h xiDx
  • Dependent value is calculated according to the
    method

yi1 y i Dy y i Ki
38
Ordinary differential equations solving
  • Runge-Kutta 4th order method principles
  • New point of the integral is calculated on the
    base of one point (given/calculated earlier) and
    4 intermediate values

39
MathCAD differential equations
  • Single, first order differential equation
  • Assign the initial value of dependent variable
    (optionally)
  • Define the derivative function
  • Assign to the new variable the integrating
    function rkfixed
  • Rrkfixed(init_v, low_bound, up_bound, num_seg,
    function)

Initial condition
40
MathCAD, differential equations
  • Result is matrix (table) of two columns first
    contain independent values second dependent ones
  • To show result as a plot Rlt1gt_at_Rlt0gt

41
MathCAD differential equations
42
MathCAD differential equations
  • System of first order differential equations
  • Assign the vector of initial conditions of
    dependent variables (starting vector)
  • Define the vector function of derivatives
    (right-hand sides of equations)
  • Assign to the variable function rkfixed
  • Rrkfixed(init_vect, low_bound, up_bound,
    num_seg, function)

43
MathCAD differential equations
  • Result is matrix (table) of three columns first
    contain independent values, 2nd column contains
    first dependent variable values, third second
    ones
  • Results as a plot Rlt1gt,Rlt2gt_at_ Rlt0gt

44
MathCAD differential equations
45
MathCAD differential equations
  • Single second order equation
  • Transform the second order equation to the system
    of two first order equations

Initial condition
46
MathCAD differential equations
  • Example
  • Solve the second order differential equation
    (calculate values of function and its first
    derivatives) given by equation
  • While y10 and y-1 for x0
  • In the range of xlt0,1gt

47
MathCAD differential equations
Starting vector
Vectoral function
System of equations
Write a Comment
User Comments (0)
About PowerShow.com