31 s.m= models.BaseFullModel;
34 s.m.Sampler= sampling.RandomSampler;
35 s.m.Sampler.Samples= 10;
36 s.m.System.MaxTimestep= s.m.dt;
37 s.m.ODESolver= solvers.ExplEuler;
39 a = approx.KernelApprox(s.m.System);
40 ap = approx.algorithms.VKOGA;
41 ec = kernels.config.ParamTimeExpansionConfig;
42 ec.StateConfig= kernels.config.GaussConfig(
" G ",1:2);
43 ec.ParamConfig= kernels.config.GaussConfig(
" G ",.1:.1:.3);
45 ap.MaxExpansionSize= 5;
49 s.TimeKernel= kernels.NoKernel;
51 s.Kernel= kernels.GaussKernel(2);
52 s.ParamKernel= kernels.GaussKernel(2);
58 s.Inputs[2] = @(
t)sin(4*
t);
60 s.Inputs= s.Inputs(1:s.testinputs);
63 s.params(1) =
struct(
" Name ",
" P1 ",
" MinVal ", -1,
" MaxVal ", 1,
" Desired ", 10,
" Default ", 0);
64 s.params(2) =
struct(
" Name ",
" P2 ",
" MinVal ", 2,
" MaxVal ", 3,
" Desired ", 5,
" Default ", 2.5);
65 s.params(3) =
struct(
" Name ",
" P3 ",
" MinVal ", 0,
" MaxVal ", 10,
" Desired ", 6,
" Default ", 5);
66 s.params= s.params(1:s.testparams);
69 muidx = randi(s.testparams,s.testdim,1);
70 s.B= @(
t,mu)ones(s.testdim,1);
71 s.B_p= @(
t,mu)ones(s.testdim,1).*mu(muidx);
74 musel = (rand(s.testdim,1)<.5);
75 s.x0= dscomponents.ConstInitialValue(rand(s.testdim,1));
76 av = dscomponents.AffineInitialValue;
77 av.addMatrix([
" mu( " num2str(randi(s.testparams))
" ) "],musel .* rand(s.testdim,1));
78 av.addMatrix(
" .5 + mu(1) ",5*rand(s.testdim,1));
82 muidx = randi(s.testparams,s.testdim,1);
83 A = rand(s.testdim,s.testdim);
85 s.flin_p= @(x,
t,mu)(A + diag(mu(muidx)))*x;
88 randx = randi(s.testdim);
89 randmu = randi(s.testparams);
90 s.fnlin_p= @(x,
t,mu)(.5+t/2)*sin(x) + x(randx)*mu(randmu);
91 s.fnlin= @(x,
t,mu)(.5+t/2).*sin(x);
function s = testsettings()
TESTSETTINGS KerMor test settings collection.