@@ -24,6 +24,9 @@ function runexperiments(user)
24
24
% localization
25
25
localize = user .localize ;
26
26
27
+ % numberof samples for averaging runs
28
+ numsamples = user .ns ;
29
+
27
30
%% Remaining code%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
28
31
% rank histogram for the 1st state only (for now)
29
32
histvar = 1 : 1 : 1 ;
@@ -62,21 +65,44 @@ function runexperiments(user)
62
65
switch modelname
63
66
case ' Lorenz63'
64
67
natureODE = otp .lorenz63 .presets .Canonical ;
68
+ nature0 = randn(natureODE .NumVars , 1 ); % natureODE.NumVars are the number of variables for the model
69
+ natureODE.TimeSpan = [0 , Dt ];
70
+
65
71
modelODE = otp .lorenz63 .presets .Canonical ;
72
+ modelODE.TimeSpan = [0 , Dt ];
73
+
74
+ % Propogate the model
75
+ [tt , yy ] = ode45(natureODE .RHS .F , [0 , 10 ], nature0 );
76
+ natureODE.Y0 = yy(end , : ).' ;
66
77
case ' Lorenz96'
67
78
natureODE = otp .lorenz96 .presets .Canonical ;
79
+ nature0 = randn(natureODE .NumVars , 1 ); % natureODE.NumVars are the number of variables for the model
80
+ natureODE.TimeSpan = [0 , Dt ];
81
+
68
82
modelODE = otp .lorenz96 .presets .Canonical ;
83
+ modelODE.TimeSpan = [0 , Dt ];
84
+
85
+ % Propogate the model
86
+ [tt , yy ] = ode45(natureODE .RHS .F , [0 , 10 ], nature0 );
87
+ natureODE.Y0 = yy(end , : ).' ;
88
+ case ' QG'
89
+ natureODE = otp .qg .presets .Canonical(' Size' , [63 , 127 ]);
90
+ nature0 = natureODE .Y0 ;
91
+ natureODE.TimeSpan = [0 , Dt ];
92
+
93
+ modelODE = otp .qg .presets .Canonical(' Size' , [63 , 127 ]);
94
+ modelODE.TimeSpan = [0 , Dt ];
69
95
end
70
96
71
- nature0 = randn(natureODE .NumVars , 1 ); % natureODE.NumVars are the number of variables for the model
72
- natureODE.TimeSpan = [0 , Dt ];
97
+ % nature0 = randn(natureODE.NumVars, 1); % natureODE.NumVars are the number of variables for the model
98
+ % natureODE.TimeSpan = [0, Dt];
73
99
74
100
75
- modelODE.TimeSpan = [0 , Dt ];
101
+ % modelODE.TimeSpan = [0, Dt];
76
102
77
103
% Propogate the model
78
- [tt , yy ] = ode45(natureODE .RHS .F , [0 , 10 ], nature0 );
79
- natureODE.Y0 = yy(end , : ).' ;
104
+ % [tt, yy] = ode45(natureODE.RHS.F, [0, 10], nature0);
105
+ % natureODE.Y0 = yy(end, :).';
80
106
81
107
% initialize model
82
108
model = datools .Model(' Solver' , solvermodel , ' ODEModel' , modelODE );
@@ -142,7 +168,7 @@ function runexperiments(user)
142
168
ensN = ensNs(ensNi );
143
169
end
144
170
145
- ns = 1 ;
171
+ ns = numsamples ;
146
172
sE = zeros(ns , 1 );
147
173
148
174
for sample = 1 : ns
0 commit comments