Upload
khalil-ahmad
View
214
Download
2
Embed Size (px)
DESCRIPTION
Project Overview
Citation preview
Autonomous Underwater Vehicle
Project No. 03
Project Title:
Submitted By: Khalil Ahmad
Submitted To: Dr. Khalid Pervaiz
Dated: 13-07-2014
Institute of space Technology Islamabad, Pakistan
Laplace Equation
Then the Laplace equation for two dimensional rectangular steel block is shown below
0
2
2
2
2
=
+
y
u
x
u
and its fde becomes
uij = ui+1,j + ui-1,j + ui,j+1 + ui,j-1
4
Consider the problem below we use Laplace equation to calculate temperature distribution
T = 50
T = 100 T = 0
T = 25
Matlab Program:
function [x,y,T]= LaplaceExplicit(n,m,Dx,Dy)
clc
echo off;
n = 10;
m = 20;
nx = 30;
ny = 24;
Dx = 1;
Dy = 1;
%numgrid(n,m);
R = 5.0;
T = R*ones(n+1,m+1); % All T(i,j) = 1 includes all boundary conditions
x = [0:Dx:n*Dx];
y = [0:Dy:m*Dy]; % x and y vectors
for i = 1:n % Boundary conditions at j = m+1 and j = 1
T(i,m+1) = 50; % Top boundary temperature
T(i,1) = 25; % Bottom Boundary temperature
end
for j = 1:m
T(n+1,j) = 0; % Left Boundary temperature
T(1,j) = 100; % Bottom Boundary temperature
end;
TN = T; % TN = new iteration for solution
err = TN-T;
% Iterative procedure
epsilon = 1e-5; % tolerance for convergence
imax = 1000; % maximum number of iterations allowed
k = 1; % initial index value for iteration
% Calculation loop
while k