-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcompute_true_solution.m
More file actions
28 lines (26 loc) · 829 Bytes
/
Copy pathcompute_true_solution.m
File metadata and controls
28 lines (26 loc) · 829 Bytes
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
function [XT, T, X, XM] = compute_true_solution(params, N, Ne, Nt, dtObs)
% Computes the true solution from bivariate Lorenz 96
% for use in data assimilation scheme
%
% INPUTS:
% params is a struct containing parameters for the bivariate Lorenz 96 model
% N is the total number of state variables
% Ne is the ensemble size
% Nt is the nubmer of assimilation cycles
% dtObs is the time between assimilation cycles
%
% OUTPUTS:
% XT is the true solution
% T is the time
% X is an intialized ensemble
% XM is initialized to store ensemble mean
%
% Authors: Ian Grooms and Zofia Stanley
% Compute true solution
[T,XT] = ode45(@(t,y) RHS_L96(t,y,params),[0 linspace(10,10+Nt*dtObs,Nt)],randn(N,1));
XT = XT(2:end,:)'; T = T(2:end);
% Initialize ensemble
X = XT(:,1) + randn(N,Ne);
% Store ensemble mean
XM = zeros(size(XT));
end