Professional Documents
Culture Documents
COMPUTATION
KKKK3522
jarinah@ukm.edu.my
BOUNDARY VALUE
PROBLEMS
OBJECTIVES
1) Able to differentiate the initial-value and boundary-
value problems.
2) Able to express an nth order ODE as a system of n
first-order ODEs.
3) Able to use the shooting method for linear and
nonlinear ODEs
4) Understanding how derivative boundary conditions
are incorporated into the shooting method.
5) Able to implement the finite difference method
(1)
2 pairs of
Re-expressed the above equation (1): ODEs
If initial condition of ! and " are available, those equations can be easily
solved using initial-value problem. Unfortunately, only ! 0 = !% is
available, thus the value for " 0 = "%,' is guessed.
tspan = [0 10];
y0 = [300,-5];
[t,y] = ode45(@(t,y) [y(2);-0.05*(200-y(1))-2.7e-9*(1.6e9-
y(1)^4)], tspan, y0);
In Matrix form:
dt/dx
In matrix form we get: given
Coding in MATLAB
a) solvingode.m
% manipulated variable = Tj = 55
c) Reactor_sfcn.m
= 1;
sys = simsizes(s);
x0 = [Cinit, Tinit];
function [sys,x0,str,ts] =
reactor_sfcn(t,x,u,flag,Cinit,Ti case 1 % derivatives
nit)
u = 55;
switch flag Tj = u;
sys =
case 0 % initialize reactor(t,x,Tj);
28/11/2019
case 1 % KKKK3522 Chemical Engineering Computation
derivatives 19
PROCESS MODELLING USING
SIMULINK & M-FILE ODE SOLVER
2. Create a SIMULINK model (use s-function block from
SIMULINK Library)