0% found this document useful (0 votes)
231 views39 pages

Numerical Analysis For Real-Time Nonlinear Model Predictive Control (NMPC) of Ethanol Steam Reformers

This document summarizes Robert Joseph George's presentation on numerical analysis for real-time nonlinear model predictive control of ethanol steam reformers. It discusses the motivation for using ethanol steam reformers to produce hydrogen, outlines the chemical reactions involved, and presents the governing conservation equations - including molar conservation, energy conservation, and how these were transformed into conservation law forms. It also discusses the singular partial differential equation system used to model the system.

Uploaded by

Robert
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
231 views39 pages

Numerical Analysis For Real-Time Nonlinear Model Predictive Control (NMPC) of Ethanol Steam Reformers

This document summarizes Robert Joseph George's presentation on numerical analysis for real-time nonlinear model predictive control of ethanol steam reformers. It discusses the motivation for using ethanol steam reformers to produce hydrogen, outlines the chemical reactions involved, and presents the governing conservation equations - including molar conservation, energy conservation, and how these were transformed into conservation law forms. It also discusses the singular partial differential equation system used to model the system.

Uploaded by

Robert
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 39

Numerical Analysis for Real-time Nonlinear

Model Predictive Control (NMPC) of Ethanol


Steam Reformers
Canadian Undergraduate Mathematics Conference

Robert Joseph George

Department of Mathematical and Statistical Sciences


Department of Computer Science
Alberta Machine Intelligence Institute
Reinforcement Learning and Artificial Intelligence Lab
University of Alberta

July 17, 2022


Numerical Analysis for Real-time Nonlinear Model Predictive Control (NMPC) of Ethanol Steam Reformers

Outline

1 Motivation
2 Conservation Law
3 Method of Characteristics
4 Existence and Uniqueness Theorem
5 Numerical Analysis
6 Limitations
7 Future work
8 Applications
9 Conclusion
10 References
Numerical Analysis for Real-time Nonlinear Model Predictive Control (NMPC) of Ethanol Steam Reformers
References

Motivation for Ethanol Steam Reformers (ESR)


The use of renewable energy technology, notably hydrogen,
has witnessed a surge in interest and spread over the world.
Fluid fuels have far higher energy densities than batteries.
Hydrogen storage and transportation has been a limitation
Ethanol Reforming (Existing Technology and Infrastructure)
Numerical Analysis for Real-time Nonlinear Model Predictive Control (NMPC) of Ethanol Steam Reformers
References

Chemical Equations

Chemical reactions take place in a tubular packed-bed reactor with


a single intake and output. There are 4 primary chemical reactions
over cobalt-based catalysts that take place in the staged membrane
reactor are as follows
C2 H5 OH −→ CH3 CHO + H2 , (1a)
C2 H5 OH −→ CO + CH4 + H2 , (1b)
CO + H2 O ⇌ CO2 + H2 , (1c)
CH3 CHO + 3H2 O −→ 2CO2 + 5H2 . (1d)
Numerical Analysis for Real-time Nonlinear Model Predictive Control (NMPC) of Ethanol Steam Reformers
References
Numerical Analysis for Real-time Nonlinear Model Predictive Control (NMPC) of Ethanol Steam Reformers
References

Molar Conservation Equations

For the reforming stage, the molar conservation equations for the
seven j ∈ (1, . . . , 7) species (C2 H5 OH, H2 O, CH4 , H2 ,
CO, CO2 , CH3 CHO) are described by a set of seven nonlinear
differential equations, initial conditions, and boundary conditions
!
∂Fj Fj X ∂Fi p ∂T X X 1 ∂Fj
p − pP − Fj = RT Fi νj,i ri ({Fj }) −
∂t i Fi i ∂t T ∂t i i
A ∂z
Fj (z, 0) = Fj,0 (z), ∀z ∈ [0, ℓ1 ]
Fj (0, t) = Fj, in (t), ∀t ≥ 0
(1)
Numerical Analysis for Real-time Nonlinear Model Predictive Control (NMPC) of Ethanol Steam Reformers
References

