Plot summation series | For Loop | Creep Strain

Hi,
Need some assistance in plotting the below equation. I don't know why it is not coming out right. Below is my code and the plot below shows the expected results. Appreciate any feedback.
See picture at the bottom for equation to plot (strain vs time)
t=0:10000 (in seconds)
sigma0=100 MPa
D0= 360e-6 MPA^-1
D1=11.05e-6 MPa^-1; tr1=10 s;
D2=12.27e-6 MPa^-1; tr2=100 s;
D3=17.35e-6 MPa^-1; tr3=1000 s;
D4=21.63e-6 MPa^-1; tr4=10000 s;
D5=13.13e-6 MPa^-1; tr5=100000 s;
D6=41.78e-6 MPa^-1; tr6=1000000 s;
r in the summation series goes from r=1 to r=6 representing the D1,D2,D3,D4,D5,D6
clear all;clc
%% Linear Creep Example
s=100; % constant tensile stress, (MPa)
t=linspace(0,10000,11); % duration of applied stress on specimen (seconds)
D=[11.05e-6 12.27e-6 17.35e-6 21.63e-6 13.13e-6 41.78e-6]; % Prony series coefficients, (MPA^-1)
ta=[10 100 1000 10000 100000 1000000]; % seconds
% D1=11.05e-6;ta1=10;
% D2=12.27e-6;ta2=100;
% D3=17.35e-6;ta3=1000;
% D4=21.63e-6;ta4=10000;
% D5=13.13e-6;ta5=100000;
% D6=41.78e-6;ta6=1000000;
% strn=s*(D(1)*(1-exp(-t(1)/ta(1))) + D(2)*(1-exp(-t(1)/ta(2))) + D(3)*(1-exp(-t(1)/ta(3)))...
% + D(4)*(1-exp(-t(1)/ta(4))) + D(5)*(1-exp(-t(1)/ta(5))) + D(6)*(1-exp(-t(1)/ta(6))));
strn=zeros(1,11);
for i=1:11
for n=1:6
strn(i)=s*(D(n)*(1-exp(-t(i)/ta(n))));
end
end
plot(t,strn)

 Risposta accettata

VBBV
VBBV il 10 Apr 2022
Modificato: VBBV il 10 Apr 2022
clear all;clc
%% Linear Creep Example
s=100; % constant tensile stress, (MPa)
t=linspace(0,10000,11); % duration of applied stress on specimen (seconds)
D=[11.05e-6 12.27e-6 17.35e-6 21.63e-6 13.13e-6 41.78e-6]; % Prony series coefficients, (MPA^-1)
ta=[10 100 1000 10000 100000 1000000]; % seconds
% D1=11.05e-6;ta1=10;
% D2=12.27e-6;ta2=100;
% D3=17.35e-6;ta3=1000;
% D4=21.63e-6;ta4=10000;
% D5=13.13e-6;ta5=100000;
% D6=41.78e-6;ta6=1000000;
% strn=s*(D(1)*(1-exp(-t(1)/ta(1))) + D(2)*(1-exp(-t(1)/ta(2))) + D(3)*(1-exp(-t(1)/ta(3)))...
% + D(4)*(1-exp(-t(1)/ta(4))) + D(5)*(1-exp(-t(1)/ta(5))) + D(6)*(1-exp(-t(1)/ta(6))));
strn=zeros(1,11);
for i=1:11
for n=1:6
strn(n,i)=(D(n)*(1-exp(-t(i)/ta(n)))); % multiply the s outside the summation
end
Strn(i) = s*sum(strn(:,i)); % multiply with s here
end
plot(t,Strn)
Multiply with s outside of the summation.

Più risposte (1)

How about the following?
s = 100; % constant tensile stress, (MPa)
t = linspace(0, 10000)'; % duration of applied stress on specimen (seconds)
D = [11.05e-6 12.27e-6 17.35e-6 21.63e-6 13.13e-6 41.78e-6]; % Prony series coefficients, (MPA^-1)
ta = [10 100 1000 10000 100000 1000000]; % seconds
dim = 2;
strn = s*sum(D.*(1-exp(-1*t./ta)), dim);
figure
plot(t, strn)
xlabel("Time [sec]")
ylabel("Strain \epsilon(t)")

2 Commenti

s = 100; % constant tensile stress, (MPa)
t = linspace(0, 10000)'; % duration of applied stress on specimen (seconds)
D = [11.05e-6 12.27e-6 17.35e-6 21.63e-6 13.13e-6 41.78e-6]; % Prony series coefficients, (MPA^-1)
ta = [10 100 1000 10000 100000 1000000]; % seconds
dim = 2;
strn = s*Do+s*sum(D.*(1-exp(-1*t./ta)), dim);
figure
plot(t, strn)
xlabel("Time [sec]")
ylabel("Strain \epsilon(t)")
@Akira Agata and @VBBV I believe this should solve my problem
Yes,by adding an offset Do, your code seems to produce what you have shown in the figure.

Accedi per commentare.

Categorie

Scopri di più su Simulation, Tuning, and Visualization in Centro assistenza e File Exchange

Prodotti

Release

R2021b

Richiesto:

mpz
il 10 Apr 2022

Commentato:

il 10 Apr 2022

Community Treasure Hunt

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

Start Hunting!

Translated by