Solving Engineering Problems by Using Computer A Case Study on Fed-Batch Bioreactor.

25
Solving Engineering Problems by Using Computer A Case Study on Fed-Batch Bioreactor
  • date post

    19-Dec-2015
  • Category

    Documents

  • view

    230
  • download

    0

Transcript of Solving Engineering Problems by Using Computer A Case Study on Fed-Batch Bioreactor.

Solving Engineering Problems by Using Computer

A Case Study on Fed-Batch Bioreactor

Fed-Batch Bioreactor (1)

• A fed-batch reactor is a reactor that initially runs as a batch reactor, with volume V0.

• As the substrate level drops, cell growth rate and product formation rates decrease.

• A feed stream is introduced to input substrate and now it is maintained at low cell growth rate.

• As the feed stream ia introduced, the reactor volume changes from V0 to Vt with time.

Feed

V0

Vt

1

1

,

,0

ttF

ttF

2

2

,

,0

ttS

ttS

FF

Fed-Batch Reactor (2)

• Governing equations:

Specific growth rate:

Reactor volume:

Biomass:

Substrate:

Product:

tS

tt SK

S

max

tt F

dt

dV

ttttt

tt

ttt XVFX

dt

dXV

dt

dVX

dt

VXd

XS

ttFtttt

tt

tt

tt

Y

XSFVFS

dt

dSV

dt

dVS

dt

VSd ,

XS

PStttt

tt

tt

tt

Y

YXVFP

dt

dPV

dt

dVP

dt

VPd

Fed-Batch Reactor (3)

• Governing equations (cont’)

Feed rate:

Feed substrate conc.:

1

1

,

0,0

ttF

ttF

1

1

,

0,0

ttS

ttS

FF

Fed-Batch Reactor (4)

• Initial condition:

Reactor volume:

Biomass level:

Substrate conc.:

Product conc.:

00 VtV

00 XtX

00 StS

00 PtP

How to Solve It? (1)

• This is a typical differential equation problem with initial value(s).

• We can solve it by using mathematical software packages, such as Polymath, etc.

• When using the above software packages, the only requirement is to input the governing equations and they can be solved using built-in functions.

How to Solve It? (2)

• Such differential equation problems are solved by using numerical integration.

• When a differential equation is difficult or impossible to solve analytically ,use numerical integration to find approximate solutions.

How to Solve It? (3)

• There are many numerical integration methods, the simplest one is called Euler’s method.

• To integrate a differential equation from time t0 to time tfinal, this time period is divided into many small steps: h.

• E.g. • At t0, x = x0.• At (t0 + h), x = x0 + (h x slopet=0)• Repeat above steps until t = tfinal

,, xtfdt

dx

How to Solve It? (4)• E.g. Drops in reactant conc.• Smaller h will have better approximation.• But smaller h will need more computation time.

- 0. 4

- 0. 2

0

0. 2

0. 4

0. 6

0. 8

1

0 2 4 6 8 10 12 14 16

Exacth = 6h = 2h = 1

Using Polymath (1)

Using Polymath (2)

• Step functions could be done by using the IF-THEN-ELSE statement to change value of constants according to simulation time:

• F = IF ( time < 3.5 hr ) THEN (

F = 0 L/hr) ELSE (

F = 0.1 L/hr)

Feed Stream As Step Function

00.02

0.040.06

0.080.1

0.12

0 2 4 6 8 10 12

Time (hr)

Fe

ed

Str

ea

m F

low

Ra

te(L

/ h

r)

Using Polymath (3)

• The multiple steps of feed substrate concentration could be done by using multiple IF-THEN-ELSE statements:

• SFeed = IF ( time < 3.5 hr ) THEN (SFeed = 0 g/L

) ELSE (IF ( time < 5.5 hr ) THEN (SFeed = 100 g/L

) ELSE (IF ( time < 7.5 hr ) THEN (SFeed = 180 g/L

) ELSE (IF ( time < 9.5 hr ) THENSFeed = 350 g/L

) ELSE (SFeed = 600 g/L

))

))

Feed Stream As Step Function

0

100200

300

400500

600

0 2 4 6 8 10 12

Time (hr)

Fe

ed

Str

ea

m S

ub

stra

teC

on

c. (

g/L

)

Using Polymath (4)

• Advantages:– Polymath already built-in numerical integration

methods;– Users only need to input differential equations, etc.– Step functions could be input by using the IF ...

THEN ... ELSE ... statement provided by Polymath.

Using Polymath (5)• Disadvantages:

– Number of steps in step functions should be known before setting up the equations;

– The numbers of IF-THEN-ELSE statements= number of steps - 1

– If user wants to add more steps, he / she needs to modify the IF-THEN-ELSE statement, i.e. no flexibility;

– Complicated IF-THEN-ELSE statements are not easy to read when there are many steps.

