Plot summation series | For Loop | Creep Strain

3 ビュー (過去 30 日間)
mpz
mpz 2022 年 4 月 10 日
コメント済み: VBBV 2022 年 4 月 10 日
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)

採用された回答

VBBV
VBBV 2022 年 4 月 10 日
編集済み: VBBV 2022 年 4 月 10 日
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.
  1 件のコメント
mpz
mpz 2022 年 4 月 10 日
@VBBV @Akira Agata you both got it right. @VBBV you got it right first.

サインインしてコメントする。

その他の回答 (1 件)

Akira Agata
Akira Agata 2022 年 4 月 10 日
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 件のコメント
mpz
mpz 2022 年 4 月 10 日
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
VBBV
VBBV 2022 年 4 月 10 日
Yes,by adding an offset Do, your code seems to produce what you have shown in the figure.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeInterpolation についてさらに検索

製品


リリース

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by