Undefined function or variable 'deltxi'
Show older comments
% conversion to detwinned martensite
% Material properties for the nitinol alloy used in[Dye, 1990; Liang, 1990].
% Dm modulus value for the SMA as 100% martensite in MPa
Dm = 26300;
% Da modulus value for the SMA as 100% austenite in MPa
Da = 67000;
% theta is thermal coefficeint of expansion for SMA material in MPa per degree celsius
theta = 0.55;
% Transformation Temperature
% As = austenite start temparature in degree
As = 34.5;
% Af = austenite finish temparature in degree
Af = 49;
% Ms = martensite start temparature in degree
Ms = 18.4;
% Mf = martensite finish temparature in degree
Mf = 9;
Q = 0:100:600; % Applied stress
T = 50; % Applied Temperature
aA=3.1416/(Af-As);
aM=3.1416/(Ms-Mf);
% Transformation Constants
% The constants Cm and Ca both in MPa per degree celsius, are material properties that describe the relationship of temperature and the critical stress to induce transformation,
Cm = 8;
Ca = 13.8;
% It is assumed that the critical stress values below M, to be constant and denoted by Qscr and Qfcr for the critical stresses at the start and finish of the conversion of the martensitic variants.
Qscr = 100;
Qfcr = 170;
% El is maximum residual strain
El = 0.067;
% where Xit represents the fraction of the material that is purely temperature-induced martensite with multiple variants, and Xis denotes the fraction of the material that has beentransformed by stress into a single martensitic variant.
% conversion to detwinned martensite
% initial condition
Xiso=0;
Xito=1;
Xio=0;
Q = 0:100:600;
T=12;
if T > Ms & (Qscr + Cm*(T-Ms)) < Q < (Qfcr + Cm*(T-Ms))
Xis = ((1-Xiso)/2)*cos((pi/(Qscr-Qfcr))*(Q-Qfcr-Cm*(T-Ms)))+((1+Xiso)/2);
Xit = Xito - Xito*(Xis-Xiso)/(1-Xiso) ;
elseif T < Ms & Qscr < Q < Qfcr
Xis = ((1-Xiso)/2)*cos((pi/(Qscr-Qfcr))*(Q-Qfcr))+((1+Xiso)/2);
Xit = Xito - Xito*(Xis-Xiso)/(1-Xiso) + deltxi;
elseif Mf < T< Ms & T<To
deltxi = (1-Xito)/2*(cos(aM*(T-Mf))+1);
else deltxi=0;
end
% Conversion to austenite
if T > As & Ca*(T-Af)< Q <Ca*(T-As)
Xi = 1;
Xis=Xiso;
Xit=Xito;
%aA=3.1416/(Af-As);
end
% Xi has been considered to simply represent the percentage of the material transformed to martensite.
% Let Xi be further defined by
Xi = Xis + Xit;
% A reasonable assumption for the modulus function of an SMA material is
DXi = Da+Xi*(Dm-Da);
% Transformation Tensor is dedonted by omega, Q
QXi = -El*DXi;
% final constitutive equation
Qo=0; % stress induced martensite
To=24;
%Q = Qo+DXi*E-Dm+QXi*Xis-(-El*Dm)*1+ theta*(T-To);
E=(Q-Qo+Dm+QXi*Xis+(-El*Dm)*1-theta*(T-To))/DXi;
% strain is denoted by E
plot(E,Q)
Answers (1)
Stephen23
on 30 Jun 2018
On this line:
Xit = Xito - Xito*(Xis-Xiso)/(1-Xiso) + deltxi;
and this line:
else deltxi=0;
the variable deltxi is (likely) used before it is defined. You need to fix that bug by fixing your algorithm, e.g. by doing one/more of these: defining a default value, allowing for the case that deltxi is not defined, ensure that deltxi is calculated bore it is used, etc.
Categories
Find more on Thermal Analysis in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!