-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathSMA_Martensite_Fraction.m
76 lines (61 loc) · 1.54 KB
/
SMA_Martensite_Fraction.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
%martensite fraction
%based on :https://github.com/gabrielegilardi/FingerControl/blob/master/Code_Matlab/SMA1_Martensite_Fraction.m
function E = SMA_Martensite_Fraction(T,dTdt,sigma)
global As Af Ms Mf aA bA cA aM bM cM
global Es1 Ef1 Esave1
% As-Austetite starting temp
% Af-Austetite final temp
% Ms-Martensite starting temp
% Mf-Martensite final temp
% aA = pi/(Af-As)
% bA = -aA/cA
% cA and bA are curve fitting params for heating
% aM = pi/(Mf-Ms)
% bM = -aM/cM
% cM and bM are curve fitting params for cooling
% - T and dTdt are temp and rate of change of temp respectively, obtained
% using heat transfer function
% - sigma is the stress developed in the wire
% Bounds
Lm = Ms + sigma/cM;
Um = Mf + sigma/cM;
La = Af + sigma/cA;
Ua = As + sigma/cA;
kA = cos( aA*(T-As) + bA*sigma );
kM = cos( aM*(T-Mf) + bM*sigma );
% Heating phase
if (dTdt > 0)
if ( T < Ua )
E = Es1;
elseif ( (T >= Ua) && (T <= La) )
E = (Es1/2)*( kA + 1.0 );
else
E = 0.0;
end
if (T < Lm)
Ef1 = ( 2*E - (1+kM) ) / (1-kM);
else
Ef1 = E;
end
end
% Cooling phase
if (dTdt < 0)
if ( T > Lm )
E = Ef1;
elseif ( (T <= Lm) && (T >= Um) )
E = ((1-Ef1)/2)*kM + (1+Ef1)/2;
else
E = 1.0;
end
if (T > Ua)
Es1 = 2*E /( kA + 1.0 );
else
Es1 = E;
end
end
% If temperature constant martensite fraction does not change
if (phase == 0)
E = Esave1;
end
Esave1 = E;
% End of function