-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathinterp5DOF_test.m
71 lines (51 loc) · 1.52 KB
/
interp5DOF_test.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
%INTERP5DOF_TEST simple test case for five degree-of-freedom GB property interpolation
clear; close all
testnum = 1;
addpathdir({'cu2qu.m','q2rod.m','qmult.m','get_uuid.m','qmA2nA.m'})
%% Test Parameters
switch testnum
case 1
ninputpts = 388;
npredpts = 1000;
case 2
ninputpts = 10000;
npredpts = 10000;
end
%% random 5DOF parameters
[five,qm,nA] = get_five(ninputpts);
[five2,qm2,nA2] = get_five(npredpts);
%% get BRK function values
tic
y = GB5DOF_setup([],qm,nA);
ytrue = GB5DOF_setup([],qm2,nA2);
toc
%% Interpolation
tstart = tic;
[ypred,interpfn,mdl,mdlpars] = interp5DOF(qm,nA,y,qm2,nA2,'gpr');
toc(tstart)
%% Results
errmetrics = get_errmetrics(ypred,ytrue,'dispQ',true);
%% Plotting
paperfigure();
parityplot(ytrue,ypred)
%-----------------------------CODE GRAVEYARD-------------------------------
%{
% rmse = sqrt(immse(propList2,propOut));
% mae = mean(abs(propList2-propOut));
% o = get_ocubo(ndatapts);
% o2 = get_ocubo(npredpts);
%convert to 5DOF
% five = GBoct2five(o);
% five2 = GBoct2five(o2);
% %unpack
% qm = vertcat(five.q);
% nA = vertcat(five.nA);
% qm2 = vertcat(five2.q);
% nA2 = vertcat(five2.nA);
% [propOut,databary] = interp5DOF(qm,nA,propList,qm2,nA2,'pbary');
% o = get_ocubo(ndatapts,'random',[],8);
% o2 = get_ocubo(npredpts,'random',[],15);
% %% convert to octonions
% o = GBfive2oct(qm,nA);
% o2 = GBfive2oct(qm2,nA2);
%}