-
Notifications
You must be signed in to change notification settings - Fork 0
/
tranter_plot.m
47 lines (38 loc) · 1.04 KB
/
tranter_plot.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
% load original data
[table, hours, fitness] = tranter_table();
smooth_hours = hours(1):0.5:hours(end);
smooth_fitness = fitness(1):5:fitness(end);
% use derived function
fittable = zeros(length(smooth_fitness), length(smooth_hours));
for f=1:length(smooth_fitness)
fittable(f, :) = tranter(smooth_hours, smooth_fitness(f));
end
close all;
figure('Name', 'Table vs. Synthetic Table');
subplot(2,1,1);
surf(hours, fitness, table);
zlim([0 50]);
title('Tranter''s table');
xlabel('Time [h]');
ylabel('Fitness [min]');
zlabel('Time'' [h]');
subplot(2,1,2);
surf(smooth_hours, smooth_fitness, fittable);
zlim([0 50]);
title('Synthetic table');
xlabel('Time [h]');
ylabel('Fitness [min]');
zlabel('Time'' [h]');
% use derived function
fittable = zeros(size(table));
for f=1:length(fitness)
fittable(f, :) = tranter(hours, fitness(f));
end
fittable(isnan(table)) = NaN;
figure('Name', 'Error Plane');
surf(hours, fitness, table - fittable);
title('Error surface');
xlabel('Time [h]');
ylabel('Fitness [min]');
zlabel('Time'' Error [h]');
round(fittable*4)/4