Skip to content

Commit

Permalink
Ring plane headers in docs (#497)
Browse files Browse the repository at this point in the history
  • Loading branch information
mvanzulli committed Apr 15, 2023
1 parent 09a07b0 commit 807eee2
Showing 1 changed file with 15 additions and 20 deletions.
35 changes: 15 additions & 20 deletions examples/ringPlaneStrain/ringPlaneStrain.m
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@
global Re
global Ri
Re = 200 ; Ri = 100 ;

%md## Linear analysis

%md### Analytic solution
%md
%md The solution displacement field is extracted from chapter 4 of (Timoshenko and Goodier, Theory of Elasticity, 3rd edition). The Navier's equation, imposing no temperature variation, no volumetric forces, and considering a radial dispalcement field leads to:
Expand Down Expand Up @@ -216,18 +214,18 @@
%md
%md### Verification
%mdThe numerical and analytic solutions are compared for the external surface (since all the elements on the same surface have the same analytic solution):

%
global Y

%
Y = 2*sigmaY0 / sqrt(3) ;
% p0 = Y/2 * (1-a^2/b^2) ; % Yielding pressure
p0 = Y/2 * (1-Ri^2/Re^2) ; % Yielding pressure

%
pressure_vals = loadFactorsMat(:,3)*p ;

%
cvals = zeros(length(pressure_vals),1) ;
ubAna = zeros(length(pressure_vals),1) ;

%
% Plastic front value
for i = 1:length(cvals)
p = pressure_vals(i) ;
Expand All @@ -240,7 +238,7 @@
end
cvals(i) = val ;
end

%
% Analytic radial displacement at outer surface
for i = 1:length(cvals)
p = pressure_vals(i) ;
Expand All @@ -253,32 +251,29 @@
ubAna(i) = Y*c^2/(E*Re) * (1-nu^2) ;
end
end

% Plot parameters
%md
%md### Plots
% plot parameters
lw = 2.0 ; ms = 11 ; plotFontSize = 10 ;
fig = figure;
hold on, grid on

% node to plot the solution
node = 5 ;
dofX = node * 6 - 5 ;
ubNum = matUs(dofX, :) ;

%
plot(ubNum, pressure_vals, 'b-o', 'linewidth', lw,'markersize', ms)
plot(ubAna, pressure_vals, 'g-x', 'linewidth', lw,'markersize', ms)

%
legend ({'FEM', 'Analytic',}, 'location', 'east');
labx = xlabel('u_b'); laby = ylabel('p') ;
tit = title('p-u_b');
set(labx, 'fontsize', plotFontSize*.8);
set(laby, 'fontsize', plotFontSize*.8);
set(tit, 'fontsize', plotFontSize);

% Check solution
% analyticCheckTolerance = 1e-2 ;
% verifBoolean = ( ( ubNum(end) - ubAna(end) ) < analyticCheckTolerance ) ;

% verifboolean de ambos analisis
%md The numerical solution is verified:
%md
%md### Verificaation
%md The numerical solution is verified for both cases:
analyticCheckTolerance = 1e-2 ;
verifBoolean = ( ( numericalRi - analyticValRi ) < analyticCheckTolerance ) && ...
( ( numericalRe - analyticValRe ) < analyticCheckTolerance ) && ...
Expand Down

0 comments on commit 807eee2

Please sign in to comment.