This is a working example which demostrates some of the new functionality.

smod <- WangThreePoolNonAutonomous_sym()
# (look at the source code of WangThreePoolNonAutonomous_sym )
plotPoolGraph(smod)

plot of chunk unnamed-chunk-1

Define initial values for the state variables

state_variable_names(smod)
## [1] "C_l" "C_b" "C_s"
iv=c(C_l=1000,C_b=5000,C_s=1000)
times<-seq(from=1,to=1000,by=10)
modrun=Model_by_PoolNames( smod=smod ,times=times ,initialValues=iv)
sol <- getSolution(modrun)

Let's see what we have computed

colnames(sol)
##  [1] "time"                               "C_l"                               
##  [3] "C_b"                                "C_s"                               
##  [5] "accumulated_influx.C_l"             "accumulated_influx.C_s"            
##  [7] "accumulated_internal_flux.C_l->C_b" "accumulated_internal_flux.C_s->C_b"
##  [9] "accumulated_internal_flux.C_b->C_s" "accumulated_outflux.C_l"           
## [11] "accumulated_outflux.C_s"            "influxes.C_l"                      
## [13] "influxes.C_s"                       "internal_fluxes.C_l->C_b"          
## [15] "internal_fluxes.C_s->C_b"           "internal_fluxes.C_b->C_s"          
## [17] "out_fluxes.C_l"                     "out_fluxes.C_s"
plot(data.frame(times=times,sol[,c('C_l','C_s','C_b')]))

plot of chunk unnamed-chunk-3

Plot fluxes as functions of time

in_fluxes <- sol[,grep('influxes',colnames(sol))]
plot( times, sol[,'influxes.C_l'] ,type='l'
  ,ylim=c(min(in_fluxes),max(in_fluxes))
)
lines( times, sol[,'influxes.C_l'] ,type='l'
  ,ylim=c(min(in_fluxes),max(in_fluxes))
)

plot of chunk unnamed-chunk-4

internal_fluxes <- sol[,grep('internal_fluxes',colnames(sol))]
plot(
  times, sol[,'internal_fluxes.C_l->C_b'] ,type='l'
  ,ylim=c(min(internal_fluxes),max(internal_fluxes))
)
lines(times,sol[,'internal_fluxes.C_b->C_s'],col='dark red')
lines(times,sol[,'internal_fluxes.C_s->C_b'],col='blue')

plot of chunk unnamed-chunk-5

Plot the stocks as functions of time

stocks <- sol[,c('C_l','C_s','C_b')]
plot(times,sol[,'C_l'],type='l',ylim=c(min(stocks),max(stocks)))
lines(times,sol[,'C_s'])
lines(times,sol[,'C_b'])

plot of chunk unnamed-chunk-6