Randomisation of ramberg osgood equation

I am trying to randomise the ramberg osgood equation to find out different values of strains as a response to random stress values set between a range of 100 MPa to 300MPa. The ramberg osgood equation is; delta(epsilon{strain})/2 = delta(sigma{stress})/2 + ( delta(sigma{stress})/2K' )^n' . The values of K' and n' are constant for materials and need not be randomised for my application. I just want to randomise delta(sigma{stress}) to obtain randomised values of delta(epsilon{strain}) .
Until now I have written the code to generate random numbers in the range -
a = 100;
b = 300;
r = (b-a).*rand(10000,1) + a;
Later I was thinking of using the for loop to put these numbers one by one into the equation and but haven't been able to figure out. Can someone please help me with this. The strain values obtained for the first iteration of strain must be the input for second iteration of stresses

 Respuesta aceptada

Más respuestas (2)

Alan Stevens
Alan Stevens el 12 de Jul. de 2021
You don't need a loop. Yu can just do
deltaepsilon = r/E + 2*(r/(2*Kp)).^(1/np);
where Kp = K' and np = n'.
Note that you need to use .^ (dot^) not just ^ in order to make it an element by element operation.

6 comentarios

Parth Kulkarni
Parth Kulkarni el 12 de Jul. de 2021
Thanks for the response. The syntax you have is working. But how do I take an outpout from the first iteration of operation as the input for the second iteration? How will the system automatically take random stress inputs from the rand function?
Alan Stevens
Alan Stevens el 12 de Jul. de 2021
Your values of r are the random values of deltasigma. There are 10000 of them with values between 100 and 300 (If you need them in Pa rather than MPa just multiply r by 10^6). (You could have used the variable name deltasigma instead of r).
Parth Kulkarni
Parth Kulkarni el 12 de Jul. de 2021
But this would only generate one iteration of the equation
Alan Stevens
Alan Stevens el 12 de Jul. de 2021
No, this generates 10000 values of deltaepsilon.
a = 115;
b = 234;
r = (b-a).*rand(100,1) + a;
sr=size(r);
sr1=sr(1);
kp=1320;
np=0.177
E=21e+06;
sg1=r(1)
e1 =((r/2*E) + ((r/2*kp).^1/np))*2
nn=0;
for nn=1:sr1
if nn==1
ee(nn)=e1
else
ee(nn)=2*(((r(nn)/(2*E))+(r(nn)/(2*kp)).^(1/np))-ee(nn-1))
end
end
I wrote this code to randomise stresses for each iteration with a loop to include the strain of previous iteration as the input of second. The only problem I am getting in this is the value of strain is very high. INstead of 10^-6 I am getting strain in 10^6. What could be the issue?
Be careful about ensuring E and kp are in the denominator; also that the power is (1/np).
a = 115;
b = 234;
r = (b-a).*rand(1000,1) + a;
sr=size(r);
sr1=sr(1);
kp=1320;
np=0.177;
E=21e+06;
sg1=r(1);
e1 =( r/(2*E) + (r/(2*kp)).^(1/np) )*2; %%% Make sure E and kp are in the
%%% denominator and the power is
%%% (1/np)!!!
ee = [e1(1); diff(e1)];
histogram(ee,20)
xlabel('ee'), ylabel('frequency')

Iniciar sesión para comentar.

Parth Kulkarni
Parth Kulkarni el 12 de Jul. de 2021
I am randomising the Kp and np along with stresses now ..... is this code correct?
a = 115;
b = 234;
r = (b-a).*rand(1000,1) + a;
sr=size(r);
sr1=sr(1);
kp=(1500-750).*rand(1000,1) + 1500;
kpr=size(kp);
kp1=kp(1);
np=(1-0).*rand(1000,1) + 1;
npr=size(np);
np=np(1);
E=21e+06;
sg1=r(1);
e1 =( r/(2*E) + (r/(2*kp)).^(1/np) )*2; %%% Make sure E and kp are in the
%%% denominator and the power is
%%% (1/np)!!!
ee = [e1(1); diff(e1)];
histogram(ee,20)
xlabel('ee'), ylabel('frequency')

4 comentarios

Alan Stevens
Alan Stevens el 12 de Jul. de 2021
You will need r./(2*kp).^(1./np)
Notice all the dots!
Parth Kulkarni
Parth Kulkarni el 12 de Jul. de 2021
Oh yes . I will try
%% Normally distributed randomised stress distribution%%
sigma_a = 250;
sigma_b = 350;
stress_range = (sigma_b - sigma_a).*rand(30000,1) + sigma_a;
%%%% Normally distributed k values%%
k_1 = 950;
k_2 = 1350;
k_range = (k_2 - k_1).*rand(30000,1) + k_1;
%% Normally ditributed c values%%
c_1 = 0.3;
c_2 = 0.7;
c_range = (c_2 - c_1).*rand(30000,1) + c_1;
%% Normally distributed b values%%
b_1 = 0.14;
b_2 = 0.19;
b_range = (b_1 - b_2).*rand(30000,1) + b_1;
%% Normally distributed n values%%
n_1 = 0.2;
n_2 = 0.7;
n_range = (n_1 - n_2).*rand(30000,1) + n_1;
%% Strain calculation using ramberg osgood model%%
E=21e+06;
e1 =((stress_range)/(2*E) + (stress_range/(2*k_range)).^(1/n_range))*2; %%% Make sure E and kp are in the
%%% denominator and the power is
%%% (1/np)!!!
ee = [e1(1); diff(e1)];
histogram(ee,20);
xlabel('ee'), ylabel('frequency')
%% I am using this code to randomise the k, n and stress values for to obtain the subsequent strains developed for all 30000 values. But it is giving an error in the line 32. I want to save all the values of strains developed from their subsequent stress, k and n values so that I can find the sensitivity of randomising these values with the strains developed.%%
Parth Kulkarni
Parth Kulkarni el 11 de Abr. de 2022
I have written down my main motive behind the code at the bottom

Iniciar sesión para comentar.

Categorías

Más información sobre Stress and Strain en Centro de ayuda y File Exchange.

Productos

Versión

R2021a

Preguntada:

el 12 de Jul. de 2021

Comentada:

el 11 de Abr. de 2022

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by