Documente Academic
Documente Profesional
Documente Cultură
COLLOCATION
METHOD
OUTLINE
Introduction
Aim and objectives
Method of weighted residues
Collocation methods
Orthogonal collocation
Legendre polynomials method
Jacobi polynomials method
Orthogonal representation of differential equations
Solved example
Conclusion
Appendix: MATLAB programme
Reference
Introduction
Orthogonal collocation is a numerical method
that handles ordinary differential equations of
boundary value type.
Examples of such problems include:
Conditions at the two ends of a fixed bed
reactor
Conditions at the two sides of a membrane
This method is particularly attractive for
solving nonlinear problems which have defied
analytical treatment.
Introduction (Contd)
Orthogonal
Collocation
collocation
Method
method
Subdomain
Method
Methods of
Least Square
Weighted
Method
Residuals
Moment
Method
Galerkin
Trial function
Method of weighted residuals
(Contd)
You substitute the trial function into the
differential equation to form the Residue:
This implies:
Where:
n=1
n=2
Cylindrical Geometry (a = 2)
n=1
n=2
Spherical Geometry (a = 3)
n=1
n
n==2
2
Solved example
Apply the orthogonal collocation method to solve the two-point
solution of this problem, and show the profiles of the state variables,
fermentation are:
Cell mass production
Penicillin synthesis
The Hamiltonian:
-111.0000 123.3257 -16.1530 5.6279 -2.8743 1.8269 -1.3534 1.1362 -1.0743 1.1687 -1.6303
1.0000
-47.6368 37.8172 12.4459 -3.8077 1.8726 -1.1713 0.8607 -0.7192 0.6782 -0.7366 1.0268
-0.6297
13.6003 -27.1288 6.8747 8.9175 -3.4619 1.9922 -1.4072 1.1509 -1.0719 1.1560 -1.6057
0.9840
-6.9153 12.1125 -13.0140 2.5238 7.3381 -3.2488 2.0809 -1.6223 1.4719 -1.5643 2.1575
-1.3201
4.3348 -7.3113 6.2008 -9.0065 1.0673 6.7114 -3.2794 2.3074 -1.9911 2.0614 -2.8081 1.7135
-3.0224 5.0169 -3.9145 4.3743 -7.3624 0.3045 6.7171 -3.5976 2.8018 -2.7650 3.6865 -2.2391
2.2391 -3.6865 2.7650 -2.8018 3.5976 -6.7171 -0.3045 7.3624 -4.3743 3.9145 -5.0169 3.0224
-1.7135 2.8081 -2.0614 1.9911 -2.3074 3.2794 -6.7114 -1.0673 9.0065 -6.2008 7.3113 -4.3348
1.3201 -2.1575 1.5643 -1.4719 1.6223 -2.0809 3.2488 -7.3381 -2.5238 13.0140 -12.1125
6.9153
-0.9840 1.6057 -1.1560 1.0719 -1.1509 1.4072 -1.9922 3.4619 -8.9175 -6.8747 27.1288
-13.6003
0.6297 -1.0268 0.7366 -0.6782 0.7192 -0.8607 1.1713 -1.8726 3.8077 -12.4459 -37.8172
47.6368
-1.0000 1.6303 -1.1687 1.0743 -1.1362 1.3534 -1.8269 2.8743 -5.6279 16.1530 -123.3257
111.0000
Results (Contd)
(a) (b)
1 1.5
Penicillin
Cell
0.5 0.5
0 -0.5
0 0.5 1 0 0.5 1
Time Time
(c) (d)
4 30
Temperature (deg C)
3
First Adjoint
2 25
0 20
0 0.5 1 0 0.5 1
Time Time
Figure 2: Plots from results of MATLAB
programme
Conclusion
Orthogonal collocation method does not need
all the values to solve the problem only the
collocation points are required.
After the values at the collocation points are
obtained, the value at any other point can be
determined.
Orthogonal collocation is relatively easier
when compared to other methods.
The efficiency is also good only second to the
Galerkin method which is more rigorous.
Appendix: MATLAB Programme
Matlab programme: guess=3;
% This program calculates and plots % Define M-file containing the set of
% the concentration of cell mass, concentration differential equations
of penicillin,
fname = 'example_equations';
% optimal temperature profile, and adjoint
%Define M-file containing the necessary
variable of a batch
condition function
% penicillin fermentor. It uses the function
COLLOCATION to fth = 'example_theta';
% solve the set of system and adjoint % Input data
equations. n = input(' Number of internal collocation
function example points = ');
clear all rho= input(' Relaxation factor = ');
clc % Solution of the set of differential equations
% Define known parameters [t,y] =
w=[13.1, 0.005, 30, 0.94, 1.71, 20]; collocation(fname,0,1,y0,yf,guess,n,rho,
% Initial guess [],w,fth);
y0=[0.03,0]; % Temperature changes
% Vector of final conditions for k = 1:n+2
yf=0; theta(k) = fzero(fth,30,1e-6,y(:,k),w);
% Vector of guessed initial conditions
end
Appendix: MATLAB % This function introduces the set of
function [x,y]=RK(ODEfile,xi,xf,h,yi,n,varargin)
% Initialization
% RK solves a set of ordinary differential if isempty (h) | h == 0
equations by the h = linspace (xi,xf ) ;
% Runge-Kutta method. end
%
if nargin == 5 | isempty(n) | n < 2 | n > 5
% [X,Y]=RK('F',XI,XF,H,YI,N) solves a set of
ordinary differential n = 2;
% equations by the Nth-order Runge-Kutta end
method, from XI to XF.
% The equations are given in the M-file F.M. H is
hte length of interval.
% YI is the vector of initial values of hte
dependent
Appendix: MATLAB
Programme
n = fix (n) ; case 3 % 3rd-order Runge-Kutta
yi = (yi(:).')'; % Make sure it's a column for i = 1:length(x)-1
vector k1 = d(i) * feval(ODEfile,x(i), y(:,i),varargin{:});
x = [xi:h:xf]; % Vector of x values k2 = d(i) * feval(ODEfile,x(i)+d(i)/2,y(:,i)+k1/2,...
if x(end) ~= xf varargin{:}) ;
k3 = d(i) * feval(ODEfile,x(i+1),y(:,i)+2*k2-
x(end+1) = xf;
k1,varargin{:});
end y(:,i+1) = y(:,i) + (k1+4*k2+k3)/6;
d = diff(x); % Vector of x-increments end
y(:,1) = yi; % Initial condition case 4 % 4th-order Runge-Kutta
% Solution for i = 1:length(x)-1
switch n k1 = d(i) * feval(ODEfile,x(i),y(:,i),varargin{:});
case 2 % 2nd-order Runge-Kutta k2 = d(i) * feval(ODEfile,x(i)+d(i)/2,y(:,i)+k1/2,...
varargin{:});
for i = 1:length(x)-1
k3 = d(i) * feval(ODEfile,x(i)+d(i)/2,y(:,i)+k2/2,...
k1 = d(i) *
varargin{:});
feval(ODEfile,x(i),y(:,i),varargin{:});
k4 = d(i) * feval(ODEfile,x(i+1),y(:,i)
k2 = d(i) * feval(ODEfile,x(i+1),y(:,i) +k3,varargin{:});
+k1,varargin{:}); y(:,i+1) = y(: ,i) + (k1+2*k2+2*k3+k4)/6;
y(:,i+1) = y(:,i) + (k1+k2)/2; end
end
Appendix: MATLAB
Programme
case 5 % 5th-order Runge-Kutta
for i = 1:length(x)-1
k1 = d(i) * feval(ODEfile,x(i), y(:,i),
varargin{:});
k2 = d(i) * feval(ODEfile,x(i)+d(i)/2,y(:,i)+
k1/2,...
varargin{:});
k3 = d(i) * feval(ODEfile,x(i)+d(i)/4,y(:,i)
+3*k1/16+k2/16,...
varargin{:});
k4 = d(i) * feval(ODEfile,x(i)+d(i)/2,y(:,i)
+k3/2,...
varargin{:});
k5 = d(i) * feval(ODEfile,x(i)
+3*d(i)/4,y(:,i )-3*k2/16+...
6*k3/16+9*k4/16, varargin{:});
k6 = d(i) * feval(ODEfile,x(i+1), y(:, i)
+k1/7+4*k2/7+...
6*k3/7-12*k4/7+8*k5/7, varargin{:});
y(:, i+1) = y(: ,i) +
(7*k1+32*k3+12*k4+32*k5+7*k6)/90;
end
end
References
Collocation and Orthogonal Collocation (no date).Retrieved October28, 2014
from: http://faculty.washington.edu/finlayso/ebook/bvp/OC/OC_unsym.htm
Constantinides, Alkis and Mostoufi, Navid (1999).Numerical Methods for
Chemical Engineers with MATLAB Applications. New Jersey: Prentice Hall PTR
Fletcher, C. A. J., (1984). Computational Galerkin Methods. New York:
Springer-Verlag.
Michelsen, M. L., and J. Villadsen, (1980). "Polynomial Solution of Differential
Equations," Proceedings of the First Conference on Computer Aided Process
Design held at Henniker, New Hampshire.
Ramirez, Fred W. (1998).Computational Methods in Process Simulation. New
York: Elsevier Science & Technology Books.
Villadsen, J., and M. L. Michelsen (1978). Solution of Differential Equation
Models by Polynomial Approximation. New Jersey: Prentice Hall, Engelwood
Cliffs.
Villadsen, J., Selected (1970). Approximation Methods for Chemical
Engineering Problems. Copenhagen: Reproset
THANK
YOU