l63_simulate: Simulate data from the lorenz63 model

Description Usage Arguments Value Examples

Description

Simulate data from the lorenz63 model

Usage

1
2
l63_simulate(duration, freq, params = c(sigma = 10, rho = 28, beta = 8/3),
  sig = sqrt(0.5), obs_type = "one", R_sig = sig, deltat = 1/75, ...)

Arguments

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)

Value

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

Examples

 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()

robertsy/lorenzr documentation built on May 27, 2019, 10:33 a.m.