Engr 0012 (04-1) LecNotes 01-01 Engineering 0012 Introduction to Engineering Computing Dr. Patzer...

19
ngr 0012 (04-1) LecNotes 01-01 Engineering 0012 ntroduction to Engineering Computin Dr. Patzer B68D Benedum Hall Office: 412.624.9819 e-mail: [email protected] web page: www.pitt.edu/~patzer/ Office Hours: M 11-1 W 11-12 by appointment

description

Engr 0012 (04-1) LecNotes BSD 1-Compartment Model

Transcript of Engr 0012 (04-1) LecNotes 01-01 Engineering 0012 Introduction to Engineering Computing Dr. Patzer...

Page 1: Engr 0012 (04-1) LecNotes 01-01 Engineering 0012 Introduction to Engineering Computing Dr. Patzer B68D Benedum Hall Office: 412.624.9819

Engr 0012 (04-1) LecNotes 01-01

Engineering 0012Introduction to Engineering Computing

Dr. PatzerB68D Benedum HallOffice: 412.624.9819e-mail: [email protected] page: www.pitt.edu/~patzer/

Office Hours: M 11-1 W 11-12 by appointment

Page 2: Engr 0012 (04-1) LecNotes 01-01 Engineering 0012 Introduction to Engineering Computing Dr. Patzer B68D Benedum Hall Office: 412.624.9819

Engr 0012 (04-1) LecNotes 01-02

+

BoundSolute

Binder Solute

