0% found this document useful (0 votes)
41 views11 pages

Matlab Chap 10

MATLAB

Uploaded by

Wilker Jordan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
41 views11 pages

Matlab Chap 10

MATLAB

Uploaded by

Wilker Jordan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

CHAPTER TEN

Contact Problems

MATLAB Implementation 10.1: Gap/interpenetration


calculation

MatlabFiles\Chap10\sideMap8Node.m
2

function [x, y, dxa, dya, nmap] = sideMap8Node(a, coord, side)


switch (side)
case 1
nmap = [((-1 + a)*a)/2, 1 - a^2, (a*(1 + a))/2, 0,...
0, 0, 0, 0];
dnamap = [-1/2 + a, -2*a, 1/2 + a, 0, 0, 0, 0, 0];
case 2
nmap = [0, 0, ((-1 + a)*a)/2, 1 - a^2, ...
(a*(1 + a))/2, 0, 0, 0];
dnamap = [0, 0, -1/2 + a, -2*a, 1/2 + a, 0, 0, 0];
case 3
nmap = [0, 0, 0, 0, ((-1 + a)*a)/2, 1 - a^2, ...
(a*(1 + a))/2, 0];
dnamap = [0, 0, 0, 0, -1/2 + a, -2*a, 1/2 + a, 0];
case 4
nmap = [a*(1 + a)/2, 0, 0, 0, 0, 0, ((-1 + a)*a)/2,...
1 - a^2];
dnamap = [1/2 + a, 0, 0, 0, 0, 0, -1/2 + a, -2*a];
end
x = nmap*coord(:,1); dxa = dnamap*coord(:,1);
y = nmap*coord(:,2); dya = dnamap*coord(:,2);
end % sideMap8Node

MatlabFiles\Chap10\contactSignedDistance.m
3

function dist = contactSignedDistance (pt, coord, side, prFlag)


% dist = contactSignedDistance (pt, cCoord, tCoord)
% Computes signed distance between the target side and a given point on a
% contactor side
% pt = given point on the contactor
% coord = coordinates of the target element
% side = target side of the element
xc = pt(1); yc=pt(2);
aa = fzero(@dfa,0);
[xt, yt, dxa, dya, nmap] = sideMap8Node(aa, coord, side);
Jc=sqrt(dxa^2 + dya^2);
cn = [dya; -dxa]/Jc;
dist = ([xc, yc] - [xt, yt])*cn;
if prFlag
fprintf(1, 'Contactor point: (%-5.4g, %5.4g) \n', xc, yc);
fprintf(1, 'Closest target point: (%-5.4g, %5.4g) \n', xt, yt);
fprintf(1, 'Normal vector: (%-5.4g, %5.4g) \n', cn(1), cn(2));
end
fhandle = @dfa;
function dd = dfa(a)
[xt, yt, dxa, dya, nmap] = sideMap8Node(a, coord, side);
dd = (xt - xc)*dxa + (yt - yc)*dya;
end % dfa
end

Example 10.1: Gap calculations p. 560

As a specific example consider calculation of contact point and gap between two cylinders shown in
Figure. The smaller cylinder has inner and outer radii of 35 mm and 50 mm respectively. The larger cylin-
der has inner and outer radii of 50 mm and 70 mm respectively. In the configuration shown, both cylinders
are resting on a horizontal surface. Segments of cylinders close to each other are modelled as shown in the
figure. With two sides curved, each segment involves six key points. For ease in implementation all sides
are defined by three key points as shown. The line 5 - 6 - 7 is the contactor and line 9 - 10 - 11 is the target.
4

9
40 16
15
7
T
8
C
1
20

6 14
2 10
0

3
4 13
-20 5
12

11

30 50 70

MatlabFiles\Chap10\GapEx101.m
5

%Example 10.1: Gap calculation


