E1 =4.92e4;
E2 =2.76e3;
E3 =2.32e4;
EE =-4.159e3;
sigma_a =286.98;
sigma_b =382.363;
% MPa
epsilon_a=sigma_a/E1;
epsilon_b=epsilon_a + (sigma_b-sigma_a)/E2;
inflection=[0.05 0.04 0.03 0.02 0.01];
epsilon =[0:delta_epsilon:inflection(1) inflection(1):-delta_epsilon:0];
for i=2:length(inflection)
epsilon =[epsilon 0:delta_epsilon:inflection(i) inflection(i):-delta_epsilon:0];
elseif epsilon(i)>epsilon_b
y= sigma_b + (epsilon(i)-epsilon_b)*E3;
y= sigma_a + (epsilon(i)-epsilon_a)*E2;
z= p.y1 + (epsilon(i)-p.x1)*E1;
if epsilon(i) > epsilon_b
y= p.y1 + (epsilon(i) - p.x1)*E2;
y= p.y1 + E1*(epsilon(i)-p.x1);
y= p.y1 + (epsilon(i) - p.x1)*E2;
k1= (z-sigma_a)/(epsilon(i)-epsilon_a);