April S. Henry
Advanced Numerical Methods-CE8213
500518364
Problem 5
The boundary fluxes and the reaction term can be used to develop the discrete form of
the advection-diffusion equation for the inte
April S. Henry
Advanced Numerical Methods-CE8213
500518364
Assignment #1
Answer to question 1
Computer Program-Matlab
function [su,sd]=Summation(N)
%This function summation is designed to compute the
April S. Henry
Advanced Numerical Methods-CE8213
500518364
Assignment #2
Answer to problem 5.18 b
Bisection program to determine temperature as a function of oxygen saturation concentration
using Matl
Problem 4
Matlab Codes
Matlab Code using Runge-Kutta method
function [ t,y ] = rk4sys( dydtsys,tspan,y0,h)
% Fourth order runge- kutta method used to compute the set of ODE's
% h= step size
ti=tspan(1
Problem 3
Matlab Codes
Matlab Code using Runge-Kutta method
function [ x,y ] = rk4( dydx,xspan,y0,h)
% Fourth order runge- kutta method used to compute the set of ODE's
% h= step size
xi=xspan(1);% in
Problem 2
Deriving the functions and jacobian used in the computer program
f0 =y0=0
fi = - + +a =0
fn-1 =yn-1-1=0
i=1
f1 = - + +a =0
from the above function yo=0
f1 is reduced to
f1 = - + +a =0
a= 1
f
Assignment #5
Problem 1
Computer Program-Matlab Code
function [x,iter] = newtonm(x0,f,J)
% Multiple Newton-Raphson method applied to a
% system of linear equations f(x) = 0,
% x(0)=x(1);x(1)=x(2)
% f=
April S. Henry
Advanced Numerical Methods-CE8213
Problem 25.18a
Decomposition of second order differential into two first order differential
dx1/dt = x2
dx2/dt = -(5*x(1)*x(2)-(x(1)+7)*sin(w*t)
Proble
Problem 25.17
Computer Program-Matlab
function dy=dydt(t,y)
dy=-0.06*sqrt(y);
end
%euler.m
dt=0.5;
max=60;%Maximum time for tank drainage
n=max/dt+1;
t=zeros(1,n);
y=zeros(1,n);
t(1)=0;
y(1)=3;
for i=
% The Newton-Raphson method for solving equations of the form f(x)=0.
% We use the central difference approximation of the derivative by calling
% the function central_diff.m.
% -% INPUT: Anonymous fu