About the multiple simulations

Hello, many scripts can plot mutiple simulations acoording to the user-guide. for example run_scatterplot.csh , run_timeseries.csh etc. I can run these scripts for two simulations successfully. But they doesn’t work for more than two simulations. following is the run_timeseries.csh, but the AMET_PROJECT3 couldn’t plot. so I need the help for how to run the scripts on more than two simulations.
Thank you very much.
run_timeseries.csh (6.0 KB)

Hi,

The primary and secondary simulations can be specified through the AMET run scripts using the setenv command. To plot more than two simulations you’ll need to specify the additional simulations directly in the “all_scripts.input” file. In that file you’ll see the following section:

#########################

Project ID Name 1

#########################
run_name1<-Sys.getenv(“AMET_PROJECT”)
run_name2<-Sys.getenv(“AMET_PROJECT2”)

Additional run names for some analyses

run_name3 ← “”
run_name4 ← “”
run_name5 ← “”
run_name6 ← “”

You’ll see that run_name1 and run_name2 are obtained from the system environment. The additional simulations need to specified directly. So, simply specify your additional simulation names here and they will be included in your plots.

I will look at perhaps updating my code to allow you to either specify simulations either directly in the all_scripts.input file or through the system environment.

Let me know if you have any further difficulty.

Wyat

1 Like

Thank you very much. the additional simulations can be ploted successfully. But there is another problem, If i want to change the line style on the time series plots, for example change the solid line to the dotted line for the third simulaton and the fourth simulation, what should i do? I have read the " all_scripts.input” file, but i am afraid i can’t find the parameter.
Thanks for your sincere help.

Hi,

Unfortunately there is currently no way to change the line type through the all_scripts.input file. You’ll need to edit the R script directly to do that.

Assuming you’re plotting using the AQ_Timeseries.R script, you’ll need to edit the section of that code that specifies the line type. Here is the relevant section in that code (note the code in bold):

if (num_runs > 1) {
for (k in 2:num_runs) {
lines(Dates[[k]],Mod_Mean[[k]],col=plot_colors[k+1],lty=1,lwd=line_width)
if (inc_points == ‘y’) {
points(Dates[[k]],Mod_Mean[[k]],col=plot_colors[k+1])
}
legend_names ← c(legend_names,run_names[k])
legend_colors ← c(legend_colors,plot_colors[k+1])
if (Num_Obs[[k]] != Num_Obs[[1]]) {
num_diff ← abs(Num_Obs[[k]]-Num_Obs[[1]])
sub.title ← paste(“Warning: Number of observations differ by”,num_diff,“between simulations”,sep=" ")
}
}
}

To specify a different line type for each simulation you’ll need to setup an array. Here is an example of the new code:

line_types ← c(1,2,3,4,5,6)

if (num_runs > 1) {
for (k in 2:num_runs) {
lines(Dates[[k]],Mod_Mean[[k]],col=plot_colors[k+1],lty=line_types[k],lwd=line_width)
if (inc_points == ‘y’) {
points(Dates[[k]],Mod_Mean[[k]],col=plot_colors[k+1])
}
legend_names ← c(legend_names,run_names[k])
legend_colors ← c(legend_colors,plot_colors[k+1])
if (Num_Obs[[k]] != Num_Obs[[1]]) {
num_diff ← abs(Num_Obs[[k]]-Num_Obs[[1]])
sub.title ← paste(“Warning: Number of observations differ by”,num_diff,“between simulations”,sep=" ")
}
}
}

Above I’ve specified an array of line types called “line_types”, and then in the plotting code specify the line type as lty=line_types[k], where k is the simulation number beyond the first simulation. So, for simulation 2 the line_type will be 2; for simulation 3 the line type will be 3, etc.

Let me know if you have any trouble implementing this change.

Wyat

1 Like

Thanks for your help.
Best wishes.

thanks for sharing, this helps me so juch

1 Like

thanks for sharing.
.