MATLAB - Bound Solute Dialysis

))(()(

SA

SAB CC

CK

Equilibrium Binding Coefficient

Page 3: Engr 0012 (04-1) LecNotes 01-01 Engineering 0012 Introduction to Engineering Computing Dr. Patzer B68D Benedum Hall Office: 412.624.9819

Engr 0012 (04-1) LecNotes 01-03

BSD 1-Compartment Model

SingleCompartment

(patient)

V, [(CS)t]res[(CA)t]res

Qb , [(CS)t]res

Qb , [(CS)t]out

Dia

lyze

r

Dialysate in

Dialysate out

SingleCompartment

(patient)

V, [(CS)t]res[(CA)t]res

Qb , [(CS)t]res

Qb , [(CS)t]out

Dia

lyze

rD

ialy

zer

Dialysate in

Dialysate out

Page 4: Engr 0012 (04-1) LecNotes 01-01 Engineering 0012 Introduction to Engineering Computing Dr. Patzer B68D Benedum Hall Office: 412.624.9819

Engr 0012 (04-1) LecNotes 01-04

Dialyzer operationBlood Flow

Dialysate Flow

Page 5: Engr 0012 (04-1) LecNotes 01-01 Engineering 0012 Introduction to Engineering Computing Dr. Patzer B68D Benedum Hall Office: 412.624.9819

Engr 0012 (04-1) LecNotes 01-05

Dialyzer operation - C drives fluxBlood Flow

Dialysate Flow

Page 6: Engr 0012 (04-1) LecNotes 01-01 Engineering 0012 Introduction to Engineering Computing Dr. Patzer B68D Benedum Hall Office: 412.624.9819

Engr 0012 (04-1) LecNotes 01-06

Dialyzer operation - add binder to dialysateBlood Flow

Dialysate Flow

Page 7: Engr 0012 (04-1) LecNotes 01-01 Engineering 0012 Introduction to Engineering Computing Dr. Patzer B68D Benedum Hall Office: 412.624.9819

Engr 0012 (04-1) LecNotes 01-07

Dialyzer operation - add binder to dialysateBlood Flow

Dialysate Flow

Page 8: Engr 0012 (04-1) LecNotes 01-01 Engineering 0012 Introduction to Engineering Computing Dr. Patzer B68D Benedum Hall Office: 412.624.9819

Engr 0012 (04-1) LecNotes 01-08

BSD equations

1

)~()~(

11])~()~[(~)~(

bSCSdSbS

bS

CddCC

zdCd

Dialyzer - blood side

Dialyzer - dialysate side1

)~()~(

1])~()~[(~)~(

dSCSbSdS

dS

CddCC

zdCd

Patientres

tS

rest

S CFtd

Cd])ˆ[(ˆ

])ˆ[(

Page 9: Engr 0012 (04-1) LecNotes 01-01 Engineering 0012 Introduction to Engineering Computing Dr. Patzer B68D Benedum Hall Office: 412.624.9819

Engr 0012 (04-1) LecNotes 01-09

BSD Clearance Results

0.4

0.5

0.6

0.7

0.8

0.9

1.0

0 500 1000 1500 2000Dimensionless Time, (tQb/V)

Dim

ensi

onle

ss R

eser

voir

Conc

entr

atio

n and and

and

Page 10: Engr 0012 (04-1) LecNotes 01-01 Engineering 0012 Introduction to Engineering Computing Dr. Patzer B68D Benedum Hall Office: 412.624.9819

Engr 0012 (04-1) LecNotes 01-10

BSD Experimental Results (no binder)

0.4

0.5

0.6

0.7

0.8

0.9

1.0

0 50 100 150 200 250 300 350

Time, min

Frac

tiona

l Res

ervo

ir Co

ncen

trat

ion

1.0, +

0.5, +

0.5, -

1.0, -

center pt.

Page 11: Engr 0012 (04-1) LecNotes 01-01 Engineering 0012 Introduction to Engineering Computing Dr. Patzer B68D Benedum Hall Office: 412.624.9819

Engr 0012 (04-1) LecNotes 01-11

BSD Experimental Results (with binder)

0.4

0.5

0.6

0.7

0.8

0.9

1.0

0 50 100 150 200 250 300 350

Time, min

Frac

tiona

l Res

ervo

ir Co

ncen

trat

ion E1

E2E3E4E5E6E7E8E9E10E11E12E13E14E15

= 0.1-0.3

Page 12: Engr 0012 (04-1) LecNotes 01-01 Engineering 0012 Introduction to Engineering Computing Dr. Patzer B68D Benedum Hall Office: 412.624.9819

Engr 0012 (04-1) LecNotes 01-12

Introduction to MATLAB

Double click on icon to launchSet Current Directory

C:\temp or C:\user in Freshman Computer LabsThis is where MATLAB will send output and is the first place MATLAB will look for scripts and functions that you write

Page 13: Engr 0012 (04-1) LecNotes 01-01 Engineering 0012 Introduction to Engineering Computing Dr. Patzer B68D Benedum Hall Office: 412.624.9819

Engr 0012 (04-1) LecNotes 01-13

Introduction to MATLAB

Variable names / numbers» alpha = 7

» beta = 7.0beta = 7

differentalpha = 7

same

Page 14: Engr 0012 (04-1) LecNotes 01-01 Engineering 0012 Introduction to Engineering Computing Dr. Patzer B68D Benedum Hall Office: 412.624.9819

Engr 0012 (04-1) LecNotes 01-14

Introduction to MATLAB

MATLAB treats all numbers the sametype double precision imaginary

real + imaginary part ~ 18 significant figures

» gamma = sqrt(2)gamma = 1.1412» delta = sqrt(-gamma)delta = 0 + 1.1892i

Page 15: Engr 0012 (04-1) LecNotes 01-01 Engineering 0012 Introduction to Engineering Computing Dr. Patzer B68D Benedum Hall Office: 412.624.9819

Engr 0012 (04-1) LecNotes 01-15

Introduction to MATLABControlling display of significant figures

» alpha = pi

» format long» alpha

alpha = 3.1416

alpha = 3.14159265358979

» format short e» alphaalpha = 3.1416e+000

default: format short4 decimal places, rounded

displays 14 decimal places may be in scientific notation

» format long e» alphaalpha = 3.141592653589793e+000

displays 5 significant digits displays 16 significant digits

Page 16: Engr 0012 (04-1) LecNotes 01-01 Engineering 0012 Introduction to Engineering Computing Dr. Patzer B68D Benedum Hall Office: 412.624.9819

Engr 0012 (04-1) LecNotes 01-16

Introduction to MATLABRecap on what we know

variables declared by assigning a value to a nameMATLAB treats all values as double precision imaginaryMATLAB displays integers as integersformat command can be used to control display of noninteger values

Page 17: Engr 0012 (04-1) LecNotes 01-01 Engineering 0012 Introduction to Engineering Computing Dr. Patzer B68D Benedum Hall Office: 412.624.9819

Engr 0012 (04-1) LecNotes 01-17

Using MATLAB as a calculatorCalculating sphere parameters

» % setting sphere radius» radius = 1radius = 1» % calculating sphere volume» sphere_vol = 4*pi*radius^3/3sphere_vol = 4.1888» % calculating sphere surface area» sphere_surf = 4*pi*radius^2sphere_surf = 12.5664

Page 18: Engr 0012 (04-1) LecNotes 01-01 Engineering 0012 Introduction to Engineering Computing Dr. Patzer B68D Benedum Hall Office: 412.624.9819

Engr 0012 (04-1) LecNotes 01-18

Using MATLAB as a calculator

mathematical operatorsaddition +subtraction -multiplication *division /exponentiation ^

MATLAB-defined functionssqrt() - returns value of square root pi - returns value of (= 3.14159…)

MATLAB operatorscomment %

Page 19: Engr 0012 (04-1) LecNotes 01-01 Engineering 0012 Introduction to Engineering Computing Dr. Patzer B68D Benedum Hall Office: 412.624.9819

Engr 0012 (04-1) LecNotes 01-19

Class ActivityWorkshop 01

Do Exercises 1-4 at endall parts

Turn in (at start of next class)1. b2. c3. c4. b