% cCoord = [35/sqrt(2), 35/sqrt(2); 35*cos(pi/16), 35*sin(pi/16);
% 35*cos(pi/8), -35*sin(pi/8); 50*cos(pi/8), -50*sin(pi/8);
% 50*cos(pi/16), 50*sin(pi/16); 25*sqrt(2), 25*sqrt(2));
% tCoord = [130 + 70*cos((7*pi)/8), 20 + 70*sin((7*pi)/8);
% 130 + 70*cos((17*pi)/16), 20 + 70*sin((17*pi)/16);
% 130 - 35*sqrt(2), 20 - 35*sqrt(2);
% 130 - 25*sqrt(2), 20 - 25*sqrt(2);
% 130 + 50*cos((17*pi)/16), 20 + 50*sin((17*pi)/16);
% 130 + 50*cos((7*pi)/8), 20 + 50*sin((7*pi)/8));
cCoord = [35/sqrt(2), 35/sqrt(2); 35*cos(pi/16), 35*sin(pi/16);
35*cos(pi/8), -35*sin(pi/8); (85*cos(pi/8))/2, (-85*sin(pi/8))/2;
50*cos(pi/8), -50*sin(pi/8); 50*cos(pi/16), 50*sin(pi/16);
25*sqrt(2), 25*sqrt(2); 85/(2*sqrt(2)), 85/(2*sqrt(2))];
tCoord = [130 + 70*cos((7*pi)/8), 20 + 70*sin((7*pi)/8);
130 + 70*cos((17*pi)/16), 20 + 70*sin((17*pi)/16);
130 - 35*sqrt(2), 20 - 35*sqrt(2);
130 - 30*sqrt(2), 20 - 30*sqrt(2);
130 - 25*sqrt(2), 20 - 25*sqrt(2);
130 + 50*cos((17*pi)/16), 20 + 50*sin((17*pi)/16);
130 + 50*cos((7*pi)/8), 20 + 50*sin((7*pi)/8);
130 + 60*cos((7*pi)/8), 20 + 60*sin((7*pi)/8)];
dist = contactSignedDistance (cCoord(6,:), tCoord, 1, true)

>> GapEx101
Contactor point: (49.04, 9.755)
Closest target point: (60.58, 11.15)
Normal vector: (-0.9927, -0.1203)

dist =

11.6220
6

Example 10.2: Gap calculations - Interpenetration p. 563

9
40 16
15
7
T
8
C
1
20

6 14
2 10
0

3
4 13
-20 5
12

11

30 50 70

MatlabFiles\Chap10\PenetrationEx102.m
7

%Example 10.2: Interpenetration


cCoord = [35/sqrt(2), 35/sqrt(2); 35*cos(pi/16), 35*sin(pi/16);
35*cos(pi/8), -35*sin(pi/8); (85*cos(pi/8))/2, (-85*sin(pi/8))/2;
50*cos(pi/8), -50*sin(pi/8); 50*cos(pi/16), 50*sin(pi/16);
25*sqrt(2), 25*sqrt(2); 85/(2*sqrt(2)), 85/(2*sqrt(2))];
tCoord = [110 + 70*cos((7*pi)/8), 20 + 70*sin((7*pi)/8);
110 + 70*cos((17*pi)/16), 20 + 70*sin((17*pi)/16);
110 - 35*sqrt(2), 20 - 35*sqrt(2);
110 - 30*sqrt(2), 20 - 30*sqrt(2);
110 - 25*sqrt(2), 20 - 25*sqrt(2);
110 + 50*cos((17*pi)/16), 20 + 50*sin((17*pi)/16);
110 + 50*cos((7*pi)/8), 20 + 50*sin((7*pi)/8);
110 + 60*cos((7*pi)/8), 20 + 60*sin((7*pi)/8)];
dist = contactSignedDistance (cCoord(6,:), tCoord, 1, true)

>> PenetrationEx102
Contactor point: (49.04, 9.755)
Closest target point: (40.97, 8.424)
Normal vector: (-0.9867, -0.1627)

dist =

-8.1814

MATLAB Implementation 10.2: Contact problem

MatlabFiles\Chap10\PenaltyContactElement.m
8

function k = PenaltyContactElement(coord, side, h, beta)


