Description Usage Arguments Value Examples
Simulate data from the lorenz63 model
1 2 |
duration |
total time to integrate model (duration=freq*(nsteps-1) (nsteps = duration/freq + 1) |
freq |
frequency of time integration (freq=duration/(nsteps-1)) |
params |
named vector (sigma, rho, beta) for the dynamics |
sig |
standard deviation of error measurments |
obs_type |
(all: all sites, odd: every other site, partial: regular observations at nobs sites, one: unique observation in the middle) |
R_sig |
standard deviation of error measurements for assimilation (default=sig) |
deltat |
time interval for model integration |
... |
additional arguments passed to lorenz_observe (e.g. nobs in case obs_type=partial) |
list with: state.ts matrix of nsteps x ndim y.ts list of nsteps lists, each of them containing y, R, H, d and y.loc (sites which are observed) f.propagate function to propagate the ensemble according to the model specification f.propagate <- function(state=initial state, nsteps=how many steps to propagate, ...) ndim, duration and freq to keep track of some parameters
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | l63_run <- l63_simulate(100*1/5, 1/5, deltat=1/75, sig=3)
lorenz_plot(l63_run$state.ts[101,], l63_run$y.ts[[101]])
l63_df <- lorenz_as_df(l63_run$state.ts) %>%
rename(time=x, variable=ensemble)
l63_df$variable <- factor(l63_df$variable, levels = c('ens_1', 'ens_2', 'ens_3'), labels=c('x(1)', 'x(2)', 'x(3)'))
l63_y_df <-
foreach(i=1:length(l63_run$y.ts), .combine='rbind')%do%{
yy <- l63_run$y.ts[[i]]
data_frame(variable=paste('x(',yy$y.loc,')',sep=''), value=yy$y, time=i)
}
l63_df %>%
ggplot(aes(x=time, y=value)) + geom_line() +
geom_point(data=l63_y_df, aes(x=time, y=value), color='red')+
facet_wrap(~variable, ncol=1) +
theme_bw()
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.