Energy Conservation Equation

The spatiotemporal dynamics of the ESR temperature are


described by the energy conservation equation along with the
initial and boundary conditions
P
p j cvj Fj ∂T RT X ∂Fj
P = U β (Tf − T ) −
RT i Fi ∂t A ∂z
j
 
1 X ∂T X X
− cpj Fj  − ri ({Fj }) (∆Hi − νj,i RT )
A ∂z
j j i

T (z, 0) = T0 (z), z ∈ [0, ℓ1 ]


T (0, t) = Tin (t), ∀t ≥ 0
Numerical Analysis for Real-time Nonlinear Model Predictive Control (NMPC) of Ethanol Steam Reformers
References

Conservation Law
For a given physical domain, conservation laws are frequently
expressed in integral form. Assume we have a physical domain, Ω,
with a domain boundary, ∂Ω. Then, assuming that the physical
domain is fixed, the canonical conservation equation is of the type
Z Z Z
d
U dx + F(U ) · nds = S(U, t)dx
dt Ω ∂Ω Ω

where U is the conserved state, F is the flux of the conserved


state, n is the outward pointing unit normal on the boundary of
the domain, and S is a source term. Using Gauss’s theorem, this
conservation law may be represented as a partial differential
equation(usually a hyperbolic system) as follows
∂U
+∇·F=S
∂t
Numerical Analysis for Real-time Nonlinear Model Predictive Control (NMPC) of Ethanol Steam Reformers
References

Molar Conservation Law


At any given point, the concentration of the j th species, Cj , and
the flow’s velocity, v, can be computed a
Fj p
Cj = P
i Fi RT
1 X RT
v= Fi
A p
i
Now notice we can transform the Molar Conservation Equation
into a conservation equation by using Cj and v as defined above.

∂Cj ∂ (vCj ) X
+ = vj,i ri ,
∂t ∂z
i
Cj (0, z) = Cj,0 (z), ∀z ∈ [0, l1 ]
Cj (t, 0) = Cj, in (t), ∀t ≥ 0
which is in a conservation form.
Numerical Analysis for Real-time Nonlinear Model Predictive Control (NMPC) of Ethanol Steam Reformers
References

Energy Convection Form

