-
Notifications
You must be signed in to change notification settings - Fork 2
/
choose_th.m
34 lines (31 loc) · 878 Bytes
/
choose_th.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
% Choose thermal properties
thid=-1;
while (thid<0)|(thid>2)
disp('Available profile types');
disp(' 1: linear profile');
disp(' 2: erf profile');
thid=input('Enter ID for the type of thermal profile');
end
if isempty(thid); thid=1; end
ans=input(sprintf('Default surface temperature is %gC; Enter chosen Ts: ',Ts-Celsius));
if ~isempty(ans)
Ts=ans+Celsius;
end
ans=input(sprintf('Default surface T gradient is %g K/km; Enter chosen G: ',G*1000));
if ~isempty(ans)
G=ans/1000;
end
%if thid==2;
ans=input(sprintf('Default adiabatic temperature is %gC; Enter chosen Ti: ',Ti-Celsius))+Celsius;
if ~isempty(ans)
Ti=ans+Celsius;
end
%end
del=2*(Ti-Ts)/(G*sqrt(pi));
% setup temperature
switch thid
case 2
Temperature=@(z)Ts+(Ti-Ts)*erf(z/del);
otherwise
Temperature=@(z)min(Ts+z*G,Ti);
end