% k = PenaltyContactElement(pt, coord, side, beta)
% Form k matrix for contact element based on penalty formulation
% coord = coordinates of the target element
% side = target side of the element
% h = thickness
% beta = penalty parameter
% Use 2 point integration. Gauss point locations and weights
pt=-1/sqrt(3);
gpLocs = [-pt, pt];
gpWts = [1,1];
% Use 3 point integration. Gauss point locations and weights
pt=sqrt(3/5);
gpLocs = [-pt,0, pt];
gpWts = [5/9, 8/9, 5/9];
k = zeros(16);
for i=1:length(gpWts)
a = gpLocs(i); w = gpWts(i);
[xt, yt, dxa, dya, n] = sideMap8Node(a, coord, side);
Jc=sqrt(dxa^2 + dya^2);
cn = [dya; -dxa]/Jc;
n = [n(1),0,n(2),0,n(3),0,n(4),0,n(5),0,n(6),0,n(7),0,n(8),0;
0,n(1),0,n(2),0,n(3),0,n(4),0,n(5),0,n(6),0,n(7),0,n(8)]';
Nn = n*cn;
k = k + h*beta*Jc*w*Nn*Nn';
end
end % PenaltyContactElement
9

à Example 10.3 p. 569

9
40 16
15
7
8 T
1C
20

6 14
2 10
0

3 13
-20 4
5
12
11
30 50 70

MatlabFiles\Chap10\PenaltyContactEx103.m

%Example 10.2: Interpenetration


cCoord = [35/sqrt(2), 35/sqrt(2); 35*cos(pi/16), 35*sin(pi/16);
35*cos(pi/8), -35*sin(pi/8); (85*cos(pi/8))/2, (-85*sin(pi/8))/2;
50*cos(pi/8), -50*sin(pi/8); 50*cos(pi/16), 50*sin(pi/16);
25*sqrt(2), 25*sqrt(2); 85/(2*sqrt(2)), 85/(2*sqrt(2))];
tCoord = [110 + 70*cos((7*pi)/8), 20 + 70*sin((7*pi)/8);
110 + 70*cos((17*pi)/16), 20 + 70*sin((17*pi)/16);
110 - 35*sqrt(2), 20 - 35*sqrt(2);
110 - 30*sqrt(2), 20 - 30*sqrt(2);
110 - 25*sqrt(2), 20 - 25*sqrt(2);
110 + 50*cos((17*pi)/16), 20 + 50*sin((17*pi)/16);
110 + 50*cos((7*pi)/8), 20 + 50*sin((7*pi)/8);
110 + 60*cos((7*pi)/8), 20 + 60*sin((7*pi)/8)];
k = PenaltyContactElement(cCoord, 3, 1, 1)
10

>> PenaltyContactEx103

k=

Columns 1 through 6

0 0 0 0 0 0
0 0 0 0 0 0
0 0 0 0 0 0
0 0 0 0 0 0
0 0 0 0 0 0
0 0 0 0 0 0
0 0 0 0 0 0
0 0 0 0 0 0
0 0 0 0 0 0
0 0 0 0 0 0
0 0 0 0 0 0
0 0 0 0 0 0
0 0 0 0 0 0
0 0 0 0 0 0
0 0 0 0 0 0
0 0 0 0 0 0

Columns 7 through 12

0 0 0 0 0 0
0 0 0 0 0 0
0 0 0 0 0 0
0 0 0 0 0 0
0 0 0 0 0 0
0 0 0 0 0 0
0 0 0 0 0 0
0 0 0 0 0 0
0 0 7.6728 -1.8188 4.0310 -1.3791
0 0 -1.8188 0.5120 -1.3791 0.0614
0 0 4.0310 -1.3791 28.0892 5.3909
0 0 -1.3791 0.0614 5.3909 2.0594
0 0 -1.6263 -0.2499 2.4744 2.3786
0 0 -0.2499 -0.4199 2.3786 1.6180
0 0 0 0 0 0
0 0 0 0 0 0

Columns 13 through 16

0 0 0 0
0 0 0 0
11

0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
-1.6263 -0.2499 0 0
-0.2499 -0.4199 0 0
2.4744 2.3786 0 0
2.3786 1.6180 0 0
5.3380 3.8178 0 0
3.8178 2.8468 0 0
0 0 0 0
0 0 0 0

A complete example is still under development. It will be


posted on the web site by the Spring 2006.

You might also like