– Polymath has limitation on the number of equations in a problem, for differential equation problems (Polymath version 6.10):

Version Educational Professional

Max. # of simultaneous differential equations 30 300

Max. # of simultaneous explicit equations 40 300

Max. # of intermediate data points 152 1200

Using Polymath (6)

Polymath Result

0

20

40

60

80

100

120

140

160

180

200

0 2 4 6 8 10 12

Time (hr)

Con

c. -

X, S

, P (

g / L

)

0

0.05

0.1

0.15

0.2

0.25

0.3

0.35

0.4

0.45

0.5

Spe

c. G

row

th R

ate

- μ

(hr

-1)

X S P μ

Using Excel (1)

• It is possible to set up an Excel worksheet with numerical integration methods.

• E.g. Reactor volume with feed stream:

Step Time Vol Feed

0 t0 =0

V0 IF ( ( Time < 3.5 hr ),

( F = 0 ),

( F = 0.1 ) )

1 t1 =t0 + h

V1 =V0 + F x h

IF ( ( Time < 3.5 hr ),

( F = 0 ),

( F = 0.1 ) )

2 t2 =t1 + h

V2 =V1 + F x h

IF ( ( Time < 3.5 hr ),

( F = 0 ),

( F = 0.1 ) )

3 t3 =t2 + h

V3 =V2 + F x h

IF ( ( Time < 3.5 hr ),

( F = 0 ),

( F = 0.1 ) )

4 t4 =t3 + h

V4 =V3 + F x h

IF ( ( Time < 3.5 hr ),

( F = 0 ),

( F = 0.1 ) )

Using Excel (2)

• Costs:– Users need to set up their own numerical

integration.

• Advantages:– Possible to perform numerical integration when no

mathematical software package is available.

• Disadvantages:– The same style to input step functions as using

Polymath, i.e. no flexibility.

Using Excel (3)

Excel Equation Result

0

20

40

60

80

100

120

140

160

180

200

0 2 4 6 8 10 12

Time (hr)

Co

nc.

- X

, S, P

(g

/ L

)

0

0.05

0.1

0.15

0.2

0.25

0.3

0.35

0.4

0.45

0.5

Sp

ec.

Gro

wth

Ra

te -

μ (

hr -1

)

X S P μ

Using Excel VBAProgramming (1)• Numerical integration

should be set up by user as VBA code.

• The program performs loops to estimate the solution until time > end time (tfinal).

START

Readinput data

IF t > tfinal

YES

End

t = 0,V = V0, etc.

NO

Estimate slopes basedon last step data

New value= old value + h x slope

Print a line ofresult

tn+1 = tn + h

Using Excel VBA (2)

• Can include feed stream as a step function by using IF statement.

• But, how can we handle multiple steps in those step functions?

START

Readinput data

IF t > tfinal

YES

End

t = 0,V = V0, etc.

NO

Estimate slopes basedon last step data

New value= old value + h x slope

Print a line ofresult

tn+1 = tn + h

IF t ≥ 3.5 hr

F = 0,Sfeed = 0

NO

F = 0.1,Sfeed = 100

YES

Using Excel VBA (3)

• An automatic feed data reading code is introduced;

• It is possible to handle any number of steps.

START

Readinput data

IF t > tfinal

YES

End

t = 0,V = V0, etc.

NO

Estimate slopes basedon last step data

New value= old value + h x slope

Print a line ofresult

tn+1 = tn + h

IF t ≥ tstep

NO

F = Fm,Sfeed = Sfeed,m

YES

Read1st step data

tstep = tstep,1F = 0, Sfeed = 0

Readnext step

data

tstep = tstep,m+1

Using Excel VBA (4)

• Costs:– Users need to write their own VBA program code.

• Advantages:– It is more flexible and can handle various kinds of

decisions.

• Disadvantages:– Need more time to set up the program;– Programming is not easy for novices.

Using Excel VBA (5)

VBA Program Result

0

20

40

60

80

100

120

140

160

180

200

0 2 4 6 8 10 12

Time (hr)

Con

c. -

X, S

, P (

g / L

)

0

0.05

0.1

0.15

0.2

0.25

0.3

0.35

0.4

0.45

0.5

Spe

c. G

row

th R

ate

- μ

(hr

-1)

X S P μ

When Do We Need to Write Our Own Program?

• For example:• If it is needed to calculate the

effect of various conditions, such as the case of 1 to many steps etc.

• If it is needed to evaluate different feed strategies.

START

Readsets offeed

strategies

Performnumericalintegration

Printintegration

result for thisset of feed

strategy

Feed set = 1

IFset > totalnumber of

sets?

NO

Next set

YES

END

Useful Reference

• M. Harris, SAMS Teach Yourself Microsoft Excel 2000 Programming in 21 Days, SAMS, 1999– Although this book is not for the latest version, it

is a good introductory book for Excel VBA programming.