-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplots_script.m
More file actions
89 lines (82 loc) · 2.54 KB
/
Copy pathplots_script.m
File metadata and controls
89 lines (82 loc) · 2.54 KB
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
77
78
79
80
81
82
83
84
85
86
87
88
89
figure
g = 4;
for j = 1:g
subplot(g/2,2,j)
contourf(M(:,:,j*floor(length(timeVector)/g)),'ShowText','on','LevelStepMode',...
'manual','LevelStep',tenCont);
xlabel('x position (node)'); ylabel('y position (node)')
lbl = num2str(timeVector(j*floor(length(timeVector)/g)));
lbl = [lbl,' seconds'];
ttl = ['Time = ',lbl]; title(ttl);
set(gca,'Ydir','reverse');
axis equal
end
tempInitStr = [',it' num2str(tempInitial)];
powerInputStr = [',pi' num2str(powerInput)];
nameStr = 'Transient';
pathStr = strcat(simTitle,nameStr,tempInitStr,powerInputStr);
pathStr = fullfile('latex','figures',pathStr);
if strcmp(prnt,'Yes') == 1
print(pathStr,'-depsc')
else
end
figure
contourf(M(:,:,length(timeVector)-1),10,'ShowText','on');
grid on
xlabel('x position (node)'); ylabel('y position (node)')
lbl = num2str(timeVector(end));
lbl = [lbl,' seconds'];
ttl = ['Temperature Distribution at ',lbl]; title(ttl);
set(gca,'Ydir','reverse');
axis equal
nameStr = 'Dist';
pathStr = strcat(simTitle,nameStr,tempInitStr,powerInputStr);
pathStr = fullfile('latex','figures',pathStr);
if strcmp(prnt,'Yes') == 1
print(pathStr,'-depsc')
else
end
figure
plot(timeVector,sysOutput(:,1),'LineWidth',2)
hold on
plot(timeVector,sysOutput(:,n),'-.','LineWidth',2)
plot(timeVector,sysOutput(:,m*n),'LineWidth',2)
plot(timeVector,sysOutput(:,m*n-(n-1)),'--','LineWidth',2)
plot(timeVector,sysOutput(:,ceil(m*n/2)),'LineWidth',2)
xlabel('Time (seconds)'); ylabel('Temperature (Degrees Celcius)');
legend('Bottom Left','Top Left','Top Right','Bottom Right','Center Element')
title('Temperature Response')
nameStr = 'Response';
pathStr = strcat(simTitle,nameStr,tempInitStr,powerInputStr);
pathStr = fullfile('latex','figures',pathStr);
if strcmp(prnt,'Yes') == 1
print(pathStr,'-depsc')
else
end
timeSim/60;
timeSimSec = num2str(timeSim,3);
timeSimMin = num2str(timeSim/60,3);
if timeSim <= 60
disp(['Simulation Run time = ',timeSimSec,' seconds'])
else
disp(['Simulation Run time = ',timeSimMin,' minutes'])
end
figure
for i = 0:n-1
powerMap(:,i+1) = sysB(i*n+1:i*n+n,1);
end
powerMap = [powerMap zeros(n,1)]; powerMap = [powerMap;zeros(1,n+1)];
pcolor(powerMap);
colormap(gray(2));
colormap(flipud(colormap));
xlabel('x position (node)'); ylabel('y position (node)')
set(gca,'Ydir','reverse'); set(gca,'YTick',[]); set(gca,'XTick',[]);
axis square
title('Power Input Map')
nameStr = 'Map';
pathStr = strcat(simTitle,nameStr,tempInitStr,powerInputStr);
pathStr = fullfile('latex','figures',pathStr);
if strcmp(prnt,'Yes') == 1
print(pathStr,'-depsc')
else
end