ISE 7510 - HW 1 – Numerical problems
Name - Chaitanya Karwa
1 21-a - Variation in values of n.
Remarks –
The plot shows that the maximum uniform strain increases with the value of n. This is
𝑛
expected as 𝑒𝑢 ∝ . Hence, as n increases 𝑒𝑢 increases too.
1−𝑚
2 21-b – Variation in values of m
Remarks –
The plot shows that m has a significant effect on the post uniform elongation of the
specimen. As m increases the post uniform elongation increases too.
3 21-c – Variation in strain rates
Remarks –
The plot shows that the Eng. Stress increases for higher strain rates or velocity. This is in
agreement with observations in experiments (jump test)
4 21 d – Constant true strain rate
Remarks –
The graphs exactly coincide with each other as the ‘k’ is scaled according to the conditions in
the question
5 21 e
Remarks –
The plot shows that strain decreases as the taper in the specimen increases.
6 25 a – Variation in time steps for implicit
Remarks –
The plot shows that the Stress-strain curve converges at around 600 time steps. The error
observed in the data is also very small for 600 time steps.
7 25 b – Implicit and explicit schemes
Remarks –
The plot shows that there is no difference in the explicit and implicit shceme for large
enough time steps (2000)
8 25 c – Variation in 𝛽 error plot
Remarks –
The percentage error plot is shown above. We can observe that 𝛽 = 5 gives the best results
for a specific number of time steps. As the number of time steps increase the trend between
the values of B might change as observed in the graph above. Concluding, neither fully
implicit nor fully implicit is the most efficient solution
9 CODE – Fully/semi implicit
% Fully/Semi implicit
%% Problem variables
clc;clear all;
b=1;
plotstyle={'--k+','--k<','--k*','--ks','--ko'};
loop=0;
tstepsdat=[200,2000,4000,6000,8000];
B=[0,0.25,0.5,0.75,1];
errer=zeros(length(tstepsdat),length(B));loop=0;
pererror=errer;
for B=[0,0.25,0.5,0.75,1]
for tsteps=[200,700,1200,2000,3000]
loop=loop+1;
elements=10; % no. of elements
m=0.05;
n=0.25;
k=100/(0.01)^n;
epscdot=0.1; % strain rate at center
% tsteps=500; % Number of time steps
dt=20/tsteps; %time step
eps=zeros(elements,tsteps); % initialize strain matrix for element number and time
epsdot=eps;
A=zeros(elements,1); % element areas
for i=1:elements
A(i)=(((1-0.9)/(9))*(i-1)+0.9);
end
%% Boundary conditions
% time 0 corresponds to eps(i,1) here
eps(:,1)=0;
for i=1:elements
epsdot(i,1)=((A(1)/A(i))^(1/m))*epscdot;
end
% B=1;
%% Time loop
for j=2:tsteps+1
for i=1:10
tol=1;
epsdot(i,j)=epsdot(i,j-1); % guess
iter=0;
while tol>1e-6 && iter<30 % tolerance
temp=epsdot(i,j);
eps(i,j)=eps(i,j-1)+B*epsdot(i,j)*dt+(1-B)*epsdot(i,j-1)*dt;
common=(A(1)/A(i)*exp(eps(i,j)-eps(1,j))*(eps(1,j)/eps(i,j))^n)^(1/m);
f=(common)*epscdot-epsdot(i,j);
fdot=common*epscdot*(1/m)*(1-n/eps(i,j))*dt-1;
epsdot(i,j)=epsdot(i,j)-f/fdot;
% eps(i,j)=temp+epsdot(i,j)*dt;
tol=abs(epsdot(i,j)-temp);
iter=iter+1;
end
end
end
sigma=k*(eps.^(n)).*(epsdot/0.1).^m;
accurate=[2.00000000000025;0.386162008532207;0.319118065322386;0.278455407032485;0.24915988072
1629;0.226321828544877;0.207683888176384;0.192009960699581;0.178545374923551;0.166793579749586
]
for y=2:10
errer(loop)=errer(loop)+sqrt(((eps(y,tsteps+1)-accurate(y))^2)/9);
pererror(loop)=errer(loop)/(0.2542)*100
end
% engstrain=exp(eps(5,:))-1;
% engstress=sigma(5,:)./(1+engstrain(1,:));
% plot(engstrain,engstress)
% hold on
%% Other calculation
end
plot(tstepsdat,pererror(:,b),plotstyle{b})
hold on
%plot(eps(5,:),sigma(5,:),plotstyle{b});
%hold on
legendinfo{b}=['B=' num2str(B)];
b=b+1
end
legend(legendinfo)
xlabel('tsteps')
ylabel('%error')
10 CODE – Explicit
% Fully explicit
%% Problem variables
clc;clear all;
% dt=0.2; %time step
elements=10; % no. of elements
plotstyle={'kx','k<','k*','ks','ko'};
b=1;
% for f=[0.999,0.99,0.9,0.7,0.5]
f=0.99
n=0.25;
m=0.05;
% k=100/(0.01)^n;
k=100/(0.01)^n;
initiallen=0.0254;
epscdot=0.1; % strain rate at center
tsteps=2000; % Number of time steps
dt=20/tsteps;
eps=zeros(elements,tsteps); % initialize strain matrix for element number and time
length=eps;
totlen=zeros(1,tsteps);
force=totlen;
length(:,1)=2.54e-3;
epsdot=eps;
A=zeros(elements); % element areas
for i=1:elements
% A(i)=(0.99+0.001*i)*1e-6;
A(i)=(1-f)/(10-1)*(i-1)+f
end
%% Boundary conditions
% time 0 corresponds to eps(i,1) here
eps(:,1)=0;
for i=1:elements
epsdot(i)=((A(1)/A(i))^(1/m))*epscdot;
end
%% Time loop
for j=2:tsteps+1
for i=1:10
eps(i,j)=eps(i,j-1)+epsdot(i,j-1)*dt;
epsdot(i,j)=((A(1)/A(i)*exp(eps(i,j)-eps(1,j))*(eps(1,j)/eps(i,j))^n)^(1/m))*epscdot;
length(i,j)=length(i,1)*exp(eps(i,j));
% A(i,j)=A(i,1)*exp(-eps(i,j));
end
end
%% Other calculation
sigma=k*(eps.^(n)).*(epsdot/0.1).^m;
engstrain=exp(eps(5,:))-1;
engstress=sigma(5,:)./(1+engstrain(1,:));
% plot(engstrain,engstress,plotstyle{b})
plot(engstrain,engstress,'k','HandleVisibility','off')
hold on
plot(engstrain([Link]nd),engstress(([Link]nd)),plotstyle{b})
legendinfo{b}=['f=' num2str(f)];
b=b+1;
% end
% legend(legendinfo)
title('Eng Stress vs Strain')
xlabel('Eng Strain');
ylabel('Eng Stress')
grid on