Sadly it was not possible: :(


Numerical Analysis for Real-time Nonlinear Model Predictive Control (NMPC) of Ethanol Steam Reformers
References

Energy Convection Form


However it was transformed into a convection law by converting
the following equation
   
∂T ρs cps ∂T
ρg cpg v + 1+ = U a (Tf − T ) + Hr
∂z ρg cpg ∂t
to
∂g ∂ (g)   g  1 1
+ vβ −1 = U a gf − + Hr β −1
∂t ∂z k ρg cpg k
N
X
Hr = −∆Hj rj j = 1, 2, . . . , 4
j=1

g(0, z) = g0 (z) z ∈ [0, L]


g(t, 0) = gin (t) ∀t > 0
Numerical Analysis for Real-time Nonlinear Model Predictive Control (NMPC) of Ethanol Steam Reformers
References

Singular Partial Differential Equation System


The systems of singular partial differential equations of the ESR
can be written in the form
!
I − ∥F1 ∥ F e⊤ − T1 F
M ft + N fz = g(t, z, f ) M =
0⊤ Cv
RT ∥F ∥ F
 
F1 RT
!
Ap I 0
 
F  .. 
f := , F = .  N = RT ⊤ Cp
T Ap e Ap F
F7
RT [F1 , F1 , . . . F1 ]F V1 R′
 

 RT [F2 , F2 , . . . F2 ]F V2 R′ 

g=
 .
.. 


 
 RT [F7 , FP
7 , . . . F7 ]F V7 R 

U β(Tf − T ) − i Fi [R H − Vi R ] ′ ′ T
Numerical Analysis for Real-time Nonlinear Model Predictive Control (NMPC) of Ethanol Steam Reformers
References

Reformulation
The above system can also be reformulated
√ by writing the vector f
in terms of an orthonormal basis ∥F ∥ = 7u7

1 − uu71 − uT1
 
 RT 
 . .. .. Ap 0 0
 ..

. .   .
 .. .. .. 

u6
 . . 
A= 1 − u7 − uT6  B =  0

RT

u7 0 
 0 −T   √Ap 
  7RT Cvu U
0 C U
√ v
u
0 Ap Ap
7RT u7
RT [u1 , u1 , . . . u1 ]U V1 R′
 

RT [u2 , u2 , . . . u2 ]U V2 R′
 



 u1
g=
 .. 
U =  ... 
 
. 
, . . . u7 ]U V7 R′
 
 RT [u7 , u7P  u7
U β(Tf − T ) − i ui [R′ H ′ − Vi R′ ]T
Numerical Analysis for Real-time Nonlinear Model Predictive Control (NMPC) of Ethanol Steam Reformers
References

Method of Characteristics
The primary concept of the method of characteristics is to convert
a partial differential equation to an ordinary differential equations
using characteristic curves which enables us to then solve the PDE.
The equations can be written as a singular system of quasi-linear
hyperbolic equations
A(x, y, u)ux + B(x, y, u)uy = g(x, y, u)
Multiplying both sides of the equation by a row vector to be
determined later gives
l⊤ Aux + l⊤ Buy = l⊤ g
Assume that there exists an ordered pair (xω′ , yω ) parameterized
by a real scalar ω ∗
   
1 ⊤ 1 ⊤
l A ux xω + l B uy yω = l⊤ g
xω yω
Numerical Analysis for Real-time Nonlinear Model Predictive Control (NMPC) of Ethanol Steam Reformers
References

Method of Characteristics (cont’d)

If (xω , yω , l) can be found that satisfy x1ω l⊤ A = y1ω l⊤ B then


 
1 ⊤
xω l A (ux xω + uy yω ) = l⊤ g. After some simplifications and by
using the chain rule, these expressions can be rewritten as
du
l⊤ A = l⊤ g
dx
du
l⊤ B = l⊤ g
dy
In other words, u is related to x and y by ordinary differential
equation which can be found if we find a way to satisfy
1 ⊤ 1 ⊤ ⊤
xω l A = yω l B. Thus multiplying by xω gives l (A − σB) = 0
xω dx
where σ = yω = dy
Numerical Analysis for Real-time Nonlinear Model Predictive Control (NMPC) of Ethanol Steam Reformers
References

ODE system

Finally we have
dx 1
=
dt σk (x, t, u)
dx
lk (x, t, u)⊤ A(x, y, u) = lk (x, t, u)⊤ g(x, t, u)
dt
k = 1, 2, . . . , m

which is much easier to solve. Finding σk and lk can be found by


first finding the eigenvalues by finding the analytic solution to
det(A − σB) = 0 and then using the eigenvalues σk to find out
the generalized eigenvectors lk by solving l⊤ (A − σB) = 0.
Numerical Analysis for Real-time Nonlinear Model Predictive Control (NMPC) of Ethanol Steam Reformers
References

Generalized Eigenvalues and Eigenvectors of our System


In particular, the analytical solution to our reformulated system
det(A − σB) = 0 is

Ap
σk = , k = 1, · · · , 6,
RT  
0
 .. 
 
1  . 
 0   
l1 =   , . . . , l6 =  0 
   
..
 .   1 
 
0  0 
0

and
C uU √
 
Ap
σ7 = 0, σ8 = √v − 7Ru7
RT Cpu U 7u7
Numerical Analysis for Real-time Nonlinear Model Predictive Control (NMPC) of Ethanol Steam Reformers
References

Generalized Eigenvalues and Eigenvectors (cont’d)


Closed form solutions of l7 and l8
v C p U U ⊤ u +√7C p 2 U U ⊤ u2 −7C p RU u3
   
7u1 −Cu u 7 u 7 u
√ √ 7
v U −7C p U u +7 7Ru2

 v U +7Ru2
T Cu 7C


 7 u u 7 7 

 
v C p U U ⊤ u +√7C p 2 U U ⊤ u2 −7C p RU u3
   
 7u2 −Cu u 7 u 7 u

 √ √ 7 
p

 v U +7Ru
T Cu 2 v U −7C U u +7 7Ru
7Cu 2 

 7 u 7 7


 
v C p U U ⊤ u +√7C p 2 U U ⊤ u2 −7C p RU u3
   
u1
 7u3 −Cu u 7 u 7 u

7
   √


v U −7C p U u +7 7Ru2

u7 v U +7Ru2
 
 u2 

 T Cu 7 7Cu u 7 7


 u7   
u3
v C p U U ⊤ u +√7C p 2 U U ⊤ u2 −7C p RU u3
     
7u4 −Cu
   
u7 u 7 u 7 u
7
   
 u4    √
p √ 
v
T Cu U +7Ru7 2 v
7Cu U −7Cu U u7 +7 7Ru7 2
l7 =  u7  l8 = 
   
u5

   
u
v C p U U ⊤ u +√7C p 2 U U ⊤ u2 −7C p RU u3
   
u7
 
7u5 −Cu
   
6 u 7 u 7 u
7
   
 u7   √ √ 
v U −7C p U u +7 7Ru2

v U +7Ru2
T Cu 7Cu
1
   
 7 u 7 7 
0
 
 
v C p U U ⊤ u +√7C p 2 U U ⊤ u2 −7C p RU u3
   
7u6 −Cu u 7 u 7 u
7
 
 √ √

p


 v
T Cu U +7Ru7 2 v
7Cu U −7Cu U u7 +7 7Ru7 2 

 
 
√ p
7Cu U u2
 
7 
 
  
 v U +7Ru2
T Cu 
 7 
 
1
Numerical Analysis for Real-time Nonlinear Model Predictive Control (NMPC) of Ethanol Steam Reformers
References

Uniqueness Theorem for First Order Quasi Linear Systems


The following uniqueness theorem remains valid for quasi-linear
systems of first order
ut + B(x, t, u)ux + g(x, t, u) = 0 (5)
even though the characteristic lines Ck of the above equation
depend on the solution u. We assume here that the matrices B
and g possess continuous derivatives with respect to x, t, and u in
the region under consideration. Then as usual we consider the
following equations
ut + B(x, t, u)ux + g(x, t, u) = 0
u(x, 0) = ψ(x)
and
vt + B(x, t, v)vx + g(x, t, v) = 0
v(x, 0) = ψ(x)
Numerical Analysis for Real-time Nonlinear Model Predictive Control (NMPC) of Ethanol Steam Reformers
References

Uniqueness Theorem (cont’d)


Subtracting v from u and denoting this by z ie (z = u − v) we get
zt + B(v)zx + [B(u) − B(v)]ux + g(u) − g(v) = 0
z(x, t) = 0
Because both B and g are differentiable and continuous we may
apply the mean value theorem
B(u) − B(v) = H(u, v)z; g(u) − g(v) = K(u, v)z
where H, K are continuous functions. We now consider u, v, ux as
known expressions in x, t and substitute these expressions in H and
K as well as in B(v); thereby becomes a linear homogeneous
differential equation for z of the form
zt + bzx + gz = 0
with initial values zero and the uniqueness theorem is proved for
Linear systems (in the paper). Hence proved
Numerical Analysis for Real-time Nonlinear Model Predictive Control (NMPC) of Ethanol Steam Reformers
References

Existence Theorem for First Order Quasi Linear Systems

The existence theorem is a bit more complicated to present here


but the whole gist of it boils down to
creating an iteration scheme and trying to show that the
sequence un converges uniformly to the function u in a
specific region Gh in the closed domain G.
The solution then can be extended into the whole domain G
as long as the coefficients retain their continuity properties
throughout the whole domain.
Numerical Analysis for Real-time Nonlinear Model Predictive Control (NMPC) of Ethanol Steam Reformers
References

Numerical Analysis

Now there are two directions on how we can proceed with the
numerical analysis
ODE System solvers - Euler Methods, Runge-Kutta Method,
IDA (implicit backward differentiation formulas for DAEs) etc
PDE System solvers - Finite Element Methods
Numerical Analysis for Real-time Nonlinear Model Predictive Control (NMPC) of Ethanol Steam Reformers
References

ODE System solvers

We first try to consider a subsystem for simplicity ie we consider a


3 system equation with only 2 molar equations and the same
temperature equation as follows (for simplicity) where
U = (u1 , u2 ) and u = (u1 , u2 , T )
 RT
1 − uu12 − uT1
  
Ap 0 0
A= 0
 0 − uT2   B =  0 √Ap
 RT
0  
u
C U
0 0 √ v 2RT Cvu U
2RT u2 0 Ap Ap

 
RT u1 U V1 R
g= RT P u2 U V2 R′ 
′ ′
U β(Tf − T ) − i ui [R H − Vi R ] ′ T
Numerical Analysis for Real-time Nonlinear Model Predictive Control (NMPC) of Ethanol Steam Reformers
References

Numerical Solution

Using Mathematica we code up the simplified system and the


eigenvectors and eigenvalues of the system are as follows

Figure: Eigenvalues and Eigenvectors of the simplified system

where the generalized eigenvalue and eigenvectors have the same


structure as our original reformulated system. Note the constants
have been renamed to c, c1 .
Numerical Analysis for Real-time Nonlinear Model Predictive Control (NMPC) of Ethanol Steam Reformers
References

Numerical Solution (cont’d)

1 We now proceed to put the values for the constants (R, Tf ,


β, stoichiometric coefficients and etc) where some of the
constants have the true values and others have been
randomized.
2 We should also note that one of the eigenvalues in our system
is 0 which is a point of singularity. This was replaced by
ϵ = 0.00001 just to analyse the system better.
3 Finally we use set all the boundary conditions and initial
conditions to small but randomized values
4 We set the independent variable x to be solved in the range
[ϵ, 10]
Numerical Analysis for Real-time Nonlinear Model Predictive Control (NMPC) of Ethanol Steam Reformers
References

Analysis
We use Mathematica’s NDSolve feature and do not specify any
explicit numerical method to solve the above system. We define
MLR (Molar Flow Rate) and some of the results are as follows
1 It takes around 96 evaluations for the solver to converge and
stop
Plotting the distance between successive evaluations results in
Numerical Analysis for Real-time Nonlinear Model Predictive Control (NMPC) of Ethanol Steam Reformers
References

Solution Plots

Figure: dy/dx = 1/σ1


Numerical Analysis for Real-time Nonlinear Model Predictive Control (NMPC) of Ethanol Steam Reformers
References

Solution Plots

Figure: MLR vs l1 (x, y, u)⊤ A(x, y, u) du ⊤


dx = l1 (x, y, u) g(x, y, u)
Numerical Analysis for Real-time Nonlinear Model Predictive Control (NMPC) of Ethanol Steam Reformers
References

Final Plot
Plotting all the solutions results (when extrapolated backwards in
the negative x axis) which shows the various discontinuities when
x<0

Figure: All solutions x < 0


Numerical Analysis for Real-time Nonlinear Model Predictive Control (NMPC) of Ethanol Steam Reformers
References

Comparison
When we only consider from the positive x - axis we get the
following plot

Figure: All solutions x > 0

which is consistent when only considering the sub system of


equations ie j = 1, 2
Numerical Analysis for Real-time Nonlinear Model Predictive Control (NMPC) of Ethanol Steam Reformers
References

Comparison (cont’d)
This is consistent with the results from the previous paper by
observing the Molar Flow Rate of C2 H5 OH and CH4
Numerical Analysis for Real-time Nonlinear Model Predictive Control (NMPC) of Ethanol Steam Reformers
References

Epsilon value change

Changing the value of ϵ > 1 resulted in

(a) x < 0 (b) x > 0


Numerical Analysis for Real-time Nonlinear Model Predictive Control (NMPC) of Ethanol Steam Reformers
References

Symbolic Solution

Tried to use the symbolic solver to find a closed form solution of


the simplified system (with ϵ = 0.000001)

Upon debugging the stack trace message showed this

It was worth the try, I also considered just a 2 by 2 system and a


closed form solution was found (Maybe due to the fact that there
was no singularity in a 2 by 2 system)
Numerical Analysis for Real-time Nonlinear Model Predictive Control (NMPC) of Ethanol Steam Reformers
References

Limitations

There were certain limitations and assumptions that were made


due to lack of time, some of them were
The whole 16 equations were programmed, but the solver
wasn’t able to figure out even a numerical solution to the
whole system (Mainly due to the randomized values that were
set for the boundary and initial conditions)
Could not completely code up the any of the PDE solvers
Our system has a singularity point due to the fact that
det(A) = 0, and so we need to do more theoretical analysis
on how it behaves.
All the constants were randomized, need a more controlled
setting to set out the constants as accurately as possible
relating to the reactants
Numerical Analysis for Real-time Nonlinear Model Predictive Control (NMPC) of Ethanol Steam Reformers
References

Future work

Some of the possible future work include


An indepth study of the system (more theoretical Analysis)
More research on the various numerical methods which can
help us to solve this system faster as well as more numerical
analysis.
Generalize this approach by incorporating these ode solvers
into Nonlinear Model Predictive control algorithms which can
be used for other Nonlinear systems.
Numerical Analysis for Real-time Nonlinear Model Predictive Control (NMPC) of Ethanol Steam Reformers
References

Applications
To use the above ODE solvers which can be fed into a NMPC
which could enable a mechanistic model to be used in
real-time control calculations with minimal online
computational cost.
This would allow us to manufacture hydrogen safely from
ESR, which could be utilized as green energy.
Numerical Analysis for Real-time Nonlinear Model Predictive Control (NMPC) of Ethanol Steam Reformers
References

Conclusions

To conclude, some of the results are as follows


Try to convert the equations into some form of conservation
law (The energy conservation equation could not be converted
but rather put into a convection form)
Solution of the system
Uniqueness and Existence Theorems for Linear/Quasi-Linear
First Order PDE Systems.
Closed form solutions of all the eigenvalues and eigenvectors
of both the reformulated and original system
Numerical Analysis of a simplified system in hopes of
extending it to the whole system
Numerical Analysis for Real-time Nonlinear Model Predictive Control (NMPC) of Ethanol Steam Reformers
References

References

1 Pedro Reyero , Xinwei Yu, Carlos Ocampo-Martinez, Richard


D. Braatz, A Reduced-order Model for Real-time NMPC of
Ethanol Steam Reformers, 2020
2 Pedro Reyero-Santiago, Carlos Ocampo-Martinez, Richard D.
Braatz, Nonlinear Dynamical Analysis for an Ethanol Steam
Reformer: A Singular Distributed Parameter System, 2020
3 V. M. Garc´ıa, E. Lopez, M. Serra, J. Llorca, and J. Riera,
“Dynamic modeling and controllability analysis of an ethanol
reformer for fuel cell application,” International Journal of
Hydrogen Energy, vol. 35, pp. 9768–9775, 2010
Numerical Analysis for Real-time Nonlinear Model Predictive Control (NMPC) of Ethanol Steam Reformers
References

Thanking remarks

You might also like