Undefined function or variable 'Xis'
Ältere Kommentare anzeigen
% 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;
if ((Mf < T)&& (T < Ms)) && (T<To)
deltxi = (1-Xito)/2*(cos(aM*(T-Mf))+1);
else deltxi=0;
% 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;
T=12;
if (T > Ms) && all(((Qscr + Cm*(T-Ms)) < Q) && all(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) ;
end
if (T < Ms) && (all(Qscr<Q)&& all(Q< Qfcr))
Xis = ((1-Xiso)/2)*cos((pi/(Qscr-Qfcr))*(Q-Qfcr))+((1+Xiso)/2);
Xit = Xito - Xito*(Xis-Xiso)/(1-Xiso) + deltxi;
end
end
% Conversion to austenite
if (T > As) && all((Ca*(T-Af)<Q)) && all(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)
1 Kommentar
Rik
am 1 Jul. 2018
This is your third question. You should be able to format your own code now: select the code and hit the {}Code button.
Also, the error is self-explanatory: you are trying to use a variable before it is defined. Your current code is not readable, so I will not attempt to figure out where you made the mistake.
Have a read here (or here for more general advice) and here. It will greatly improve your chances of getting an answer.
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Thermal Analysis finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!