Boundary
Boundary
ABSTRACT:
To determine the potential function for the region inside the
rectangular trough of infinite length using MATLAB .
PROGRAM:
1.
close all
clear all
clc P = [];
i = []; j =
[]; a =
1.0; b =
2*a; x =
3*a/2; y =
a;
V0 = 10*sin(3*pi*x/b);
c = 4.*V0/pi; sum =
0.0; for k = 1:10 n=
2*k - 1;
a1 = sin(n.*pi*x/b); a2
= sinh(n.*pi*y/b); a3 =
n.*sinh(n.*pi*a/b); sum
= sum + c*a1*a2/a3; P=
[n, sum]; end disp(P)
X = [1/4, 1/2, 3/4, 1, 3/2];
Y = [1, 1, 1, 1, 1];
Z = ["9.1534", "7.3871", "-3.8295", "-9.6825", "7.3871"]; plot(X, Y, "o"),
xlabel("X"), ylabel("Y") text(X,Y,Z, "VerticalAlignment", "bottom",
"HorizontalAlignment", "right")
2.
close all
clear all
clc P =
[]; i =
[]; j =
[];
V0 = 100.0; a = 1.0; b = a;
x = 2*b/3; y = 3*a/4; c =
4.*V0/pi; sum = 0.0; for k
= 1:10 n = 2*k - 1;
a1 = sin(n.*pi*x/b); a2
= sinh(n.*pi*y/b); a3 =
n.*sinh(n.*pi*a/b); sum
= sum + c*a1*a2/a3; P
= [n, sum]; end disp(P)
X = [1/6, 1/2, 3/2, 2/5, 2/3];
Y = [3/10, 3/8, 3/7, 3/5, 3/4];
Z = ["6.0573", "16.0925", "-19.5620", "33.1588", "49.5445"];
[px, py] = meshgrid(X, Y);
%contour(px, py, Z) plot(X, Y, "o"),
xlabel("X"), ylabel("Y")
text(X,Y,Z, "VerticalAlignment", "bottom", "HorizontalAlignment", "right")
OUTPUT:
1.
2.
INFERENCE:
This problem solves the two dimentional boundary value
problem a and b are the dimensions of the trough, x and y are the
coordinates of the points of interest.